jquery.js 282 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882
  1. /*!
  2. * jQuery JavaScript Library v3.6.0
  3. * https://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * https://sizzlejs.com/
  7. *
  8. * Copyright OpenJS Foundation and other contributors
  9. * Released under the MIT license
  10. * https://jquery.org/license
  11. *
  12. * Date: 2021-03-02T17:08Z
  13. */
  14. ( function( global, factory ) {
  15. "use strict";
  16. if ( typeof module === "object" && typeof module.exports === "object" ) {
  17. // For CommonJS and CommonJS-like environments where a proper `window`
  18. // is present, execute the factory and get jQuery.
  19. // For environments that do not have a `window` with a `document`
  20. // (such as Node.js), expose a factory as module.exports.
  21. // This accentuates the need for the creation of a real `window`.
  22. // e.g. var jQuery = require("jquery")(window);
  23. // See ticket #14549 for more info.
  24. module.exports = global.document ?
  25. factory( global, true ) :
  26. function( w ) {
  27. if ( !w.document ) {
  28. throw new Error( "jQuery requires a window with a document" );
  29. }
  30. return factory( w );
  31. };
  32. } else {
  33. factory( global );
  34. }
  35. // Pass this if window is not defined yet
  36. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  37. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  38. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  39. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  40. // enough that all such attempts are guarded in a try block.
  41. "use strict";
  42. var arr = [];
  43. var getProto = Object.getPrototypeOf;
  44. var slice = arr.slice;
  45. var flat = arr.flat ? function( array ) {
  46. return arr.flat.call( array );
  47. } : function( array ) {
  48. return arr.concat.apply( [], array );
  49. };
  50. var push = arr.push;
  51. var indexOf = arr.indexOf;
  52. var class2type = {};
  53. var toString = class2type.toString;
  54. var hasOwn = class2type.hasOwnProperty;
  55. var fnToString = hasOwn.toString;
  56. var ObjectFunctionString = fnToString.call( Object );
  57. var support = {};
  58. var isFunction = function isFunction( obj ) {
  59. // Support: Chrome <=57, Firefox <=52
  60. // In some browsers, typeof returns "function" for HTML <object> elements
  61. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  62. // We don't want to classify *any* DOM node as a function.
  63. // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
  64. // Plus for old WebKit, typeof returns "function" for HTML collections
  65. // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
  66. return typeof obj === "function" && typeof obj.nodeType !== "number" &&
  67. typeof obj.item !== "function";
  68. };
  69. var isWindow = function isWindow( obj ) {
  70. return obj != null && obj === obj.window;
  71. };
  72. var document = window.document;
  73. var preservedScriptAttributes = {
  74. type: true,
  75. src: true,
  76. nonce: true,
  77. noModule: true
  78. };
  79. function DOMEval( code, node, doc ) {
  80. doc = doc || document;
  81. var i, val,
  82. script = doc.createElement( "script" );
  83. script.text = code;
  84. if ( node ) {
  85. for ( i in preservedScriptAttributes ) {
  86. // Support: Firefox 64+, Edge 18+
  87. // Some browsers don't support the "nonce" property on scripts.
  88. // On the other hand, just using `getAttribute` is not enough as
  89. // the `nonce` attribute is reset to an empty string whenever it
  90. // becomes browsing-context connected.
  91. // See https://github.com/whatwg/html/issues/2369
  92. // See https://html.spec.whatwg.org/#nonce-attributes
  93. // The `node.getAttribute` check was added for the sake of
  94. // `jQuery.globalEval` so that it can fake a nonce-containing node
  95. // via an object.
  96. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  97. if ( val ) {
  98. script.setAttribute( i, val );
  99. }
  100. }
  101. }
  102. doc.head.appendChild( script ).parentNode.removeChild( script );
  103. }
  104. function toType( obj ) {
  105. if ( obj == null ) {
  106. return obj + "";
  107. }
  108. // Support: Android <=2.3 only (functionish RegExp)
  109. return typeof obj === "object" || typeof obj === "function" ?
  110. class2type[ toString.call( obj ) ] || "object" :
  111. typeof obj;
  112. }
  113. /* global Symbol */
  114. // Defining this global in .eslintrc.json would create a danger of using the global
  115. // unguarded in another place, it seems safer to define global only for this module
  116. var
  117. version = "3.6.0",
  118. // Define a local copy of jQuery
  119. jQuery = function( selector, context ) {
  120. // The jQuery object is actually just the init constructor 'enhanced'
  121. // Need init if jQuery is called (just allow error to be thrown if not included)
  122. return new jQuery.fn.init( selector, context );
  123. };
  124. jQuery.fn = jQuery.prototype = {
  125. // The current version of jQuery being used
  126. jquery: version,
  127. constructor: jQuery,
  128. // The default length of a jQuery object is 0
  129. length: 0,
  130. toArray: function() {
  131. return slice.call( this );
  132. },
  133. // Get the Nth element in the matched element set OR
  134. // Get the whole matched element set as a clean array
  135. get: function( num ) {
  136. // Return all the elements in a clean array
  137. if ( num == null ) {
  138. return slice.call( this );
  139. }
  140. // Return just the one element from the set
  141. return num < 0 ? this[ num + this.length ] : this[ num ];
  142. },
  143. // Take an array of elements and push it onto the stack
  144. // (returning the new matched element set)
  145. pushStack: function( elems ) {
  146. // Build a new jQuery matched element set
  147. var ret = jQuery.merge( this.constructor(), elems );
  148. // Add the old object onto the stack (as a reference)
  149. ret.prevObject = this;
  150. // Return the newly-formed element set
  151. return ret;
  152. },
  153. // Execute a callback for every element in the matched set.
  154. each: function( callback ) {
  155. return jQuery.each( this, callback );
  156. },
  157. map: function( callback ) {
  158. return this.pushStack( jQuery.map( this, function( elem, i ) {
  159. return callback.call( elem, i, elem );
  160. } ) );
  161. },
  162. slice: function() {
  163. return this.pushStack( slice.apply( this, arguments ) );
  164. },
  165. first: function() {
  166. return this.eq( 0 );
  167. },
  168. last: function() {
  169. return this.eq( -1 );
  170. },
  171. even: function() {
  172. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  173. return ( i + 1 ) % 2;
  174. } ) );
  175. },
  176. odd: function() {
  177. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  178. return i % 2;
  179. } ) );
  180. },
  181. eq: function( i ) {
  182. var len = this.length,
  183. j = +i + ( i < 0 ? len : 0 );
  184. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  185. },
  186. end: function() {
  187. return this.prevObject || this.constructor();
  188. },
  189. // For internal use only.
  190. // Behaves like an Array's method, not like a jQuery method.
  191. push: push,
  192. sort: arr.sort,
  193. splice: arr.splice
  194. };
  195. jQuery.extend = jQuery.fn.extend = function() {
  196. var options, name, src, copy, copyIsArray, clone,
  197. target = arguments[ 0 ] || {},
  198. i = 1,
  199. length = arguments.length,
  200. deep = false;
  201. // Handle a deep copy situation
  202. if ( typeof target === "boolean" ) {
  203. deep = target;
  204. // Skip the boolean and the target
  205. target = arguments[ i ] || {};
  206. i++;
  207. }
  208. // Handle case when target is a string or something (possible in deep copy)
  209. if ( typeof target !== "object" && !isFunction( target ) ) {
  210. target = {};
  211. }
  212. // Extend jQuery itself if only one argument is passed
  213. if ( i === length ) {
  214. target = this;
  215. i--;
  216. }
  217. for ( ; i < length; i++ ) {
  218. // Only deal with non-null/undefined values
  219. if ( ( options = arguments[ i ] ) != null ) {
  220. // Extend the base object
  221. for ( name in options ) {
  222. copy = options[ name ];
  223. // Prevent Object.prototype pollution
  224. // Prevent never-ending loop
  225. if ( name === "__proto__" || target === copy ) {
  226. continue;
  227. }
  228. // Recurse if we're merging plain objects or arrays
  229. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  230. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  231. src = target[ name ];
  232. // Ensure proper type for the source value
  233. if ( copyIsArray && !Array.isArray( src ) ) {
  234. clone = [];
  235. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  236. clone = {};
  237. } else {
  238. clone = src;
  239. }
  240. copyIsArray = false;
  241. // Never move original objects, clone them
  242. target[ name ] = jQuery.extend( deep, clone, copy );
  243. // Don't bring in undefined values
  244. } else if ( copy !== undefined ) {
  245. target[ name ] = copy;
  246. }
  247. }
  248. }
  249. }
  250. // Return the modified object
  251. return target;
  252. };
  253. jQuery.extend( {
  254. // Unique for each copy of jQuery on the page
  255. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  256. // Assume jQuery is ready without the ready module
  257. isReady: true,
  258. error: function( msg ) {
  259. throw new Error( msg );
  260. },
  261. noop: function() {},
  262. isPlainObject: function( obj ) {
  263. var proto, Ctor;
  264. // Detect obvious negatives
  265. // Use toString instead of jQuery.type to catch host objects
  266. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  267. return false;
  268. }
  269. proto = getProto( obj );
  270. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  271. if ( !proto ) {
  272. return true;
  273. }
  274. // Objects with prototype are plain iff they were constructed by a global Object function
  275. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  276. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  277. },
  278. isEmptyObject: function( obj ) {
  279. var name;
  280. for ( name in obj ) {
  281. return false;
  282. }
  283. return true;
  284. },
  285. // Evaluates a script in a provided context; falls back to the global one
  286. // if not specified.
  287. globalEval: function( code, options, doc ) {
  288. DOMEval( code, { nonce: options && options.nonce }, doc );
  289. },
  290. each: function( obj, callback ) {
  291. var length, i = 0;
  292. if ( isArrayLike( obj ) ) {
  293. length = obj.length;
  294. for ( ; i < length; i++ ) {
  295. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  296. break;
  297. }
  298. }
  299. } else {
  300. for ( i in obj ) {
  301. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  302. break;
  303. }
  304. }
  305. }
  306. return obj;
  307. },
  308. // results is for internal usage only
  309. makeArray: function( arr, results ) {
  310. var ret = results || [];
  311. if ( arr != null ) {
  312. if ( isArrayLike( Object( arr ) ) ) {
  313. jQuery.merge( ret,
  314. typeof arr === "string" ?
  315. [ arr ] : arr
  316. );
  317. } else {
  318. push.call( ret, arr );
  319. }
  320. }
  321. return ret;
  322. },
  323. inArray: function( elem, arr, i ) {
  324. return arr == null ? -1 : indexOf.call( arr, elem, i );
  325. },
  326. // Support: Android <=4.0 only, PhantomJS 1 only
  327. // push.apply(_, arraylike) throws on ancient WebKit
  328. merge: function( first, second ) {
  329. var len = +second.length,
  330. j = 0,
  331. i = first.length;
  332. for ( ; j < len; j++ ) {
  333. first[ i++ ] = second[ j ];
  334. }
  335. first.length = i;
  336. return first;
  337. },
  338. grep: function( elems, callback, invert ) {
  339. var callbackInverse,
  340. matches = [],
  341. i = 0,
  342. length = elems.length,
  343. callbackExpect = !invert;
  344. // Go through the array, only saving the items
  345. // that pass the validator function
  346. for ( ; i < length; i++ ) {
  347. callbackInverse = !callback( elems[ i ], i );
  348. if ( callbackInverse !== callbackExpect ) {
  349. matches.push( elems[ i ] );
  350. }
  351. }
  352. return matches;
  353. },
  354. // arg is for internal usage only
  355. map: function( elems, callback, arg ) {
  356. var length, value,
  357. i = 0,
  358. ret = [];
  359. // Go through the array, translating each of the items to their new values
  360. if ( isArrayLike( elems ) ) {
  361. length = elems.length;
  362. for ( ; i < length; i++ ) {
  363. value = callback( elems[ i ], i, arg );
  364. if ( value != null ) {
  365. ret.push( value );
  366. }
  367. }
  368. // Go through every key on the object,
  369. } else {
  370. for ( i in elems ) {
  371. value = callback( elems[ i ], i, arg );
  372. if ( value != null ) {
  373. ret.push( value );
  374. }
  375. }
  376. }
  377. // Flatten any nested arrays
  378. return flat( ret );
  379. },
  380. // A global GUID counter for objects
  381. guid: 1,
  382. // jQuery.support is not used in Core but other projects attach their
  383. // properties to it so it needs to exist.
  384. support: support
  385. } );
  386. if ( typeof Symbol === "function" ) {
  387. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  388. }
  389. // Populate the class2type map
  390. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  391. function( _i, name ) {
  392. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  393. } );
  394. function isArrayLike( obj ) {
  395. // Support: real iOS 8.2 only (not reproducible in simulator)
  396. // `in` check used to prevent JIT error (gh-2145)
  397. // hasOwn isn't used here due to false negatives
  398. // regarding Nodelist length in IE
  399. var length = !!obj && "length" in obj && obj.length,
  400. type = toType( obj );
  401. if ( isFunction( obj ) || isWindow( obj ) ) {
  402. return false;
  403. }
  404. return type === "array" || length === 0 ||
  405. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  406. }
  407. var Sizzle =
  408. /*!
  409. * Sizzle CSS Selector Engine v2.3.6
  410. * https://sizzlejs.com/
  411. *
  412. * Copyright JS Foundation and other contributors
  413. * Released under the MIT license
  414. * https://js.foundation/
  415. *
  416. * Date: 2021-02-16
  417. */
  418. ( function( window ) {
  419. var i,
  420. support,
  421. Expr,
  422. getText,
  423. isXML,
  424. tokenize,
  425. compile,
  426. select,
  427. outermostContext,
  428. sortInput,
  429. hasDuplicate,
  430. // Local document vars
  431. setDocument,
  432. document,
  433. docElem,
  434. documentIsHTML,
  435. rbuggyQSA,
  436. rbuggyMatches,
  437. matches,
  438. contains,
  439. // Instance-specific data
  440. expando = "sizzle" + 1 * new Date(),
  441. preferredDoc = window.document,
  442. dirruns = 0,
  443. done = 0,
  444. classCache = createCache(),
  445. tokenCache = createCache(),
  446. compilerCache = createCache(),
  447. nonnativeSelectorCache = createCache(),
  448. sortOrder = function( a, b ) {
  449. if ( a === b ) {
  450. hasDuplicate = true;
  451. }
  452. return 0;
  453. },
  454. // Instance methods
  455. hasOwn = ( {} ).hasOwnProperty,
  456. arr = [],
  457. pop = arr.pop,
  458. pushNative = arr.push,
  459. push = arr.push,
  460. slice = arr.slice,
  461. // Use a stripped-down indexOf as it's faster than native
  462. // https://jsperf.com/thor-indexof-vs-for/5
  463. indexOf = function( list, elem ) {
  464. var i = 0,
  465. len = list.length;
  466. for ( ; i < len; i++ ) {
  467. if ( list[ i ] === elem ) {
  468. return i;
  469. }
  470. }
  471. return -1;
  472. },
  473. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  474. "ismap|loop|multiple|open|readonly|required|scoped",
  475. // Regular expressions
  476. // http://www.w3.org/TR/css3-selectors/#whitespace
  477. whitespace = "[\\x20\\t\\r\\n\\f]",
  478. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  479. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  480. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  481. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  482. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  483. // Operator (capture 2)
  484. "*([*^$|!~]?=)" + whitespace +
  485. // "Attribute values must be CSS identifiers [capture 5]
  486. // or strings [capture 3 or capture 4]"
  487. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  488. whitespace + "*\\]",
  489. pseudos = ":(" + identifier + ")(?:\\((" +
  490. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  491. // 1. quoted (capture 3; capture 4 or capture 5)
  492. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  493. // 2. simple (capture 6)
  494. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  495. // 3. anything else (capture 2)
  496. ".*" +
  497. ")\\)|)",
  498. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  499. rwhitespace = new RegExp( whitespace + "+", "g" ),
  500. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  501. whitespace + "+$", "g" ),
  502. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  503. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  504. "*" ),
  505. rdescend = new RegExp( whitespace + "|>" ),
  506. rpseudo = new RegExp( pseudos ),
  507. ridentifier = new RegExp( "^" + identifier + "$" ),
  508. matchExpr = {
  509. "ID": new RegExp( "^#(" + identifier + ")" ),
  510. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  511. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  512. "ATTR": new RegExp( "^" + attributes ),
  513. "PSEUDO": new RegExp( "^" + pseudos ),
  514. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  515. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  516. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  517. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  518. // For use in libraries implementing .is()
  519. // We use this for POS matching in `select`
  520. "needsContext": new RegExp( "^" + whitespace +
  521. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  522. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  523. },
  524. rhtml = /HTML$/i,
  525. rinputs = /^(?:input|select|textarea|button)$/i,
  526. rheader = /^h\d$/i,
  527. rnative = /^[^{]+\{\s*\[native \w/,
  528. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  529. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  530. rsibling = /[+~]/,
  531. // CSS escapes
  532. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  533. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  534. funescape = function( escape, nonHex ) {
  535. var high = "0x" + escape.slice( 1 ) - 0x10000;
  536. return nonHex ?
  537. // Strip the backslash prefix from a non-hex escape sequence
  538. nonHex :
  539. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  540. // Support: IE <=11+
  541. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  542. // surrogate pair
  543. high < 0 ?
  544. String.fromCharCode( high + 0x10000 ) :
  545. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  546. },
  547. // CSS string/identifier serialization
  548. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  549. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  550. fcssescape = function( ch, asCodePoint ) {
  551. if ( asCodePoint ) {
  552. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  553. if ( ch === "\0" ) {
  554. return "\uFFFD";
  555. }
  556. // Control characters and (dependent upon position) numbers get escaped as code points
  557. return ch.slice( 0, -1 ) + "\\" +
  558. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  559. }
  560. // Other potentially-special ASCII characters get backslash-escaped
  561. return "\\" + ch;
  562. },
  563. // Used for iframes
  564. // See setDocument()
  565. // Removing the function wrapper causes a "Permission Denied"
  566. // error in IE
  567. unloadHandler = function() {
  568. setDocument();
  569. },
  570. inDisabledFieldset = addCombinator(
  571. function( elem ) {
  572. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  573. },
  574. { dir: "parentNode", next: "legend" }
  575. );
  576. // Optimize for push.apply( _, NodeList )
  577. try {
  578. push.apply(
  579. ( arr = slice.call( preferredDoc.childNodes ) ),
  580. preferredDoc.childNodes
  581. );
  582. // Support: Android<4.0
  583. // Detect silently failing push.apply
  584. // eslint-disable-next-line no-unused-expressions
  585. arr[ preferredDoc.childNodes.length ].nodeType;
  586. } catch ( e ) {
  587. push = { apply: arr.length ?
  588. // Leverage slice if possible
  589. function( target, els ) {
  590. pushNative.apply( target, slice.call( els ) );
  591. } :
  592. // Support: IE<9
  593. // Otherwise append directly
  594. function( target, els ) {
  595. var j = target.length,
  596. i = 0;
  597. // Can't trust NodeList.length
  598. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  599. target.length = j - 1;
  600. }
  601. };
  602. }
  603. function Sizzle( selector, context, results, seed ) {
  604. var m, i, elem, nid, match, groups, newSelector,
  605. newContext = context && context.ownerDocument,
  606. // nodeType defaults to 9, since context defaults to document
  607. nodeType = context ? context.nodeType : 9;
  608. results = results || [];
  609. // Return early from calls with invalid selector or context
  610. if ( typeof selector !== "string" || !selector ||
  611. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  612. return results;
  613. }
  614. // Try to shortcut find operations (as opposed to filters) in HTML documents
  615. if ( !seed ) {
  616. setDocument( context );
  617. context = context || document;
  618. if ( documentIsHTML ) {
  619. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  620. // (excepting DocumentFragment context, where the methods don't exist)
  621. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  622. // ID selector
  623. if ( ( m = match[ 1 ] ) ) {
  624. // Document context
  625. if ( nodeType === 9 ) {
  626. if ( ( elem = context.getElementById( m ) ) ) {
  627. // Support: IE, Opera, Webkit
  628. // TODO: identify versions
  629. // getElementById can match elements by name instead of ID
  630. if ( elem.id === m ) {
  631. results.push( elem );
  632. return results;
  633. }
  634. } else {
  635. return results;
  636. }
  637. // Element context
  638. } else {
  639. // Support: IE, Opera, Webkit
  640. // TODO: identify versions
  641. // getElementById can match elements by name instead of ID
  642. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  643. contains( context, elem ) &&
  644. elem.id === m ) {
  645. results.push( elem );
  646. return results;
  647. }
  648. }
  649. // Type selector
  650. } else if ( match[ 2 ] ) {
  651. push.apply( results, context.getElementsByTagName( selector ) );
  652. return results;
  653. // Class selector
  654. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  655. context.getElementsByClassName ) {
  656. push.apply( results, context.getElementsByClassName( m ) );
  657. return results;
  658. }
  659. }
  660. // Take advantage of querySelectorAll
  661. if ( support.qsa &&
  662. !nonnativeSelectorCache[ selector + " " ] &&
  663. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  664. // Support: IE 8 only
  665. // Exclude object elements
  666. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  667. newSelector = selector;
  668. newContext = context;
  669. // qSA considers elements outside a scoping root when evaluating child or
  670. // descendant combinators, which is not what we want.
  671. // In such cases, we work around the behavior by prefixing every selector in the
  672. // list with an ID selector referencing the scope context.
  673. // The technique has to be used as well when a leading combinator is used
  674. // as such selectors are not recognized by querySelectorAll.
  675. // Thanks to Andrew Dupont for this technique.
  676. if ( nodeType === 1 &&
  677. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  678. // Expand context for sibling selectors
  679. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  680. context;
  681. // We can use :scope instead of the ID hack if the browser
  682. // supports it & if we're not changing the context.
  683. if ( newContext !== context || !support.scope ) {
  684. // Capture the context ID, setting it first if necessary
  685. if ( ( nid = context.getAttribute( "id" ) ) ) {
  686. nid = nid.replace( rcssescape, fcssescape );
  687. } else {
  688. context.setAttribute( "id", ( nid = expando ) );
  689. }
  690. }
  691. // Prefix every selector in the list
  692. groups = tokenize( selector );
  693. i = groups.length;
  694. while ( i-- ) {
  695. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  696. toSelector( groups[ i ] );
  697. }
  698. newSelector = groups.join( "," );
  699. }
  700. try {
  701. push.apply( results,
  702. newContext.querySelectorAll( newSelector )
  703. );
  704. return results;
  705. } catch ( qsaError ) {
  706. nonnativeSelectorCache( selector, true );
  707. } finally {
  708. if ( nid === expando ) {
  709. context.removeAttribute( "id" );
  710. }
  711. }
  712. }
  713. }
  714. }
  715. // All others
  716. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  717. }
  718. /**
  719. * Create key-value caches of limited size
  720. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  721. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  722. * deleting the oldest entry
  723. */
  724. function createCache() {
  725. var keys = [];
  726. function cache( key, value ) {
  727. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  728. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  729. // Only keep the most recent entries
  730. delete cache[ keys.shift() ];
  731. }
  732. return ( cache[ key + " " ] = value );
  733. }
  734. return cache;
  735. }
  736. /**
  737. * Mark a function for special use by Sizzle
  738. * @param {Function} fn The function to mark
  739. */
  740. function markFunction( fn ) {
  741. fn[ expando ] = true;
  742. return fn;
  743. }
  744. /**
  745. * Support testing using an element
  746. * @param {Function} fn Passed the created element and returns a boolean result
  747. */
  748. function assert( fn ) {
  749. var el = document.createElement( "fieldset" );
  750. try {
  751. return !!fn( el );
  752. } catch ( e ) {
  753. return false;
  754. } finally {
  755. // Remove from its parent by default
  756. if ( el.parentNode ) {
  757. el.parentNode.removeChild( el );
  758. }
  759. // release memory in IE
  760. el = null;
  761. }
  762. }
  763. /**
  764. * Adds the same handler for all of the specified attrs
  765. * @param {String} attrs Pipe-separated list of attributes
  766. * @param {Function} handler The method that will be applied
  767. */
  768. function addHandle( attrs, handler ) {
  769. var arr = attrs.split( "|" ),
  770. i = arr.length;
  771. while ( i-- ) {
  772. Expr.attrHandle[ arr[ i ] ] = handler;
  773. }
  774. }
  775. /**
  776. * Checks document order of two siblings
  777. * @param {Element} a
  778. * @param {Element} b
  779. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  780. */
  781. function siblingCheck( a, b ) {
  782. var cur = b && a,
  783. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  784. a.sourceIndex - b.sourceIndex;
  785. // Use IE sourceIndex if available on both nodes
  786. if ( diff ) {
  787. return diff;
  788. }
  789. // Check if b follows a
  790. if ( cur ) {
  791. while ( ( cur = cur.nextSibling ) ) {
  792. if ( cur === b ) {
  793. return -1;
  794. }
  795. }
  796. }
  797. return a ? 1 : -1;
  798. }
  799. /**
  800. * Returns a function to use in pseudos for input types
  801. * @param {String} type
  802. */
  803. function createInputPseudo( type ) {
  804. return function( elem ) {
  805. var name = elem.nodeName.toLowerCase();
  806. return name === "input" && elem.type === type;
  807. };
  808. }
  809. /**
  810. * Returns a function to use in pseudos for buttons
  811. * @param {String} type
  812. */
  813. function createButtonPseudo( type ) {
  814. return function( elem ) {
  815. var name = elem.nodeName.toLowerCase();
  816. return ( name === "input" || name === "button" ) && elem.type === type;
  817. };
  818. }
  819. /**
  820. * Returns a function to use in pseudos for :enabled/:disabled
  821. * @param {Boolean} disabled true for :disabled; false for :enabled
  822. */
  823. function createDisabledPseudo( disabled ) {
  824. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  825. return function( elem ) {
  826. // Only certain elements can match :enabled or :disabled
  827. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  828. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  829. if ( "form" in elem ) {
  830. // Check for inherited disabledness on relevant non-disabled elements:
  831. // * listed form-associated elements in a disabled fieldset
  832. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  833. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  834. // * option elements in a disabled optgroup
  835. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  836. // All such elements have a "form" property.
  837. if ( elem.parentNode && elem.disabled === false ) {
  838. // Option elements defer to a parent optgroup if present
  839. if ( "label" in elem ) {
  840. if ( "label" in elem.parentNode ) {
  841. return elem.parentNode.disabled === disabled;
  842. } else {
  843. return elem.disabled === disabled;
  844. }
  845. }
  846. // Support: IE 6 - 11
  847. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  848. return elem.isDisabled === disabled ||
  849. // Where there is no isDisabled, check manually
  850. /* jshint -W018 */
  851. elem.isDisabled !== !disabled &&
  852. inDisabledFieldset( elem ) === disabled;
  853. }
  854. return elem.disabled === disabled;
  855. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  856. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  857. // even exist on them, let alone have a boolean value.
  858. } else if ( "label" in elem ) {
  859. return elem.disabled === disabled;
  860. }
  861. // Remaining elements are neither :enabled nor :disabled
  862. return false;
  863. };
  864. }
  865. /**
  866. * Returns a function to use in pseudos for positionals
  867. * @param {Function} fn
  868. */
  869. function createPositionalPseudo( fn ) {
  870. return markFunction( function( argument ) {
  871. argument = +argument;
  872. return markFunction( function( seed, matches ) {
  873. var j,
  874. matchIndexes = fn( [], seed.length, argument ),
  875. i = matchIndexes.length;
  876. // Match elements found at the specified indexes
  877. while ( i-- ) {
  878. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  879. seed[ j ] = !( matches[ j ] = seed[ j ] );
  880. }
  881. }
  882. } );
  883. } );
  884. }
  885. /**
  886. * Checks a node for validity as a Sizzle context
  887. * @param {Element|Object=} context
  888. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  889. */
  890. function testContext( context ) {
  891. return context && typeof context.getElementsByTagName !== "undefined" && context;
  892. }
  893. // Expose support vars for convenience
  894. support = Sizzle.support = {};
  895. /**
  896. * Detects XML nodes
  897. * @param {Element|Object} elem An element or a document
  898. * @returns {Boolean} True iff elem is a non-HTML XML node
  899. */
  900. isXML = Sizzle.isXML = function( elem ) {
  901. var namespace = elem && elem.namespaceURI,
  902. docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  903. // Support: IE <=8
  904. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  905. // https://bugs.jquery.com/ticket/4833
  906. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  907. };
  908. /**
  909. * Sets document-related variables once based on the current document
  910. * @param {Element|Object} [doc] An element or document object to use to set the document
  911. * @returns {Object} Returns the current document
  912. */
  913. setDocument = Sizzle.setDocument = function( node ) {
  914. var hasCompare, subWindow,
  915. doc = node ? node.ownerDocument || node : preferredDoc;
  916. // Return early if doc is invalid or already selected
  917. // Support: IE 11+, Edge 17 - 18+
  918. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  919. // two documents; shallow comparisons work.
  920. // eslint-disable-next-line eqeqeq
  921. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  922. return document;
  923. }
  924. // Update global variables
  925. document = doc;
  926. docElem = document.documentElement;
  927. documentIsHTML = !isXML( document );
  928. // Support: IE 9 - 11+, Edge 12 - 18+
  929. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  930. // Support: IE 11+, Edge 17 - 18+
  931. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  932. // two documents; shallow comparisons work.
  933. // eslint-disable-next-line eqeqeq
  934. if ( preferredDoc != document &&
  935. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  936. // Support: IE 11, Edge
  937. if ( subWindow.addEventListener ) {
  938. subWindow.addEventListener( "unload", unloadHandler, false );
  939. // Support: IE 9 - 10 only
  940. } else if ( subWindow.attachEvent ) {
  941. subWindow.attachEvent( "onunload", unloadHandler );
  942. }
  943. }
  944. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  945. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  946. // IE/Edge & older browsers don't support the :scope pseudo-class.
  947. // Support: Safari 6.0 only
  948. // Safari 6.0 supports :scope but it's an alias of :root there.
  949. support.scope = assert( function( el ) {
  950. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  951. return typeof el.querySelectorAll !== "undefined" &&
  952. !el.querySelectorAll( ":scope fieldset div" ).length;
  953. } );
  954. /* Attributes
  955. ---------------------------------------------------------------------- */
  956. // Support: IE<8
  957. // Verify that getAttribute really returns attributes and not properties
  958. // (excepting IE8 booleans)
  959. support.attributes = assert( function( el ) {
  960. el.className = "i";
  961. return !el.getAttribute( "className" );
  962. } );
  963. /* getElement(s)By*
  964. ---------------------------------------------------------------------- */
  965. // Check if getElementsByTagName("*") returns only elements
  966. support.getElementsByTagName = assert( function( el ) {
  967. el.appendChild( document.createComment( "" ) );
  968. return !el.getElementsByTagName( "*" ).length;
  969. } );
  970. // Support: IE<9
  971. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  972. // Support: IE<10
  973. // Check if getElementById returns elements by name
  974. // The broken getElementById methods don't pick up programmatically-set names,
  975. // so use a roundabout getElementsByName test
  976. support.getById = assert( function( el ) {
  977. docElem.appendChild( el ).id = expando;
  978. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  979. } );
  980. // ID filter and find
  981. if ( support.getById ) {
  982. Expr.filter[ "ID" ] = function( id ) {
  983. var attrId = id.replace( runescape, funescape );
  984. return function( elem ) {
  985. return elem.getAttribute( "id" ) === attrId;
  986. };
  987. };
  988. Expr.find[ "ID" ] = function( id, context ) {
  989. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  990. var elem = context.getElementById( id );
  991. return elem ? [ elem ] : [];
  992. }
  993. };
  994. } else {
  995. Expr.filter[ "ID" ] = function( id ) {
  996. var attrId = id.replace( runescape, funescape );
  997. return function( elem ) {
  998. var node = typeof elem.getAttributeNode !== "undefined" &&
  999. elem.getAttributeNode( "id" );
  1000. return node && node.value === attrId;
  1001. };
  1002. };
  1003. // Support: IE 6 - 7 only
  1004. // getElementById is not reliable as a find shortcut
  1005. Expr.find[ "ID" ] = function( id, context ) {
  1006. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1007. var node, i, elems,
  1008. elem = context.getElementById( id );
  1009. if ( elem ) {
  1010. // Verify the id attribute
  1011. node = elem.getAttributeNode( "id" );
  1012. if ( node && node.value === id ) {
  1013. return [ elem ];
  1014. }
  1015. // Fall back on getElementsByName
  1016. elems = context.getElementsByName( id );
  1017. i = 0;
  1018. while ( ( elem = elems[ i++ ] ) ) {
  1019. node = elem.getAttributeNode( "id" );
  1020. if ( node && node.value === id ) {
  1021. return [ elem ];
  1022. }
  1023. }
  1024. }
  1025. return [];
  1026. }
  1027. };
  1028. }
  1029. // Tag
  1030. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  1031. function( tag, context ) {
  1032. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1033. return context.getElementsByTagName( tag );
  1034. // DocumentFragment nodes don't have gEBTN
  1035. } else if ( support.qsa ) {
  1036. return context.querySelectorAll( tag );
  1037. }
  1038. } :
  1039. function( tag, context ) {
  1040. var elem,
  1041. tmp = [],
  1042. i = 0,
  1043. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1044. results = context.getElementsByTagName( tag );
  1045. // Filter out possible comments
  1046. if ( tag === "*" ) {
  1047. while ( ( elem = results[ i++ ] ) ) {
  1048. if ( elem.nodeType === 1 ) {
  1049. tmp.push( elem );
  1050. }
  1051. }
  1052. return tmp;
  1053. }
  1054. return results;
  1055. };
  1056. // Class
  1057. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  1058. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1059. return context.getElementsByClassName( className );
  1060. }
  1061. };
  1062. /* QSA/matchesSelector
  1063. ---------------------------------------------------------------------- */
  1064. // QSA and matchesSelector support
  1065. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1066. rbuggyMatches = [];
  1067. // qSa(:focus) reports false when true (Chrome 21)
  1068. // We allow this because of a bug in IE8/9 that throws an error
  1069. // whenever `document.activeElement` is accessed on an iframe
  1070. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1071. // See https://bugs.jquery.com/ticket/13378
  1072. rbuggyQSA = [];
  1073. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  1074. // Build QSA regex
  1075. // Regex strategy adopted from Diego Perini
  1076. assert( function( el ) {
  1077. var input;
  1078. // Select is set to empty string on purpose
  1079. // This is to test IE's treatment of not explicitly
  1080. // setting a boolean content attribute,
  1081. // since its presence should be enough
  1082. // https://bugs.jquery.com/ticket/12359
  1083. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1084. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1085. "<option selected=''></option></select>";
  1086. // Support: IE8, Opera 11-12.16
  1087. // Nothing should be selected when empty strings follow ^= or $= or *=
  1088. // The test attribute must be unknown in Opera but "safe" for WinRT
  1089. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1090. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  1091. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1092. }
  1093. // Support: IE8
  1094. // Boolean attributes and "value" are not treated correctly
  1095. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1096. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1097. }
  1098. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1099. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1100. rbuggyQSA.push( "~=" );
  1101. }
  1102. // Support: IE 11+, Edge 15 - 18+
  1103. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1104. // Adding a temporary attribute to the document before the selection works
  1105. // around the issue.
  1106. // Interestingly, IE 10 & older don't seem to have the issue.
  1107. input = document.createElement( "input" );
  1108. input.setAttribute( "name", "" );
  1109. el.appendChild( input );
  1110. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1111. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1112. whitespace + "*(?:''|\"\")" );
  1113. }
  1114. // Webkit/Opera - :checked should return selected option elements
  1115. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1116. // IE8 throws error here and will not see later tests
  1117. if ( !el.querySelectorAll( ":checked" ).length ) {
  1118. rbuggyQSA.push( ":checked" );
  1119. }
  1120. // Support: Safari 8+, iOS 8+
  1121. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1122. // In-page `selector#id sibling-combinator selector` fails
  1123. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1124. rbuggyQSA.push( ".#.+[+~]" );
  1125. }
  1126. // Support: Firefox <=3.6 - 5 only
  1127. // Old Firefox doesn't throw on a badly-escaped identifier.
  1128. el.querySelectorAll( "\\\f" );
  1129. rbuggyQSA.push( "[\\r\\n\\f]" );
  1130. } );
  1131. assert( function( el ) {
  1132. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1133. "<select disabled='disabled'><option/></select>";
  1134. // Support: Windows 8 Native Apps
  1135. // The type and name attributes are restricted during .innerHTML assignment
  1136. var input = document.createElement( "input" );
  1137. input.setAttribute( "type", "hidden" );
  1138. el.appendChild( input ).setAttribute( "name", "D" );
  1139. // Support: IE8
  1140. // Enforce case-sensitivity of name attribute
  1141. if ( el.querySelectorAll( "[name=d]" ).length ) {
  1142. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1143. }
  1144. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1145. // IE8 throws error here and will not see later tests
  1146. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  1147. rbuggyQSA.push( ":enabled", ":disabled" );
  1148. }
  1149. // Support: IE9-11+
  1150. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1151. docElem.appendChild( el ).disabled = true;
  1152. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1153. rbuggyQSA.push( ":enabled", ":disabled" );
  1154. }
  1155. // Support: Opera 10 - 11 only
  1156. // Opera 10-11 does not throw on post-comma invalid pseudos
  1157. el.querySelectorAll( "*,:x" );
  1158. rbuggyQSA.push( ",.*:" );
  1159. } );
  1160. }
  1161. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  1162. docElem.webkitMatchesSelector ||
  1163. docElem.mozMatchesSelector ||
  1164. docElem.oMatchesSelector ||
  1165. docElem.msMatchesSelector ) ) ) ) {
  1166. assert( function( el ) {
  1167. // Check to see if it's possible to do matchesSelector
  1168. // on a disconnected node (IE 9)
  1169. support.disconnectedMatch = matches.call( el, "*" );
  1170. // This should fail with an exception
  1171. // Gecko does not error, returns false instead
  1172. matches.call( el, "[s!='']:x" );
  1173. rbuggyMatches.push( "!=", pseudos );
  1174. } );
  1175. }
  1176. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1177. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  1178. /* Contains
  1179. ---------------------------------------------------------------------- */
  1180. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1181. // Element contains another
  1182. // Purposefully self-exclusive
  1183. // As in, an element does not contain itself
  1184. contains = hasCompare || rnative.test( docElem.contains ) ?
  1185. function( a, b ) {
  1186. var adown = a.nodeType === 9 ? a.documentElement : a,
  1187. bup = b && b.parentNode;
  1188. return a === bup || !!( bup && bup.nodeType === 1 && (
  1189. adown.contains ?
  1190. adown.contains( bup ) :
  1191. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1192. ) );
  1193. } :
  1194. function( a, b ) {
  1195. if ( b ) {
  1196. while ( ( b = b.parentNode ) ) {
  1197. if ( b === a ) {
  1198. return true;
  1199. }
  1200. }
  1201. }
  1202. return false;
  1203. };
  1204. /* Sorting
  1205. ---------------------------------------------------------------------- */
  1206. // Document order sorting
  1207. sortOrder = hasCompare ?
  1208. function( a, b ) {
  1209. // Flag for duplicate removal
  1210. if ( a === b ) {
  1211. hasDuplicate = true;
  1212. return 0;
  1213. }
  1214. // Sort on method existence if only one input has compareDocumentPosition
  1215. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1216. if ( compare ) {
  1217. return compare;
  1218. }
  1219. // Calculate position if both inputs belong to the same document
  1220. // Support: IE 11+, Edge 17 - 18+
  1221. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1222. // two documents; shallow comparisons work.
  1223. // eslint-disable-next-line eqeqeq
  1224. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1225. a.compareDocumentPosition( b ) :
  1226. // Otherwise we know they are disconnected
  1227. 1;
  1228. // Disconnected nodes
  1229. if ( compare & 1 ||
  1230. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1231. // Choose the first element that is related to our preferred document
  1232. // Support: IE 11+, Edge 17 - 18+
  1233. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1234. // two documents; shallow comparisons work.
  1235. // eslint-disable-next-line eqeqeq
  1236. if ( a == document || a.ownerDocument == preferredDoc &&
  1237. contains( preferredDoc, a ) ) {
  1238. return -1;
  1239. }
  1240. // Support: IE 11+, Edge 17 - 18+
  1241. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1242. // two documents; shallow comparisons work.
  1243. // eslint-disable-next-line eqeqeq
  1244. if ( b == document || b.ownerDocument == preferredDoc &&
  1245. contains( preferredDoc, b ) ) {
  1246. return 1;
  1247. }
  1248. // Maintain original order
  1249. return sortInput ?
  1250. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1251. 0;
  1252. }
  1253. return compare & 4 ? -1 : 1;
  1254. } :
  1255. function( a, b ) {
  1256. // Exit early if the nodes are identical
  1257. if ( a === b ) {
  1258. hasDuplicate = true;
  1259. return 0;
  1260. }
  1261. var cur,
  1262. i = 0,
  1263. aup = a.parentNode,
  1264. bup = b.parentNode,
  1265. ap = [ a ],
  1266. bp = [ b ];
  1267. // Parentless nodes are either documents or disconnected
  1268. if ( !aup || !bup ) {
  1269. // Support: IE 11+, Edge 17 - 18+
  1270. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1271. // two documents; shallow comparisons work.
  1272. /* eslint-disable eqeqeq */
  1273. return a == document ? -1 :
  1274. b == document ? 1 :
  1275. /* eslint-enable eqeqeq */
  1276. aup ? -1 :
  1277. bup ? 1 :
  1278. sortInput ?
  1279. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1280. 0;
  1281. // If the nodes are siblings, we can do a quick check
  1282. } else if ( aup === bup ) {
  1283. return siblingCheck( a, b );
  1284. }
  1285. // Otherwise we need full lists of their ancestors for comparison
  1286. cur = a;
  1287. while ( ( cur = cur.parentNode ) ) {
  1288. ap.unshift( cur );
  1289. }
  1290. cur = b;
  1291. while ( ( cur = cur.parentNode ) ) {
  1292. bp.unshift( cur );
  1293. }
  1294. // Walk down the tree looking for a discrepancy
  1295. while ( ap[ i ] === bp[ i ] ) {
  1296. i++;
  1297. }
  1298. return i ?
  1299. // Do a sibling check if the nodes have a common ancestor
  1300. siblingCheck( ap[ i ], bp[ i ] ) :
  1301. // Otherwise nodes in our document sort first
  1302. // Support: IE 11+, Edge 17 - 18+
  1303. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1304. // two documents; shallow comparisons work.
  1305. /* eslint-disable eqeqeq */
  1306. ap[ i ] == preferredDoc ? -1 :
  1307. bp[ i ] == preferredDoc ? 1 :
  1308. /* eslint-enable eqeqeq */
  1309. 0;
  1310. };
  1311. return document;
  1312. };
  1313. Sizzle.matches = function( expr, elements ) {
  1314. return Sizzle( expr, null, null, elements );
  1315. };
  1316. Sizzle.matchesSelector = function( elem, expr ) {
  1317. setDocument( elem );
  1318. if ( support.matchesSelector && documentIsHTML &&
  1319. !nonnativeSelectorCache[ expr + " " ] &&
  1320. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1321. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1322. try {
  1323. var ret = matches.call( elem, expr );
  1324. // IE 9's matchesSelector returns false on disconnected nodes
  1325. if ( ret || support.disconnectedMatch ||
  1326. // As well, disconnected nodes are said to be in a document
  1327. // fragment in IE 9
  1328. elem.document && elem.document.nodeType !== 11 ) {
  1329. return ret;
  1330. }
  1331. } catch ( e ) {
  1332. nonnativeSelectorCache( expr, true );
  1333. }
  1334. }
  1335. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1336. };
  1337. Sizzle.contains = function( context, elem ) {
  1338. // Set document vars if needed
  1339. // Support: IE 11+, Edge 17 - 18+
  1340. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1341. // two documents; shallow comparisons work.
  1342. // eslint-disable-next-line eqeqeq
  1343. if ( ( context.ownerDocument || context ) != document ) {
  1344. setDocument( context );
  1345. }
  1346. return contains( context, elem );
  1347. };
  1348. Sizzle.attr = function( elem, name ) {
  1349. // Set document vars if needed
  1350. // Support: IE 11+, Edge 17 - 18+
  1351. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1352. // two documents; shallow comparisons work.
  1353. // eslint-disable-next-line eqeqeq
  1354. if ( ( elem.ownerDocument || elem ) != document ) {
  1355. setDocument( elem );
  1356. }
  1357. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1358. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1359. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1360. fn( elem, name, !documentIsHTML ) :
  1361. undefined;
  1362. return val !== undefined ?
  1363. val :
  1364. support.attributes || !documentIsHTML ?
  1365. elem.getAttribute( name ) :
  1366. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  1367. val.value :
  1368. null;
  1369. };
  1370. Sizzle.escape = function( sel ) {
  1371. return ( sel + "" ).replace( rcssescape, fcssescape );
  1372. };
  1373. Sizzle.error = function( msg ) {
  1374. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1375. };
  1376. /**
  1377. * Document sorting and removing duplicates
  1378. * @param {ArrayLike} results
  1379. */
  1380. Sizzle.uniqueSort = function( results ) {
  1381. var elem,
  1382. duplicates = [],
  1383. j = 0,
  1384. i = 0;
  1385. // Unless we *know* we can detect duplicates, assume their presence
  1386. hasDuplicate = !support.detectDuplicates;
  1387. sortInput = !support.sortStable && results.slice( 0 );
  1388. results.sort( sortOrder );
  1389. if ( hasDuplicate ) {
  1390. while ( ( elem = results[ i++ ] ) ) {
  1391. if ( elem === results[ i ] ) {
  1392. j = duplicates.push( i );
  1393. }
  1394. }
  1395. while ( j-- ) {
  1396. results.splice( duplicates[ j ], 1 );
  1397. }
  1398. }
  1399. // Clear input after sorting to release objects
  1400. // See https://github.com/jquery/sizzle/pull/225
  1401. sortInput = null;
  1402. return results;
  1403. };
  1404. /**
  1405. * Utility function for retrieving the text value of an array of DOM nodes
  1406. * @param {Array|Element} elem
  1407. */
  1408. getText = Sizzle.getText = function( elem ) {
  1409. var node,
  1410. ret = "",
  1411. i = 0,
  1412. nodeType = elem.nodeType;
  1413. if ( !nodeType ) {
  1414. // If no nodeType, this is expected to be an array
  1415. while ( ( node = elem[ i++ ] ) ) {
  1416. // Do not traverse comment nodes
  1417. ret += getText( node );
  1418. }
  1419. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1420. // Use textContent for elements
  1421. // innerText usage removed for consistency of new lines (jQuery #11153)
  1422. if ( typeof elem.textContent === "string" ) {
  1423. return elem.textContent;
  1424. } else {
  1425. // Traverse its children
  1426. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1427. ret += getText( elem );
  1428. }
  1429. }
  1430. } else if ( nodeType === 3 || nodeType === 4 ) {
  1431. return elem.nodeValue;
  1432. }
  1433. // Do not include comment or processing instruction nodes
  1434. return ret;
  1435. };
  1436. Expr = Sizzle.selectors = {
  1437. // Can be adjusted by the user
  1438. cacheLength: 50,
  1439. createPseudo: markFunction,
  1440. match: matchExpr,
  1441. attrHandle: {},
  1442. find: {},
  1443. relative: {
  1444. ">": { dir: "parentNode", first: true },
  1445. " ": { dir: "parentNode" },
  1446. "+": { dir: "previousSibling", first: true },
  1447. "~": { dir: "previousSibling" }
  1448. },
  1449. preFilter: {
  1450. "ATTR": function( match ) {
  1451. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1452. // Move the given value to match[3] whether quoted or unquoted
  1453. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  1454. match[ 5 ] || "" ).replace( runescape, funescape );
  1455. if ( match[ 2 ] === "~=" ) {
  1456. match[ 3 ] = " " + match[ 3 ] + " ";
  1457. }
  1458. return match.slice( 0, 4 );
  1459. },
  1460. "CHILD": function( match ) {
  1461. /* matches from matchExpr["CHILD"]
  1462. 1 type (only|nth|...)
  1463. 2 what (child|of-type)
  1464. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1465. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1466. 5 sign of xn-component
  1467. 6 x of xn-component
  1468. 7 sign of y-component
  1469. 8 y of y-component
  1470. */
  1471. match[ 1 ] = match[ 1 ].toLowerCase();
  1472. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1473. // nth-* requires argument
  1474. if ( !match[ 3 ] ) {
  1475. Sizzle.error( match[ 0 ] );
  1476. }
  1477. // numeric x and y parameters for Expr.filter.CHILD
  1478. // remember that false/true cast respectively to 0/1
  1479. match[ 4 ] = +( match[ 4 ] ?
  1480. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1481. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  1482. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1483. // other types prohibit arguments
  1484. } else if ( match[ 3 ] ) {
  1485. Sizzle.error( match[ 0 ] );
  1486. }
  1487. return match;
  1488. },
  1489. "PSEUDO": function( match ) {
  1490. var excess,
  1491. unquoted = !match[ 6 ] && match[ 2 ];
  1492. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  1493. return null;
  1494. }
  1495. // Accept quoted arguments as-is
  1496. if ( match[ 3 ] ) {
  1497. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1498. // Strip excess characters from unquoted arguments
  1499. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1500. // Get excess from tokenize (recursively)
  1501. ( excess = tokenize( unquoted, true ) ) &&
  1502. // advance to the next closing parenthesis
  1503. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1504. // excess is a negative index
  1505. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1506. match[ 2 ] = unquoted.slice( 0, excess );
  1507. }
  1508. // Return only captures needed by the pseudo filter method (type and argument)
  1509. return match.slice( 0, 3 );
  1510. }
  1511. },
  1512. filter: {
  1513. "TAG": function( nodeNameSelector ) {
  1514. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1515. return nodeNameSelector === "*" ?
  1516. function() {
  1517. return true;
  1518. } :
  1519. function( elem ) {
  1520. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1521. };
  1522. },
  1523. "CLASS": function( className ) {
  1524. var pattern = classCache[ className + " " ];
  1525. return pattern ||
  1526. ( pattern = new RegExp( "(^|" + whitespace +
  1527. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  1528. className, function( elem ) {
  1529. return pattern.test(
  1530. typeof elem.className === "string" && elem.className ||
  1531. typeof elem.getAttribute !== "undefined" &&
  1532. elem.getAttribute( "class" ) ||
  1533. ""
  1534. );
  1535. } );
  1536. },
  1537. "ATTR": function( name, operator, check ) {
  1538. return function( elem ) {
  1539. var result = Sizzle.attr( elem, name );
  1540. if ( result == null ) {
  1541. return operator === "!=";
  1542. }
  1543. if ( !operator ) {
  1544. return true;
  1545. }
  1546. result += "";
  1547. /* eslint-disable max-len */
  1548. return operator === "=" ? result === check :
  1549. operator === "!=" ? result !== check :
  1550. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1551. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1552. operator === "$=" ? check && result.slice( -check.length ) === check :
  1553. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1554. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1555. false;
  1556. /* eslint-enable max-len */
  1557. };
  1558. },
  1559. "CHILD": function( type, what, _argument, first, last ) {
  1560. var simple = type.slice( 0, 3 ) !== "nth",
  1561. forward = type.slice( -4 ) !== "last",
  1562. ofType = what === "of-type";
  1563. return first === 1 && last === 0 ?
  1564. // Shortcut for :nth-*(n)
  1565. function( elem ) {
  1566. return !!elem.parentNode;
  1567. } :
  1568. function( elem, _context, xml ) {
  1569. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1570. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1571. parent = elem.parentNode,
  1572. name = ofType && elem.nodeName.toLowerCase(),
  1573. useCache = !xml && !ofType,
  1574. diff = false;
  1575. if ( parent ) {
  1576. // :(first|last|only)-(child|of-type)
  1577. if ( simple ) {
  1578. while ( dir ) {
  1579. node = elem;
  1580. while ( ( node = node[ dir ] ) ) {
  1581. if ( ofType ?
  1582. node.nodeName.toLowerCase() === name :
  1583. node.nodeType === 1 ) {
  1584. return false;
  1585. }
  1586. }
  1587. // Reverse direction for :only-* (if we haven't yet done so)
  1588. start = dir = type === "only" && !start && "nextSibling";
  1589. }
  1590. return true;
  1591. }
  1592. start = [ forward ? parent.firstChild : parent.lastChild ];
  1593. // non-xml :nth-child(...) stores cache data on `parent`
  1594. if ( forward && useCache ) {
  1595. // Seek `elem` from a previously-cached index
  1596. // ...in a gzip-friendly way
  1597. node = parent;
  1598. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1599. // Support: IE <9 only
  1600. // Defend against cloned attroperties (jQuery gh-1709)
  1601. uniqueCache = outerCache[ node.uniqueID ] ||
  1602. ( outerCache[ node.uniqueID ] = {} );
  1603. cache = uniqueCache[ type ] || [];
  1604. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1605. diff = nodeIndex && cache[ 2 ];
  1606. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1607. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1608. // Fallback to seeking `elem` from the start
  1609. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1610. // When found, cache indexes on `parent` and break
  1611. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1612. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1613. break;
  1614. }
  1615. }
  1616. } else {
  1617. // Use previously-cached element index if available
  1618. if ( useCache ) {
  1619. // ...in a gzip-friendly way
  1620. node = elem;
  1621. outerCache = node[ expando ] || ( node[ expando ] = {} );
  1622. // Support: IE <9 only
  1623. // Defend against cloned attroperties (jQuery gh-1709)
  1624. uniqueCache = outerCache[ node.uniqueID ] ||
  1625. ( outerCache[ node.uniqueID ] = {} );
  1626. cache = uniqueCache[ type ] || [];
  1627. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1628. diff = nodeIndex;
  1629. }
  1630. // xml :nth-child(...)
  1631. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1632. if ( diff === false ) {
  1633. // Use the same loop as above to seek `elem` from the start
  1634. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1635. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1636. if ( ( ofType ?
  1637. node.nodeName.toLowerCase() === name :
  1638. node.nodeType === 1 ) &&
  1639. ++diff ) {
  1640. // Cache the index of each encountered element
  1641. if ( useCache ) {
  1642. outerCache = node[ expando ] ||
  1643. ( node[ expando ] = {} );
  1644. // Support: IE <9 only
  1645. // Defend against cloned attroperties (jQuery gh-1709)
  1646. uniqueCache = outerCache[ node.uniqueID ] ||
  1647. ( outerCache[ node.uniqueID ] = {} );
  1648. uniqueCache[ type ] = [ dirruns, diff ];
  1649. }
  1650. if ( node === elem ) {
  1651. break;
  1652. }
  1653. }
  1654. }
  1655. }
  1656. }
  1657. // Incorporate the offset, then check against cycle size
  1658. diff -= last;
  1659. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1660. }
  1661. };
  1662. },
  1663. "PSEUDO": function( pseudo, argument ) {
  1664. // pseudo-class names are case-insensitive
  1665. // http://www.w3.org/TR/selectors/#pseudo-classes
  1666. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1667. // Remember that setFilters inherits from pseudos
  1668. var args,
  1669. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1670. Sizzle.error( "unsupported pseudo: " + pseudo );
  1671. // The user may use createPseudo to indicate that
  1672. // arguments are needed to create the filter function
  1673. // just as Sizzle does
  1674. if ( fn[ expando ] ) {
  1675. return fn( argument );
  1676. }
  1677. // But maintain support for old signatures
  1678. if ( fn.length > 1 ) {
  1679. args = [ pseudo, pseudo, "", argument ];
  1680. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1681. markFunction( function( seed, matches ) {
  1682. var idx,
  1683. matched = fn( seed, argument ),
  1684. i = matched.length;
  1685. while ( i-- ) {
  1686. idx = indexOf( seed, matched[ i ] );
  1687. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1688. }
  1689. } ) :
  1690. function( elem ) {
  1691. return fn( elem, 0, args );
  1692. };
  1693. }
  1694. return fn;
  1695. }
  1696. },
  1697. pseudos: {
  1698. // Potentially complex pseudos
  1699. "not": markFunction( function( selector ) {
  1700. // Trim the selector passed to compile
  1701. // to avoid treating leading and trailing
  1702. // spaces as combinators
  1703. var input = [],
  1704. results = [],
  1705. matcher = compile( selector.replace( rtrim, "$1" ) );
  1706. return matcher[ expando ] ?
  1707. markFunction( function( seed, matches, _context, xml ) {
  1708. var elem,
  1709. unmatched = matcher( seed, null, xml, [] ),
  1710. i = seed.length;
  1711. // Match elements unmatched by `matcher`
  1712. while ( i-- ) {
  1713. if ( ( elem = unmatched[ i ] ) ) {
  1714. seed[ i ] = !( matches[ i ] = elem );
  1715. }
  1716. }
  1717. } ) :
  1718. function( elem, _context, xml ) {
  1719. input[ 0 ] = elem;
  1720. matcher( input, null, xml, results );
  1721. // Don't keep the element (issue #299)
  1722. input[ 0 ] = null;
  1723. return !results.pop();
  1724. };
  1725. } ),
  1726. "has": markFunction( function( selector ) {
  1727. return function( elem ) {
  1728. return Sizzle( selector, elem ).length > 0;
  1729. };
  1730. } ),
  1731. "contains": markFunction( function( text ) {
  1732. text = text.replace( runescape, funescape );
  1733. return function( elem ) {
  1734. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  1735. };
  1736. } ),
  1737. // "Whether an element is represented by a :lang() selector
  1738. // is based solely on the element's language value
  1739. // being equal to the identifier C,
  1740. // or beginning with the identifier C immediately followed by "-".
  1741. // The matching of C against the element's language value is performed case-insensitively.
  1742. // The identifier C does not have to be a valid language name."
  1743. // http://www.w3.org/TR/selectors/#lang-pseudo
  1744. "lang": markFunction( function( lang ) {
  1745. // lang value must be a valid identifier
  1746. if ( !ridentifier.test( lang || "" ) ) {
  1747. Sizzle.error( "unsupported lang: " + lang );
  1748. }
  1749. lang = lang.replace( runescape, funescape ).toLowerCase();
  1750. return function( elem ) {
  1751. var elemLang;
  1752. do {
  1753. if ( ( elemLang = documentIsHTML ?
  1754. elem.lang :
  1755. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  1756. elemLang = elemLang.toLowerCase();
  1757. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1758. }
  1759. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  1760. return false;
  1761. };
  1762. } ),
  1763. // Miscellaneous
  1764. "target": function( elem ) {
  1765. var hash = window.location && window.location.hash;
  1766. return hash && hash.slice( 1 ) === elem.id;
  1767. },
  1768. "root": function( elem ) {
  1769. return elem === docElem;
  1770. },
  1771. "focus": function( elem ) {
  1772. return elem === document.activeElement &&
  1773. ( !document.hasFocus || document.hasFocus() ) &&
  1774. !!( elem.type || elem.href || ~elem.tabIndex );
  1775. },
  1776. // Boolean properties
  1777. "enabled": createDisabledPseudo( false ),
  1778. "disabled": createDisabledPseudo( true ),
  1779. "checked": function( elem ) {
  1780. // In CSS3, :checked should return both checked and selected elements
  1781. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1782. var nodeName = elem.nodeName.toLowerCase();
  1783. return ( nodeName === "input" && !!elem.checked ) ||
  1784. ( nodeName === "option" && !!elem.selected );
  1785. },
  1786. "selected": function( elem ) {
  1787. // Accessing this property makes selected-by-default
  1788. // options in Safari work properly
  1789. if ( elem.parentNode ) {
  1790. // eslint-disable-next-line no-unused-expressions
  1791. elem.parentNode.selectedIndex;
  1792. }
  1793. return elem.selected === true;
  1794. },
  1795. // Contents
  1796. "empty": function( elem ) {
  1797. // http://www.w3.org/TR/selectors/#empty-pseudo
  1798. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1799. // but not by others (comment: 8; processing instruction: 7; etc.)
  1800. // nodeType < 6 works because attributes (2) do not appear as children
  1801. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1802. if ( elem.nodeType < 6 ) {
  1803. return false;
  1804. }
  1805. }
  1806. return true;
  1807. },
  1808. "parent": function( elem ) {
  1809. return !Expr.pseudos[ "empty" ]( elem );
  1810. },
  1811. // Element/input types
  1812. "header": function( elem ) {
  1813. return rheader.test( elem.nodeName );
  1814. },
  1815. "input": function( elem ) {
  1816. return rinputs.test( elem.nodeName );
  1817. },
  1818. "button": function( elem ) {
  1819. var name = elem.nodeName.toLowerCase();
  1820. return name === "input" && elem.type === "button" || name === "button";
  1821. },
  1822. "text": function( elem ) {
  1823. var attr;
  1824. return elem.nodeName.toLowerCase() === "input" &&
  1825. elem.type === "text" &&
  1826. // Support: IE<8
  1827. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1828. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  1829. attr.toLowerCase() === "text" );
  1830. },
  1831. // Position-in-collection
  1832. "first": createPositionalPseudo( function() {
  1833. return [ 0 ];
  1834. } ),
  1835. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  1836. return [ length - 1 ];
  1837. } ),
  1838. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  1839. return [ argument < 0 ? argument + length : argument ];
  1840. } ),
  1841. "even": createPositionalPseudo( function( matchIndexes, length ) {
  1842. var i = 0;
  1843. for ( ; i < length; i += 2 ) {
  1844. matchIndexes.push( i );
  1845. }
  1846. return matchIndexes;
  1847. } ),
  1848. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  1849. var i = 1;
  1850. for ( ; i < length; i += 2 ) {
  1851. matchIndexes.push( i );
  1852. }
  1853. return matchIndexes;
  1854. } ),
  1855. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1856. var i = argument < 0 ?
  1857. argument + length :
  1858. argument > length ?
  1859. length :
  1860. argument;
  1861. for ( ; --i >= 0; ) {
  1862. matchIndexes.push( i );
  1863. }
  1864. return matchIndexes;
  1865. } ),
  1866. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  1867. var i = argument < 0 ? argument + length : argument;
  1868. for ( ; ++i < length; ) {
  1869. matchIndexes.push( i );
  1870. }
  1871. return matchIndexes;
  1872. } )
  1873. }
  1874. };
  1875. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  1876. // Add button/input type pseudos
  1877. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1878. Expr.pseudos[ i ] = createInputPseudo( i );
  1879. }
  1880. for ( i in { submit: true, reset: true } ) {
  1881. Expr.pseudos[ i ] = createButtonPseudo( i );
  1882. }
  1883. // Easy API for creating new setFilters
  1884. function setFilters() {}
  1885. setFilters.prototype = Expr.filters = Expr.pseudos;
  1886. Expr.setFilters = new setFilters();
  1887. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1888. var matched, match, tokens, type,
  1889. soFar, groups, preFilters,
  1890. cached = tokenCache[ selector + " " ];
  1891. if ( cached ) {
  1892. return parseOnly ? 0 : cached.slice( 0 );
  1893. }
  1894. soFar = selector;
  1895. groups = [];
  1896. preFilters = Expr.preFilter;
  1897. while ( soFar ) {
  1898. // Comma and first run
  1899. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  1900. if ( match ) {
  1901. // Don't consume trailing commas as valid
  1902. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  1903. }
  1904. groups.push( ( tokens = [] ) );
  1905. }
  1906. matched = false;
  1907. // Combinators
  1908. if ( ( match = rcombinators.exec( soFar ) ) ) {
  1909. matched = match.shift();
  1910. tokens.push( {
  1911. value: matched,
  1912. // Cast descendant combinators to space
  1913. type: match[ 0 ].replace( rtrim, " " )
  1914. } );
  1915. soFar = soFar.slice( matched.length );
  1916. }
  1917. // Filters
  1918. for ( type in Expr.filter ) {
  1919. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  1920. ( match = preFilters[ type ]( match ) ) ) ) {
  1921. matched = match.shift();
  1922. tokens.push( {
  1923. value: matched,
  1924. type: type,
  1925. matches: match
  1926. } );
  1927. soFar = soFar.slice( matched.length );
  1928. }
  1929. }
  1930. if ( !matched ) {
  1931. break;
  1932. }
  1933. }
  1934. // Return the length of the invalid excess
  1935. // if we're just parsing
  1936. // Otherwise, throw an error or return tokens
  1937. return parseOnly ?
  1938. soFar.length :
  1939. soFar ?
  1940. Sizzle.error( selector ) :
  1941. // Cache the tokens
  1942. tokenCache( selector, groups ).slice( 0 );
  1943. };
  1944. function toSelector( tokens ) {
  1945. var i = 0,
  1946. len = tokens.length,
  1947. selector = "";
  1948. for ( ; i < len; i++ ) {
  1949. selector += tokens[ i ].value;
  1950. }
  1951. return selector;
  1952. }
  1953. function addCombinator( matcher, combinator, base ) {
  1954. var dir = combinator.dir,
  1955. skip = combinator.next,
  1956. key = skip || dir,
  1957. checkNonElements = base && key === "parentNode",
  1958. doneName = done++;
  1959. return combinator.first ?
  1960. // Check against closest ancestor/preceding element
  1961. function( elem, context, xml ) {
  1962. while ( ( elem = elem[ dir ] ) ) {
  1963. if ( elem.nodeType === 1 || checkNonElements ) {
  1964. return matcher( elem, context, xml );
  1965. }
  1966. }
  1967. return false;
  1968. } :
  1969. // Check against all ancestor/preceding elements
  1970. function( elem, context, xml ) {
  1971. var oldCache, uniqueCache, outerCache,
  1972. newCache = [ dirruns, doneName ];
  1973. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1974. if ( xml ) {
  1975. while ( ( elem = elem[ dir ] ) ) {
  1976. if ( elem.nodeType === 1 || checkNonElements ) {
  1977. if ( matcher( elem, context, xml ) ) {
  1978. return true;
  1979. }
  1980. }
  1981. }
  1982. } else {
  1983. while ( ( elem = elem[ dir ] ) ) {
  1984. if ( elem.nodeType === 1 || checkNonElements ) {
  1985. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1986. // Support: IE <9 only
  1987. // Defend against cloned attroperties (jQuery gh-1709)
  1988. uniqueCache = outerCache[ elem.uniqueID ] ||
  1989. ( outerCache[ elem.uniqueID ] = {} );
  1990. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  1991. elem = elem[ dir ] || elem;
  1992. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  1993. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1994. // Assign to newCache so results back-propagate to previous elements
  1995. return ( newCache[ 2 ] = oldCache[ 2 ] );
  1996. } else {
  1997. // Reuse newcache so results back-propagate to previous elements
  1998. uniqueCache[ key ] = newCache;
  1999. // A match means we're done; a fail means we have to keep checking
  2000. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  2001. return true;
  2002. }
  2003. }
  2004. }
  2005. }
  2006. }
  2007. return false;
  2008. };
  2009. }
  2010. function elementMatcher( matchers ) {
  2011. return matchers.length > 1 ?
  2012. function( elem, context, xml ) {
  2013. var i = matchers.length;
  2014. while ( i-- ) {
  2015. if ( !matchers[ i ]( elem, context, xml ) ) {
  2016. return false;
  2017. }
  2018. }
  2019. return true;
  2020. } :
  2021. matchers[ 0 ];
  2022. }
  2023. function multipleContexts( selector, contexts, results ) {
  2024. var i = 0,
  2025. len = contexts.length;
  2026. for ( ; i < len; i++ ) {
  2027. Sizzle( selector, contexts[ i ], results );
  2028. }
  2029. return results;
  2030. }
  2031. function condense( unmatched, map, filter, context, xml ) {
  2032. var elem,
  2033. newUnmatched = [],
  2034. i = 0,
  2035. len = unmatched.length,
  2036. mapped = map != null;
  2037. for ( ; i < len; i++ ) {
  2038. if ( ( elem = unmatched[ i ] ) ) {
  2039. if ( !filter || filter( elem, context, xml ) ) {
  2040. newUnmatched.push( elem );
  2041. if ( mapped ) {
  2042. map.push( i );
  2043. }
  2044. }
  2045. }
  2046. }
  2047. return newUnmatched;
  2048. }
  2049. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2050. if ( postFilter && !postFilter[ expando ] ) {
  2051. postFilter = setMatcher( postFilter );
  2052. }
  2053. if ( postFinder && !postFinder[ expando ] ) {
  2054. postFinder = setMatcher( postFinder, postSelector );
  2055. }
  2056. return markFunction( function( seed, results, context, xml ) {
  2057. var temp, i, elem,
  2058. preMap = [],
  2059. postMap = [],
  2060. preexisting = results.length,
  2061. // Get initial elements from seed or context
  2062. elems = seed || multipleContexts(
  2063. selector || "*",
  2064. context.nodeType ? [ context ] : context,
  2065. []
  2066. ),
  2067. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2068. matcherIn = preFilter && ( seed || !selector ) ?
  2069. condense( elems, preMap, preFilter, context, xml ) :
  2070. elems,
  2071. matcherOut = matcher ?
  2072. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2073. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2074. // ...intermediate processing is necessary
  2075. [] :
  2076. // ...otherwise use results directly
  2077. results :
  2078. matcherIn;
  2079. // Find primary matches
  2080. if ( matcher ) {
  2081. matcher( matcherIn, matcherOut, context, xml );
  2082. }
  2083. // Apply postFilter
  2084. if ( postFilter ) {
  2085. temp = condense( matcherOut, postMap );
  2086. postFilter( temp, [], context, xml );
  2087. // Un-match failing elements by moving them back to matcherIn
  2088. i = temp.length;
  2089. while ( i-- ) {
  2090. if ( ( elem = temp[ i ] ) ) {
  2091. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  2092. }
  2093. }
  2094. }
  2095. if ( seed ) {
  2096. if ( postFinder || preFilter ) {
  2097. if ( postFinder ) {
  2098. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2099. temp = [];
  2100. i = matcherOut.length;
  2101. while ( i-- ) {
  2102. if ( ( elem = matcherOut[ i ] ) ) {
  2103. // Restore matcherIn since elem is not yet a final match
  2104. temp.push( ( matcherIn[ i ] = elem ) );
  2105. }
  2106. }
  2107. postFinder( null, ( matcherOut = [] ), temp, xml );
  2108. }
  2109. // Move matched elements from seed to results to keep them synchronized
  2110. i = matcherOut.length;
  2111. while ( i-- ) {
  2112. if ( ( elem = matcherOut[ i ] ) &&
  2113. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  2114. seed[ temp ] = !( results[ temp ] = elem );
  2115. }
  2116. }
  2117. }
  2118. // Add elements to results, through postFinder if defined
  2119. } else {
  2120. matcherOut = condense(
  2121. matcherOut === results ?
  2122. matcherOut.splice( preexisting, matcherOut.length ) :
  2123. matcherOut
  2124. );
  2125. if ( postFinder ) {
  2126. postFinder( null, results, matcherOut, xml );
  2127. } else {
  2128. push.apply( results, matcherOut );
  2129. }
  2130. }
  2131. } );
  2132. }
  2133. function matcherFromTokens( tokens ) {
  2134. var checkContext, matcher, j,
  2135. len = tokens.length,
  2136. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2137. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2138. i = leadingRelative ? 1 : 0,
  2139. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2140. matchContext = addCombinator( function( elem ) {
  2141. return elem === checkContext;
  2142. }, implicitRelative, true ),
  2143. matchAnyContext = addCombinator( function( elem ) {
  2144. return indexOf( checkContext, elem ) > -1;
  2145. }, implicitRelative, true ),
  2146. matchers = [ function( elem, context, xml ) {
  2147. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2148. ( checkContext = context ).nodeType ?
  2149. matchContext( elem, context, xml ) :
  2150. matchAnyContext( elem, context, xml ) );
  2151. // Avoid hanging onto element (issue #299)
  2152. checkContext = null;
  2153. return ret;
  2154. } ];
  2155. for ( ; i < len; i++ ) {
  2156. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2157. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2158. } else {
  2159. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2160. // Return special upon seeing a positional matcher
  2161. if ( matcher[ expando ] ) {
  2162. // Find the next relative operator (if any) for proper handling
  2163. j = ++i;
  2164. for ( ; j < len; j++ ) {
  2165. if ( Expr.relative[ tokens[ j ].type ] ) {
  2166. break;
  2167. }
  2168. }
  2169. return setMatcher(
  2170. i > 1 && elementMatcher( matchers ),
  2171. i > 1 && toSelector(
  2172. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2173. tokens
  2174. .slice( 0, i - 1 )
  2175. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2176. ).replace( rtrim, "$1" ),
  2177. matcher,
  2178. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2179. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2180. j < len && toSelector( tokens )
  2181. );
  2182. }
  2183. matchers.push( matcher );
  2184. }
  2185. }
  2186. return elementMatcher( matchers );
  2187. }
  2188. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2189. var bySet = setMatchers.length > 0,
  2190. byElement = elementMatchers.length > 0,
  2191. superMatcher = function( seed, context, xml, results, outermost ) {
  2192. var elem, j, matcher,
  2193. matchedCount = 0,
  2194. i = "0",
  2195. unmatched = seed && [],
  2196. setMatched = [],
  2197. contextBackup = outermostContext,
  2198. // We must always have either seed elements or outermost context
  2199. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  2200. // Use integer dirruns iff this is the outermost matcher
  2201. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2202. len = elems.length;
  2203. if ( outermost ) {
  2204. // Support: IE 11+, Edge 17 - 18+
  2205. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2206. // two documents; shallow comparisons work.
  2207. // eslint-disable-next-line eqeqeq
  2208. outermostContext = context == document || context || outermost;
  2209. }
  2210. // Add elements passing elementMatchers directly to results
  2211. // Support: IE<9, Safari
  2212. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2213. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2214. if ( byElement && elem ) {
  2215. j = 0;
  2216. // Support: IE 11+, Edge 17 - 18+
  2217. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2218. // two documents; shallow comparisons work.
  2219. // eslint-disable-next-line eqeqeq
  2220. if ( !context && elem.ownerDocument != document ) {
  2221. setDocument( elem );
  2222. xml = !documentIsHTML;
  2223. }
  2224. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2225. if ( matcher( elem, context || document, xml ) ) {
  2226. results.push( elem );
  2227. break;
  2228. }
  2229. }
  2230. if ( outermost ) {
  2231. dirruns = dirrunsUnique;
  2232. }
  2233. }
  2234. // Track unmatched elements for set filters
  2235. if ( bySet ) {
  2236. // They will have gone through all possible matchers
  2237. if ( ( elem = !matcher && elem ) ) {
  2238. matchedCount--;
  2239. }
  2240. // Lengthen the array for every element, matched or not
  2241. if ( seed ) {
  2242. unmatched.push( elem );
  2243. }
  2244. }
  2245. }
  2246. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2247. // makes the latter nonnegative.
  2248. matchedCount += i;
  2249. // Apply set filters to unmatched elements
  2250. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2251. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2252. // no element matchers and no seed.
  2253. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2254. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2255. // numerically zero.
  2256. if ( bySet && i !== matchedCount ) {
  2257. j = 0;
  2258. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2259. matcher( unmatched, setMatched, context, xml );
  2260. }
  2261. if ( seed ) {
  2262. // Reintegrate element matches to eliminate the need for sorting
  2263. if ( matchedCount > 0 ) {
  2264. while ( i-- ) {
  2265. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2266. setMatched[ i ] = pop.call( results );
  2267. }
  2268. }
  2269. }
  2270. // Discard index placeholder values to get only actual matches
  2271. setMatched = condense( setMatched );
  2272. }
  2273. // Add matches to results
  2274. push.apply( results, setMatched );
  2275. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2276. if ( outermost && !seed && setMatched.length > 0 &&
  2277. ( matchedCount + setMatchers.length ) > 1 ) {
  2278. Sizzle.uniqueSort( results );
  2279. }
  2280. }
  2281. // Override manipulation of globals by nested matchers
  2282. if ( outermost ) {
  2283. dirruns = dirrunsUnique;
  2284. outermostContext = contextBackup;
  2285. }
  2286. return unmatched;
  2287. };
  2288. return bySet ?
  2289. markFunction( superMatcher ) :
  2290. superMatcher;
  2291. }
  2292. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2293. var i,
  2294. setMatchers = [],
  2295. elementMatchers = [],
  2296. cached = compilerCache[ selector + " " ];
  2297. if ( !cached ) {
  2298. // Generate a function of recursive functions that can be used to check each element
  2299. if ( !match ) {
  2300. match = tokenize( selector );
  2301. }
  2302. i = match.length;
  2303. while ( i-- ) {
  2304. cached = matcherFromTokens( match[ i ] );
  2305. if ( cached[ expando ] ) {
  2306. setMatchers.push( cached );
  2307. } else {
  2308. elementMatchers.push( cached );
  2309. }
  2310. }
  2311. // Cache the compiled function
  2312. cached = compilerCache(
  2313. selector,
  2314. matcherFromGroupMatchers( elementMatchers, setMatchers )
  2315. );
  2316. // Save selector and tokenization
  2317. cached.selector = selector;
  2318. }
  2319. return cached;
  2320. };
  2321. /**
  2322. * A low-level selection function that works with Sizzle's compiled
  2323. * selector functions
  2324. * @param {String|Function} selector A selector or a pre-compiled
  2325. * selector function built with Sizzle.compile
  2326. * @param {Element} context
  2327. * @param {Array} [results]
  2328. * @param {Array} [seed] A set of elements to match against
  2329. */
  2330. select = Sizzle.select = function( selector, context, results, seed ) {
  2331. var i, tokens, token, type, find,
  2332. compiled = typeof selector === "function" && selector,
  2333. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2334. results = results || [];
  2335. // Try to minimize operations if there is only one selector in the list and no seed
  2336. // (the latter of which guarantees us context)
  2337. if ( match.length === 1 ) {
  2338. // Reduce context if the leading compound selector is an ID
  2339. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2340. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2341. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2342. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  2343. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  2344. if ( !context ) {
  2345. return results;
  2346. // Precompiled matchers will still verify ancestry, so step up a level
  2347. } else if ( compiled ) {
  2348. context = context.parentNode;
  2349. }
  2350. selector = selector.slice( tokens.shift().value.length );
  2351. }
  2352. // Fetch a seed set for right-to-left matching
  2353. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  2354. while ( i-- ) {
  2355. token = tokens[ i ];
  2356. // Abort if we hit a combinator
  2357. if ( Expr.relative[ ( type = token.type ) ] ) {
  2358. break;
  2359. }
  2360. if ( ( find = Expr.find[ type ] ) ) {
  2361. // Search, expanding context for leading sibling combinators
  2362. if ( ( seed = find(
  2363. token.matches[ 0 ].replace( runescape, funescape ),
  2364. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  2365. context
  2366. ) ) ) {
  2367. // If seed is empty or no tokens remain, we can return early
  2368. tokens.splice( i, 1 );
  2369. selector = seed.length && toSelector( tokens );
  2370. if ( !selector ) {
  2371. push.apply( results, seed );
  2372. return results;
  2373. }
  2374. break;
  2375. }
  2376. }
  2377. }
  2378. }
  2379. // Compile and execute a filtering function if one is not provided
  2380. // Provide `match` to avoid retokenization if we modified the selector above
  2381. ( compiled || compile( selector, match ) )(
  2382. seed,
  2383. context,
  2384. !documentIsHTML,
  2385. results,
  2386. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2387. );
  2388. return results;
  2389. };
  2390. // One-time assignments
  2391. // Sort stability
  2392. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2393. // Support: Chrome 14-35+
  2394. // Always assume duplicates if they aren't passed to the comparison function
  2395. support.detectDuplicates = !!hasDuplicate;
  2396. // Initialize against the default document
  2397. setDocument();
  2398. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2399. // Detached nodes confoundingly follow *each other*
  2400. support.sortDetached = assert( function( el ) {
  2401. // Should return 1, but returns 4 (following)
  2402. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2403. } );
  2404. // Support: IE<8
  2405. // Prevent attribute/property "interpolation"
  2406. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2407. if ( !assert( function( el ) {
  2408. el.innerHTML = "<a href='#'></a>";
  2409. return el.firstChild.getAttribute( "href" ) === "#";
  2410. } ) ) {
  2411. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2412. if ( !isXML ) {
  2413. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2414. }
  2415. } );
  2416. }
  2417. // Support: IE<9
  2418. // Use defaultValue in place of getAttribute("value")
  2419. if ( !support.attributes || !assert( function( el ) {
  2420. el.innerHTML = "<input/>";
  2421. el.firstChild.setAttribute( "value", "" );
  2422. return el.firstChild.getAttribute( "value" ) === "";
  2423. } ) ) {
  2424. addHandle( "value", function( elem, _name, isXML ) {
  2425. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2426. return elem.defaultValue;
  2427. }
  2428. } );
  2429. }
  2430. // Support: IE<9
  2431. // Use getAttributeNode to fetch booleans when getAttribute lies
  2432. if ( !assert( function( el ) {
  2433. return el.getAttribute( "disabled" ) == null;
  2434. } ) ) {
  2435. addHandle( booleans, function( elem, name, isXML ) {
  2436. var val;
  2437. if ( !isXML ) {
  2438. return elem[ name ] === true ? name.toLowerCase() :
  2439. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  2440. val.value :
  2441. null;
  2442. }
  2443. } );
  2444. }
  2445. return Sizzle;
  2446. } )( window );
  2447. jQuery.find = Sizzle;
  2448. jQuery.expr = Sizzle.selectors;
  2449. // Deprecated
  2450. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2451. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2452. jQuery.text = Sizzle.getText;
  2453. jQuery.isXMLDoc = Sizzle.isXML;
  2454. jQuery.contains = Sizzle.contains;
  2455. jQuery.escapeSelector = Sizzle.escape;
  2456. var dir = function( elem, dir, until ) {
  2457. var matched = [],
  2458. truncate = until !== undefined;
  2459. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2460. if ( elem.nodeType === 1 ) {
  2461. if ( truncate && jQuery( elem ).is( until ) ) {
  2462. break;
  2463. }
  2464. matched.push( elem );
  2465. }
  2466. }
  2467. return matched;
  2468. };
  2469. var siblings = function( n, elem ) {
  2470. var matched = [];
  2471. for ( ; n; n = n.nextSibling ) {
  2472. if ( n.nodeType === 1 && n !== elem ) {
  2473. matched.push( n );
  2474. }
  2475. }
  2476. return matched;
  2477. };
  2478. var rneedsContext = jQuery.expr.match.needsContext;
  2479. function nodeName( elem, name ) {
  2480. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  2481. }
  2482. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2483. // Implement the identical functionality for filter and not
  2484. function winnow( elements, qualifier, not ) {
  2485. if ( isFunction( qualifier ) ) {
  2486. return jQuery.grep( elements, function( elem, i ) {
  2487. return !!qualifier.call( elem, i, elem ) !== not;
  2488. } );
  2489. }
  2490. // Single element
  2491. if ( qualifier.nodeType ) {
  2492. return jQuery.grep( elements, function( elem ) {
  2493. return ( elem === qualifier ) !== not;
  2494. } );
  2495. }
  2496. // Arraylike of elements (jQuery, arguments, Array)
  2497. if ( typeof qualifier !== "string" ) {
  2498. return jQuery.grep( elements, function( elem ) {
  2499. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2500. } );
  2501. }
  2502. // Filtered directly for both simple and complex selectors
  2503. return jQuery.filter( qualifier, elements, not );
  2504. }
  2505. jQuery.filter = function( expr, elems, not ) {
  2506. var elem = elems[ 0 ];
  2507. if ( not ) {
  2508. expr = ":not(" + expr + ")";
  2509. }
  2510. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2511. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2512. }
  2513. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2514. return elem.nodeType === 1;
  2515. } ) );
  2516. };
  2517. jQuery.fn.extend( {
  2518. find: function( selector ) {
  2519. var i, ret,
  2520. len = this.length,
  2521. self = this;
  2522. if ( typeof selector !== "string" ) {
  2523. return this.pushStack( jQuery( selector ).filter( function() {
  2524. for ( i = 0; i < len; i++ ) {
  2525. if ( jQuery.contains( self[ i ], this ) ) {
  2526. return true;
  2527. }
  2528. }
  2529. } ) );
  2530. }
  2531. ret = this.pushStack( [] );
  2532. for ( i = 0; i < len; i++ ) {
  2533. jQuery.find( selector, self[ i ], ret );
  2534. }
  2535. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2536. },
  2537. filter: function( selector ) {
  2538. return this.pushStack( winnow( this, selector || [], false ) );
  2539. },
  2540. not: function( selector ) {
  2541. return this.pushStack( winnow( this, selector || [], true ) );
  2542. },
  2543. is: function( selector ) {
  2544. return !!winnow(
  2545. this,
  2546. // If this is a positional/relative selector, check membership in the returned set
  2547. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2548. typeof selector === "string" && rneedsContext.test( selector ) ?
  2549. jQuery( selector ) :
  2550. selector || [],
  2551. false
  2552. ).length;
  2553. }
  2554. } );
  2555. // Initialize a jQuery object
  2556. // A central reference to the root jQuery(document)
  2557. var rootjQuery,
  2558. // A simple way to check for HTML strings
  2559. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2560. // Strict HTML recognition (#11290: must start with <)
  2561. // Shortcut simple #id case for speed
  2562. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2563. init = jQuery.fn.init = function( selector, context, root ) {
  2564. var match, elem;
  2565. // HANDLE: $(""), $(null), $(undefined), $(false)
  2566. if ( !selector ) {
  2567. return this;
  2568. }
  2569. // Method init() accepts an alternate rootjQuery
  2570. // so migrate can support jQuery.sub (gh-2101)
  2571. root = root || rootjQuery;
  2572. // Handle HTML strings
  2573. if ( typeof selector === "string" ) {
  2574. if ( selector[ 0 ] === "<" &&
  2575. selector[ selector.length - 1 ] === ">" &&
  2576. selector.length >= 3 ) {
  2577. // Assume that strings that start and end with <> are HTML and skip the regex check
  2578. match = [ null, selector, null ];
  2579. } else {
  2580. match = rquickExpr.exec( selector );
  2581. }
  2582. // Match html or make sure no context is specified for #id
  2583. if ( match && ( match[ 1 ] || !context ) ) {
  2584. // HANDLE: $(html) -> $(array)
  2585. if ( match[ 1 ] ) {
  2586. context = context instanceof jQuery ? context[ 0 ] : context;
  2587. // Option to run scripts is true for back-compat
  2588. // Intentionally let the error be thrown if parseHTML is not present
  2589. jQuery.merge( this, jQuery.parseHTML(
  2590. match[ 1 ],
  2591. context && context.nodeType ? context.ownerDocument || context : document,
  2592. true
  2593. ) );
  2594. // HANDLE: $(html, props)
  2595. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2596. for ( match in context ) {
  2597. // Properties of context are called as methods if possible
  2598. if ( isFunction( this[ match ] ) ) {
  2599. this[ match ]( context[ match ] );
  2600. // ...and otherwise set as attributes
  2601. } else {
  2602. this.attr( match, context[ match ] );
  2603. }
  2604. }
  2605. }
  2606. return this;
  2607. // HANDLE: $(#id)
  2608. } else {
  2609. elem = document.getElementById( match[ 2 ] );
  2610. if ( elem ) {
  2611. // Inject the element directly into the jQuery object
  2612. this[ 0 ] = elem;
  2613. this.length = 1;
  2614. }
  2615. return this;
  2616. }
  2617. // HANDLE: $(expr, $(...))
  2618. } else if ( !context || context.jquery ) {
  2619. return ( context || root ).find( selector );
  2620. // HANDLE: $(expr, context)
  2621. // (which is just equivalent to: $(context).find(expr)
  2622. } else {
  2623. return this.constructor( context ).find( selector );
  2624. }
  2625. // HANDLE: $(DOMElement)
  2626. } else if ( selector.nodeType ) {
  2627. this[ 0 ] = selector;
  2628. this.length = 1;
  2629. return this;
  2630. // HANDLE: $(function)
  2631. // Shortcut for document ready
  2632. } else if ( isFunction( selector ) ) {
  2633. return root.ready !== undefined ?
  2634. root.ready( selector ) :
  2635. // Execute immediately if ready is not present
  2636. selector( jQuery );
  2637. }
  2638. return jQuery.makeArray( selector, this );
  2639. };
  2640. // Give the init function the jQuery prototype for later instantiation
  2641. init.prototype = jQuery.fn;
  2642. // Initialize central reference
  2643. rootjQuery = jQuery( document );
  2644. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2645. // Methods guaranteed to produce a unique set when starting from a unique set
  2646. guaranteedUnique = {
  2647. children: true,
  2648. contents: true,
  2649. next: true,
  2650. prev: true
  2651. };
  2652. jQuery.fn.extend( {
  2653. has: function( target ) {
  2654. var targets = jQuery( target, this ),
  2655. l = targets.length;
  2656. return this.filter( function() {
  2657. var i = 0;
  2658. for ( ; i < l; i++ ) {
  2659. if ( jQuery.contains( this, targets[ i ] ) ) {
  2660. return true;
  2661. }
  2662. }
  2663. } );
  2664. },
  2665. closest: function( selectors, context ) {
  2666. var cur,
  2667. i = 0,
  2668. l = this.length,
  2669. matched = [],
  2670. targets = typeof selectors !== "string" && jQuery( selectors );
  2671. // Positional selectors never match, since there's no _selection_ context
  2672. if ( !rneedsContext.test( selectors ) ) {
  2673. for ( ; i < l; i++ ) {
  2674. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2675. // Always skip document fragments
  2676. if ( cur.nodeType < 11 && ( targets ?
  2677. targets.index( cur ) > -1 :
  2678. // Don't pass non-elements to Sizzle
  2679. cur.nodeType === 1 &&
  2680. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2681. matched.push( cur );
  2682. break;
  2683. }
  2684. }
  2685. }
  2686. }
  2687. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2688. },
  2689. // Determine the position of an element within the set
  2690. index: function( elem ) {
  2691. // No argument, return index in parent
  2692. if ( !elem ) {
  2693. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2694. }
  2695. // Index in selector
  2696. if ( typeof elem === "string" ) {
  2697. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2698. }
  2699. // Locate the position of the desired element
  2700. return indexOf.call( this,
  2701. // If it receives a jQuery object, the first element is used
  2702. elem.jquery ? elem[ 0 ] : elem
  2703. );
  2704. },
  2705. add: function( selector, context ) {
  2706. return this.pushStack(
  2707. jQuery.uniqueSort(
  2708. jQuery.merge( this.get(), jQuery( selector, context ) )
  2709. )
  2710. );
  2711. },
  2712. addBack: function( selector ) {
  2713. return this.add( selector == null ?
  2714. this.prevObject : this.prevObject.filter( selector )
  2715. );
  2716. }
  2717. } );
  2718. function sibling( cur, dir ) {
  2719. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2720. return cur;
  2721. }
  2722. jQuery.each( {
  2723. parent: function( elem ) {
  2724. var parent = elem.parentNode;
  2725. return parent && parent.nodeType !== 11 ? parent : null;
  2726. },
  2727. parents: function( elem ) {
  2728. return dir( elem, "parentNode" );
  2729. },
  2730. parentsUntil: function( elem, _i, until ) {
  2731. return dir( elem, "parentNode", until );
  2732. },
  2733. next: function( elem ) {
  2734. return sibling( elem, "nextSibling" );
  2735. },
  2736. prev: function( elem ) {
  2737. return sibling( elem, "previousSibling" );
  2738. },
  2739. nextAll: function( elem ) {
  2740. return dir( elem, "nextSibling" );
  2741. },
  2742. prevAll: function( elem ) {
  2743. return dir( elem, "previousSibling" );
  2744. },
  2745. nextUntil: function( elem, _i, until ) {
  2746. return dir( elem, "nextSibling", until );
  2747. },
  2748. prevUntil: function( elem, _i, until ) {
  2749. return dir( elem, "previousSibling", until );
  2750. },
  2751. siblings: function( elem ) {
  2752. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2753. },
  2754. children: function( elem ) {
  2755. return siblings( elem.firstChild );
  2756. },
  2757. contents: function( elem ) {
  2758. if ( elem.contentDocument != null &&
  2759. // Support: IE 11+
  2760. // <object> elements with no `data` attribute has an object
  2761. // `contentDocument` with a `null` prototype.
  2762. getProto( elem.contentDocument ) ) {
  2763. return elem.contentDocument;
  2764. }
  2765. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  2766. // Treat the template element as a regular one in browsers that
  2767. // don't support it.
  2768. if ( nodeName( elem, "template" ) ) {
  2769. elem = elem.content || elem;
  2770. }
  2771. return jQuery.merge( [], elem.childNodes );
  2772. }
  2773. }, function( name, fn ) {
  2774. jQuery.fn[ name ] = function( until, selector ) {
  2775. var matched = jQuery.map( this, fn, until );
  2776. if ( name.slice( -5 ) !== "Until" ) {
  2777. selector = until;
  2778. }
  2779. if ( selector && typeof selector === "string" ) {
  2780. matched = jQuery.filter( selector, matched );
  2781. }
  2782. if ( this.length > 1 ) {
  2783. // Remove duplicates
  2784. if ( !guaranteedUnique[ name ] ) {
  2785. jQuery.uniqueSort( matched );
  2786. }
  2787. // Reverse order for parents* and prev-derivatives
  2788. if ( rparentsprev.test( name ) ) {
  2789. matched.reverse();
  2790. }
  2791. }
  2792. return this.pushStack( matched );
  2793. };
  2794. } );
  2795. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2796. // Convert String-formatted options into Object-formatted ones
  2797. function createOptions( options ) {
  2798. var object = {};
  2799. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2800. object[ flag ] = true;
  2801. } );
  2802. return object;
  2803. }
  2804. /*
  2805. * Create a callback list using the following parameters:
  2806. *
  2807. * options: an optional list of space-separated options that will change how
  2808. * the callback list behaves or a more traditional option object
  2809. *
  2810. * By default a callback list will act like an event callback list and can be
  2811. * "fired" multiple times.
  2812. *
  2813. * Possible options:
  2814. *
  2815. * once: will ensure the callback list can only be fired once (like a Deferred)
  2816. *
  2817. * memory: will keep track of previous values and will call any callback added
  2818. * after the list has been fired right away with the latest "memorized"
  2819. * values (like a Deferred)
  2820. *
  2821. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2822. *
  2823. * stopOnFalse: interrupt callings when a callback returns false
  2824. *
  2825. */
  2826. jQuery.Callbacks = function( options ) {
  2827. // Convert options from String-formatted to Object-formatted if needed
  2828. // (we check in cache first)
  2829. options = typeof options === "string" ?
  2830. createOptions( options ) :
  2831. jQuery.extend( {}, options );
  2832. var // Flag to know if list is currently firing
  2833. firing,
  2834. // Last fire value for non-forgettable lists
  2835. memory,
  2836. // Flag to know if list was already fired
  2837. fired,
  2838. // Flag to prevent firing
  2839. locked,
  2840. // Actual callback list
  2841. list = [],
  2842. // Queue of execution data for repeatable lists
  2843. queue = [],
  2844. // Index of currently firing callback (modified by add/remove as needed)
  2845. firingIndex = -1,
  2846. // Fire callbacks
  2847. fire = function() {
  2848. // Enforce single-firing
  2849. locked = locked || options.once;
  2850. // Execute callbacks for all pending executions,
  2851. // respecting firingIndex overrides and runtime changes
  2852. fired = firing = true;
  2853. for ( ; queue.length; firingIndex = -1 ) {
  2854. memory = queue.shift();
  2855. while ( ++firingIndex < list.length ) {
  2856. // Run callback and check for early termination
  2857. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2858. options.stopOnFalse ) {
  2859. // Jump to end and forget the data so .add doesn't re-fire
  2860. firingIndex = list.length;
  2861. memory = false;
  2862. }
  2863. }
  2864. }
  2865. // Forget the data if we're done with it
  2866. if ( !options.memory ) {
  2867. memory = false;
  2868. }
  2869. firing = false;
  2870. // Clean up if we're done firing for good
  2871. if ( locked ) {
  2872. // Keep an empty list if we have data for future add calls
  2873. if ( memory ) {
  2874. list = [];
  2875. // Otherwise, this object is spent
  2876. } else {
  2877. list = "";
  2878. }
  2879. }
  2880. },
  2881. // Actual Callbacks object
  2882. self = {
  2883. // Add a callback or a collection of callbacks to the list
  2884. add: function() {
  2885. if ( list ) {
  2886. // If we have memory from a past run, we should fire after adding
  2887. if ( memory && !firing ) {
  2888. firingIndex = list.length - 1;
  2889. queue.push( memory );
  2890. }
  2891. ( function add( args ) {
  2892. jQuery.each( args, function( _, arg ) {
  2893. if ( isFunction( arg ) ) {
  2894. if ( !options.unique || !self.has( arg ) ) {
  2895. list.push( arg );
  2896. }
  2897. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  2898. // Inspect recursively
  2899. add( arg );
  2900. }
  2901. } );
  2902. } )( arguments );
  2903. if ( memory && !firing ) {
  2904. fire();
  2905. }
  2906. }
  2907. return this;
  2908. },
  2909. // Remove a callback from the list
  2910. remove: function() {
  2911. jQuery.each( arguments, function( _, arg ) {
  2912. var index;
  2913. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2914. list.splice( index, 1 );
  2915. // Handle firing indexes
  2916. if ( index <= firingIndex ) {
  2917. firingIndex--;
  2918. }
  2919. }
  2920. } );
  2921. return this;
  2922. },
  2923. // Check if a given callback is in the list.
  2924. // If no argument is given, return whether or not list has callbacks attached.
  2925. has: function( fn ) {
  2926. return fn ?
  2927. jQuery.inArray( fn, list ) > -1 :
  2928. list.length > 0;
  2929. },
  2930. // Remove all callbacks from the list
  2931. empty: function() {
  2932. if ( list ) {
  2933. list = [];
  2934. }
  2935. return this;
  2936. },
  2937. // Disable .fire and .add
  2938. // Abort any current/pending executions
  2939. // Clear all callbacks and values
  2940. disable: function() {
  2941. locked = queue = [];
  2942. list = memory = "";
  2943. return this;
  2944. },
  2945. disabled: function() {
  2946. return !list;
  2947. },
  2948. // Disable .fire
  2949. // Also disable .add unless we have memory (since it would have no effect)
  2950. // Abort any pending executions
  2951. lock: function() {
  2952. locked = queue = [];
  2953. if ( !memory && !firing ) {
  2954. list = memory = "";
  2955. }
  2956. return this;
  2957. },
  2958. locked: function() {
  2959. return !!locked;
  2960. },
  2961. // Call all callbacks with the given context and arguments
  2962. fireWith: function( context, args ) {
  2963. if ( !locked ) {
  2964. args = args || [];
  2965. args = [ context, args.slice ? args.slice() : args ];
  2966. queue.push( args );
  2967. if ( !firing ) {
  2968. fire();
  2969. }
  2970. }
  2971. return this;
  2972. },
  2973. // Call all the callbacks with the given arguments
  2974. fire: function() {
  2975. self.fireWith( this, arguments );
  2976. return this;
  2977. },
  2978. // To know if the callbacks have already been called at least once
  2979. fired: function() {
  2980. return !!fired;
  2981. }
  2982. };
  2983. return self;
  2984. };
  2985. function Identity( v ) {
  2986. return v;
  2987. }
  2988. function Thrower( ex ) {
  2989. throw ex;
  2990. }
  2991. function adoptValue( value, resolve, reject, noValue ) {
  2992. var method;
  2993. try {
  2994. // Check for promise aspect first to privilege synchronous behavior
  2995. if ( value && isFunction( ( method = value.promise ) ) ) {
  2996. method.call( value ).done( resolve ).fail( reject );
  2997. // Other thenables
  2998. } else if ( value && isFunction( ( method = value.then ) ) ) {
  2999. method.call( value, resolve, reject );
  3000. // Other non-thenables
  3001. } else {
  3002. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  3003. // * false: [ value ].slice( 0 ) => resolve( value )
  3004. // * true: [ value ].slice( 1 ) => resolve()
  3005. resolve.apply( undefined, [ value ].slice( noValue ) );
  3006. }
  3007. // For Promises/A+, convert exceptions into rejections
  3008. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  3009. // Deferred#then to conditionally suppress rejection.
  3010. } catch ( value ) {
  3011. // Support: Android 4.0 only
  3012. // Strict mode functions invoked without .call/.apply get global-object context
  3013. reject.apply( undefined, [ value ] );
  3014. }
  3015. }
  3016. jQuery.extend( {
  3017. Deferred: function( func ) {
  3018. var tuples = [
  3019. // action, add listener, callbacks,
  3020. // ... .then handlers, argument index, [final state]
  3021. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  3022. jQuery.Callbacks( "memory" ), 2 ],
  3023. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  3024. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  3025. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3026. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3027. ],
  3028. state = "pending",
  3029. promise = {
  3030. state: function() {
  3031. return state;
  3032. },
  3033. always: function() {
  3034. deferred.done( arguments ).fail( arguments );
  3035. return this;
  3036. },
  3037. "catch": function( fn ) {
  3038. return promise.then( null, fn );
  3039. },
  3040. // Keep pipe for back-compat
  3041. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3042. var fns = arguments;
  3043. return jQuery.Deferred( function( newDefer ) {
  3044. jQuery.each( tuples, function( _i, tuple ) {
  3045. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3046. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3047. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3048. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3049. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3050. deferred[ tuple[ 1 ] ]( function() {
  3051. var returned = fn && fn.apply( this, arguments );
  3052. if ( returned && isFunction( returned.promise ) ) {
  3053. returned.promise()
  3054. .progress( newDefer.notify )
  3055. .done( newDefer.resolve )
  3056. .fail( newDefer.reject );
  3057. } else {
  3058. newDefer[ tuple[ 0 ] + "With" ](
  3059. this,
  3060. fn ? [ returned ] : arguments
  3061. );
  3062. }
  3063. } );
  3064. } );
  3065. fns = null;
  3066. } ).promise();
  3067. },
  3068. then: function( onFulfilled, onRejected, onProgress ) {
  3069. var maxDepth = 0;
  3070. function resolve( depth, deferred, handler, special ) {
  3071. return function() {
  3072. var that = this,
  3073. args = arguments,
  3074. mightThrow = function() {
  3075. var returned, then;
  3076. // Support: Promises/A+ section 2.3.3.3.3
  3077. // https://promisesaplus.com/#point-59
  3078. // Ignore double-resolution attempts
  3079. if ( depth < maxDepth ) {
  3080. return;
  3081. }
  3082. returned = handler.apply( that, args );
  3083. // Support: Promises/A+ section 2.3.1
  3084. // https://promisesaplus.com/#point-48
  3085. if ( returned === deferred.promise() ) {
  3086. throw new TypeError( "Thenable self-resolution" );
  3087. }
  3088. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3089. // https://promisesaplus.com/#point-54
  3090. // https://promisesaplus.com/#point-75
  3091. // Retrieve `then` only once
  3092. then = returned &&
  3093. // Support: Promises/A+ section 2.3.4
  3094. // https://promisesaplus.com/#point-64
  3095. // Only check objects and functions for thenability
  3096. ( typeof returned === "object" ||
  3097. typeof returned === "function" ) &&
  3098. returned.then;
  3099. // Handle a returned thenable
  3100. if ( isFunction( then ) ) {
  3101. // Special processors (notify) just wait for resolution
  3102. if ( special ) {
  3103. then.call(
  3104. returned,
  3105. resolve( maxDepth, deferred, Identity, special ),
  3106. resolve( maxDepth, deferred, Thrower, special )
  3107. );
  3108. // Normal processors (resolve) also hook into progress
  3109. } else {
  3110. // ...and disregard older resolution values
  3111. maxDepth++;
  3112. then.call(
  3113. returned,
  3114. resolve( maxDepth, deferred, Identity, special ),
  3115. resolve( maxDepth, deferred, Thrower, special ),
  3116. resolve( maxDepth, deferred, Identity,
  3117. deferred.notifyWith )
  3118. );
  3119. }
  3120. // Handle all other returned values
  3121. } else {
  3122. // Only substitute handlers pass on context
  3123. // and multiple values (non-spec behavior)
  3124. if ( handler !== Identity ) {
  3125. that = undefined;
  3126. args = [ returned ];
  3127. }
  3128. // Process the value(s)
  3129. // Default process is resolve
  3130. ( special || deferred.resolveWith )( that, args );
  3131. }
  3132. },
  3133. // Only normal processors (resolve) catch and reject exceptions
  3134. process = special ?
  3135. mightThrow :
  3136. function() {
  3137. try {
  3138. mightThrow();
  3139. } catch ( e ) {
  3140. if ( jQuery.Deferred.exceptionHook ) {
  3141. jQuery.Deferred.exceptionHook( e,
  3142. process.stackTrace );
  3143. }
  3144. // Support: Promises/A+ section 2.3.3.3.4.1
  3145. // https://promisesaplus.com/#point-61
  3146. // Ignore post-resolution exceptions
  3147. if ( depth + 1 >= maxDepth ) {
  3148. // Only substitute handlers pass on context
  3149. // and multiple values (non-spec behavior)
  3150. if ( handler !== Thrower ) {
  3151. that = undefined;
  3152. args = [ e ];
  3153. }
  3154. deferred.rejectWith( that, args );
  3155. }
  3156. }
  3157. };
  3158. // Support: Promises/A+ section 2.3.3.3.1
  3159. // https://promisesaplus.com/#point-57
  3160. // Re-resolve promises immediately to dodge false rejection from
  3161. // subsequent errors
  3162. if ( depth ) {
  3163. process();
  3164. } else {
  3165. // Call an optional hook to record the stack, in case of exception
  3166. // since it's otherwise lost when execution goes async
  3167. if ( jQuery.Deferred.getStackHook ) {
  3168. process.stackTrace = jQuery.Deferred.getStackHook();
  3169. }
  3170. window.setTimeout( process );
  3171. }
  3172. };
  3173. }
  3174. return jQuery.Deferred( function( newDefer ) {
  3175. // progress_handlers.add( ... )
  3176. tuples[ 0 ][ 3 ].add(
  3177. resolve(
  3178. 0,
  3179. newDefer,
  3180. isFunction( onProgress ) ?
  3181. onProgress :
  3182. Identity,
  3183. newDefer.notifyWith
  3184. )
  3185. );
  3186. // fulfilled_handlers.add( ... )
  3187. tuples[ 1 ][ 3 ].add(
  3188. resolve(
  3189. 0,
  3190. newDefer,
  3191. isFunction( onFulfilled ) ?
  3192. onFulfilled :
  3193. Identity
  3194. )
  3195. );
  3196. // rejected_handlers.add( ... )
  3197. tuples[ 2 ][ 3 ].add(
  3198. resolve(
  3199. 0,
  3200. newDefer,
  3201. isFunction( onRejected ) ?
  3202. onRejected :
  3203. Thrower
  3204. )
  3205. );
  3206. } ).promise();
  3207. },
  3208. // Get a promise for this deferred
  3209. // If obj is provided, the promise aspect is added to the object
  3210. promise: function( obj ) {
  3211. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3212. }
  3213. },
  3214. deferred = {};
  3215. // Add list-specific methods
  3216. jQuery.each( tuples, function( i, tuple ) {
  3217. var list = tuple[ 2 ],
  3218. stateString = tuple[ 5 ];
  3219. // promise.progress = list.add
  3220. // promise.done = list.add
  3221. // promise.fail = list.add
  3222. promise[ tuple[ 1 ] ] = list.add;
  3223. // Handle state
  3224. if ( stateString ) {
  3225. list.add(
  3226. function() {
  3227. // state = "resolved" (i.e., fulfilled)
  3228. // state = "rejected"
  3229. state = stateString;
  3230. },
  3231. // rejected_callbacks.disable
  3232. // fulfilled_callbacks.disable
  3233. tuples[ 3 - i ][ 2 ].disable,
  3234. // rejected_handlers.disable
  3235. // fulfilled_handlers.disable
  3236. tuples[ 3 - i ][ 3 ].disable,
  3237. // progress_callbacks.lock
  3238. tuples[ 0 ][ 2 ].lock,
  3239. // progress_handlers.lock
  3240. tuples[ 0 ][ 3 ].lock
  3241. );
  3242. }
  3243. // progress_handlers.fire
  3244. // fulfilled_handlers.fire
  3245. // rejected_handlers.fire
  3246. list.add( tuple[ 3 ].fire );
  3247. // deferred.notify = function() { deferred.notifyWith(...) }
  3248. // deferred.resolve = function() { deferred.resolveWith(...) }
  3249. // deferred.reject = function() { deferred.rejectWith(...) }
  3250. deferred[ tuple[ 0 ] ] = function() {
  3251. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3252. return this;
  3253. };
  3254. // deferred.notifyWith = list.fireWith
  3255. // deferred.resolveWith = list.fireWith
  3256. // deferred.rejectWith = list.fireWith
  3257. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3258. } );
  3259. // Make the deferred a promise
  3260. promise.promise( deferred );
  3261. // Call given func if any
  3262. if ( func ) {
  3263. func.call( deferred, deferred );
  3264. }
  3265. // All done!
  3266. return deferred;
  3267. },
  3268. // Deferred helper
  3269. when: function( singleValue ) {
  3270. var
  3271. // count of uncompleted subordinates
  3272. remaining = arguments.length,
  3273. // count of unprocessed arguments
  3274. i = remaining,
  3275. // subordinate fulfillment data
  3276. resolveContexts = Array( i ),
  3277. resolveValues = slice.call( arguments ),
  3278. // the primary Deferred
  3279. primary = jQuery.Deferred(),
  3280. // subordinate callback factory
  3281. updateFunc = function( i ) {
  3282. return function( value ) {
  3283. resolveContexts[ i ] = this;
  3284. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3285. if ( !( --remaining ) ) {
  3286. primary.resolveWith( resolveContexts, resolveValues );
  3287. }
  3288. };
  3289. };
  3290. // Single- and empty arguments are adopted like Promise.resolve
  3291. if ( remaining <= 1 ) {
  3292. adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
  3293. !remaining );
  3294. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3295. if ( primary.state() === "pending" ||
  3296. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3297. return primary.then();
  3298. }
  3299. }
  3300. // Multiple arguments are aggregated like Promise.all array elements
  3301. while ( i-- ) {
  3302. adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
  3303. }
  3304. return primary.promise();
  3305. }
  3306. } );
  3307. // These usually indicate a programmer mistake during development,
  3308. // warn about them ASAP rather than swallowing them by default.
  3309. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3310. jQuery.Deferred.exceptionHook = function( error, stack ) {
  3311. // Support: IE 8 - 9 only
  3312. // Console exists when dev tools are open, which can happen at any time
  3313. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3314. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  3315. }
  3316. };
  3317. jQuery.readyException = function( error ) {
  3318. window.setTimeout( function() {
  3319. throw error;
  3320. } );
  3321. };
  3322. // The deferred used on DOM ready
  3323. var readyList = jQuery.Deferred();
  3324. jQuery.fn.ready = function( fn ) {
  3325. readyList
  3326. .then( fn )
  3327. // Wrap jQuery.readyException in a function so that the lookup
  3328. // happens at the time of error handling instead of callback
  3329. // registration.
  3330. .catch( function( error ) {
  3331. jQuery.readyException( error );
  3332. } );
  3333. return this;
  3334. };
  3335. jQuery.extend( {
  3336. // Is the DOM ready to be used? Set to true once it occurs.
  3337. isReady: false,
  3338. // A counter to track how many items to wait for before
  3339. // the ready event fires. See #6781
  3340. readyWait: 1,
  3341. // Handle when the DOM is ready
  3342. ready: function( wait ) {
  3343. // Abort if there are pending holds or we're already ready
  3344. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3345. return;
  3346. }
  3347. // Remember that the DOM is ready
  3348. jQuery.isReady = true;
  3349. // If a normal DOM Ready event fired, decrement, and wait if need be
  3350. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3351. return;
  3352. }
  3353. // If there are functions bound, to execute
  3354. readyList.resolveWith( document, [ jQuery ] );
  3355. }
  3356. } );
  3357. jQuery.ready.then = readyList.then;
  3358. // The ready event handler and self cleanup method
  3359. function completed() {
  3360. document.removeEventListener( "DOMContentLoaded", completed );
  3361. window.removeEventListener( "load", completed );
  3362. jQuery.ready();
  3363. }
  3364. // Catch cases where $(document).ready() is called
  3365. // after the browser event has already occurred.
  3366. // Support: IE <=9 - 10 only
  3367. // Older IE sometimes signals "interactive" too soon
  3368. if ( document.readyState === "complete" ||
  3369. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3370. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3371. window.setTimeout( jQuery.ready );
  3372. } else {
  3373. // Use the handy event callback
  3374. document.addEventListener( "DOMContentLoaded", completed );
  3375. // A fallback to window.onload, that will always work
  3376. window.addEventListener( "load", completed );
  3377. }
  3378. // Multifunctional method to get and set values of a collection
  3379. // The value/s can optionally be executed if it's a function
  3380. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3381. var i = 0,
  3382. len = elems.length,
  3383. bulk = key == null;
  3384. // Sets many values
  3385. if ( toType( key ) === "object" ) {
  3386. chainable = true;
  3387. for ( i in key ) {
  3388. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3389. }
  3390. // Sets one value
  3391. } else if ( value !== undefined ) {
  3392. chainable = true;
  3393. if ( !isFunction( value ) ) {
  3394. raw = true;
  3395. }
  3396. if ( bulk ) {
  3397. // Bulk operations run against the entire set
  3398. if ( raw ) {
  3399. fn.call( elems, value );
  3400. fn = null;
  3401. // ...except when executing function values
  3402. } else {
  3403. bulk = fn;
  3404. fn = function( elem, _key, value ) {
  3405. return bulk.call( jQuery( elem ), value );
  3406. };
  3407. }
  3408. }
  3409. if ( fn ) {
  3410. for ( ; i < len; i++ ) {
  3411. fn(
  3412. elems[ i ], key, raw ?
  3413. value :
  3414. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3415. );
  3416. }
  3417. }
  3418. }
  3419. if ( chainable ) {
  3420. return elems;
  3421. }
  3422. // Gets
  3423. if ( bulk ) {
  3424. return fn.call( elems );
  3425. }
  3426. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3427. };
  3428. // Matches dashed string for camelizing
  3429. var rmsPrefix = /^-ms-/,
  3430. rdashAlpha = /-([a-z])/g;
  3431. // Used by camelCase as callback to replace()
  3432. function fcamelCase( _all, letter ) {
  3433. return letter.toUpperCase();
  3434. }
  3435. // Convert dashed to camelCase; used by the css and data modules
  3436. // Support: IE <=9 - 11, Edge 12 - 15
  3437. // Microsoft forgot to hump their vendor prefix (#9572)
  3438. function camelCase( string ) {
  3439. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3440. }
  3441. var acceptData = function( owner ) {
  3442. // Accepts only:
  3443. // - Node
  3444. // - Node.ELEMENT_NODE
  3445. // - Node.DOCUMENT_NODE
  3446. // - Object
  3447. // - Any
  3448. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3449. };
  3450. function Data() {
  3451. this.expando = jQuery.expando + Data.uid++;
  3452. }
  3453. Data.uid = 1;
  3454. Data.prototype = {
  3455. cache: function( owner ) {
  3456. // Check if the owner object already has a cache
  3457. var value = owner[ this.expando ];
  3458. // If not, create one
  3459. if ( !value ) {
  3460. value = {};
  3461. // We can accept data for non-element nodes in modern browsers,
  3462. // but we should not, see #8335.
  3463. // Always return an empty object.
  3464. if ( acceptData( owner ) ) {
  3465. // If it is a node unlikely to be stringify-ed or looped over
  3466. // use plain assignment
  3467. if ( owner.nodeType ) {
  3468. owner[ this.expando ] = value;
  3469. // Otherwise secure it in a non-enumerable property
  3470. // configurable must be true to allow the property to be
  3471. // deleted when data is removed
  3472. } else {
  3473. Object.defineProperty( owner, this.expando, {
  3474. value: value,
  3475. configurable: true
  3476. } );
  3477. }
  3478. }
  3479. }
  3480. return value;
  3481. },
  3482. set: function( owner, data, value ) {
  3483. var prop,
  3484. cache = this.cache( owner );
  3485. // Handle: [ owner, key, value ] args
  3486. // Always use camelCase key (gh-2257)
  3487. if ( typeof data === "string" ) {
  3488. cache[ camelCase( data ) ] = value;
  3489. // Handle: [ owner, { properties } ] args
  3490. } else {
  3491. // Copy the properties one-by-one to the cache object
  3492. for ( prop in data ) {
  3493. cache[ camelCase( prop ) ] = data[ prop ];
  3494. }
  3495. }
  3496. return cache;
  3497. },
  3498. get: function( owner, key ) {
  3499. return key === undefined ?
  3500. this.cache( owner ) :
  3501. // Always use camelCase key (gh-2257)
  3502. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  3503. },
  3504. access: function( owner, key, value ) {
  3505. // In cases where either:
  3506. //
  3507. // 1. No key was specified
  3508. // 2. A string key was specified, but no value provided
  3509. //
  3510. // Take the "read" path and allow the get method to determine
  3511. // which value to return, respectively either:
  3512. //
  3513. // 1. The entire cache object
  3514. // 2. The data stored at the key
  3515. //
  3516. if ( key === undefined ||
  3517. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3518. return this.get( owner, key );
  3519. }
  3520. // When the key is not a string, or both a key and value
  3521. // are specified, set or extend (existing objects) with either:
  3522. //
  3523. // 1. An object of properties
  3524. // 2. A key and value
  3525. //
  3526. this.set( owner, key, value );
  3527. // Since the "set" path can have two possible entry points
  3528. // return the expected data based on which path was taken[*]
  3529. return value !== undefined ? value : key;
  3530. },
  3531. remove: function( owner, key ) {
  3532. var i,
  3533. cache = owner[ this.expando ];
  3534. if ( cache === undefined ) {
  3535. return;
  3536. }
  3537. if ( key !== undefined ) {
  3538. // Support array or space separated string of keys
  3539. if ( Array.isArray( key ) ) {
  3540. // If key is an array of keys...
  3541. // We always set camelCase keys, so remove that.
  3542. key = key.map( camelCase );
  3543. } else {
  3544. key = camelCase( key );
  3545. // If a key with the spaces exists, use it.
  3546. // Otherwise, create an array by matching non-whitespace
  3547. key = key in cache ?
  3548. [ key ] :
  3549. ( key.match( rnothtmlwhite ) || [] );
  3550. }
  3551. i = key.length;
  3552. while ( i-- ) {
  3553. delete cache[ key[ i ] ];
  3554. }
  3555. }
  3556. // Remove the expando if there's no more data
  3557. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3558. // Support: Chrome <=35 - 45
  3559. // Webkit & Blink performance suffers when deleting properties
  3560. // from DOM nodes, so set to undefined instead
  3561. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3562. if ( owner.nodeType ) {
  3563. owner[ this.expando ] = undefined;
  3564. } else {
  3565. delete owner[ this.expando ];
  3566. }
  3567. }
  3568. },
  3569. hasData: function( owner ) {
  3570. var cache = owner[ this.expando ];
  3571. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3572. }
  3573. };
  3574. var dataPriv = new Data();
  3575. var dataUser = new Data();
  3576. // Implementation Summary
  3577. //
  3578. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3579. // 2. Improve the module's maintainability by reducing the storage
  3580. // paths to a single mechanism.
  3581. // 3. Use the same single mechanism to support "private" and "user" data.
  3582. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3583. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3584. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3585. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3586. rmultiDash = /[A-Z]/g;
  3587. function getData( data ) {
  3588. if ( data === "true" ) {
  3589. return true;
  3590. }
  3591. if ( data === "false" ) {
  3592. return false;
  3593. }
  3594. if ( data === "null" ) {
  3595. return null;
  3596. }
  3597. // Only convert to a number if it doesn't change the string
  3598. if ( data === +data + "" ) {
  3599. return +data;
  3600. }
  3601. if ( rbrace.test( data ) ) {
  3602. return JSON.parse( data );
  3603. }
  3604. return data;
  3605. }
  3606. function dataAttr( elem, key, data ) {
  3607. var name;
  3608. // If nothing was found internally, try to fetch any
  3609. // data from the HTML5 data-* attribute
  3610. if ( data === undefined && elem.nodeType === 1 ) {
  3611. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3612. data = elem.getAttribute( name );
  3613. if ( typeof data === "string" ) {
  3614. try {
  3615. data = getData( data );
  3616. } catch ( e ) {}
  3617. // Make sure we set the data so it isn't changed later
  3618. dataUser.set( elem, key, data );
  3619. } else {
  3620. data = undefined;
  3621. }
  3622. }
  3623. return data;
  3624. }
  3625. jQuery.extend( {
  3626. hasData: function( elem ) {
  3627. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3628. },
  3629. data: function( elem, name, data ) {
  3630. return dataUser.access( elem, name, data );
  3631. },
  3632. removeData: function( elem, name ) {
  3633. dataUser.remove( elem, name );
  3634. },
  3635. // TODO: Now that all calls to _data and _removeData have been replaced
  3636. // with direct calls to dataPriv methods, these can be deprecated.
  3637. _data: function( elem, name, data ) {
  3638. return dataPriv.access( elem, name, data );
  3639. },
  3640. _removeData: function( elem, name ) {
  3641. dataPriv.remove( elem, name );
  3642. }
  3643. } );
  3644. jQuery.fn.extend( {
  3645. data: function( key, value ) {
  3646. var i, name, data,
  3647. elem = this[ 0 ],
  3648. attrs = elem && elem.attributes;
  3649. // Gets all values
  3650. if ( key === undefined ) {
  3651. if ( this.length ) {
  3652. data = dataUser.get( elem );
  3653. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3654. i = attrs.length;
  3655. while ( i-- ) {
  3656. // Support: IE 11 only
  3657. // The attrs elements can be null (#14894)
  3658. if ( attrs[ i ] ) {
  3659. name = attrs[ i ].name;
  3660. if ( name.indexOf( "data-" ) === 0 ) {
  3661. name = camelCase( name.slice( 5 ) );
  3662. dataAttr( elem, name, data[ name ] );
  3663. }
  3664. }
  3665. }
  3666. dataPriv.set( elem, "hasDataAttrs", true );
  3667. }
  3668. }
  3669. return data;
  3670. }
  3671. // Sets multiple values
  3672. if ( typeof key === "object" ) {
  3673. return this.each( function() {
  3674. dataUser.set( this, key );
  3675. } );
  3676. }
  3677. return access( this, function( value ) {
  3678. var data;
  3679. // The calling jQuery object (element matches) is not empty
  3680. // (and therefore has an element appears at this[ 0 ]) and the
  3681. // `value` parameter was not undefined. An empty jQuery object
  3682. // will result in `undefined` for elem = this[ 0 ] which will
  3683. // throw an exception if an attempt to read a data cache is made.
  3684. if ( elem && value === undefined ) {
  3685. // Attempt to get data from the cache
  3686. // The key will always be camelCased in Data
  3687. data = dataUser.get( elem, key );
  3688. if ( data !== undefined ) {
  3689. return data;
  3690. }
  3691. // Attempt to "discover" the data in
  3692. // HTML5 custom data-* attrs
  3693. data = dataAttr( elem, key );
  3694. if ( data !== undefined ) {
  3695. return data;
  3696. }
  3697. // We tried really hard, but the data doesn't exist.
  3698. return;
  3699. }
  3700. // Set the data...
  3701. this.each( function() {
  3702. // We always store the camelCased key
  3703. dataUser.set( this, key, value );
  3704. } );
  3705. }, null, value, arguments.length > 1, null, true );
  3706. },
  3707. removeData: function( key ) {
  3708. return this.each( function() {
  3709. dataUser.remove( this, key );
  3710. } );
  3711. }
  3712. } );
  3713. jQuery.extend( {
  3714. queue: function( elem, type, data ) {
  3715. var queue;
  3716. if ( elem ) {
  3717. type = ( type || "fx" ) + "queue";
  3718. queue = dataPriv.get( elem, type );
  3719. // Speed up dequeue by getting out quickly if this is just a lookup
  3720. if ( data ) {
  3721. if ( !queue || Array.isArray( data ) ) {
  3722. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3723. } else {
  3724. queue.push( data );
  3725. }
  3726. }
  3727. return queue || [];
  3728. }
  3729. },
  3730. dequeue: function( elem, type ) {
  3731. type = type || "fx";
  3732. var queue = jQuery.queue( elem, type ),
  3733. startLength = queue.length,
  3734. fn = queue.shift(),
  3735. hooks = jQuery._queueHooks( elem, type ),
  3736. next = function() {
  3737. jQuery.dequeue( elem, type );
  3738. };
  3739. // If the fx queue is dequeued, always remove the progress sentinel
  3740. if ( fn === "inprogress" ) {
  3741. fn = queue.shift();
  3742. startLength--;
  3743. }
  3744. if ( fn ) {
  3745. // Add a progress sentinel to prevent the fx queue from being
  3746. // automatically dequeued
  3747. if ( type === "fx" ) {
  3748. queue.unshift( "inprogress" );
  3749. }
  3750. // Clear up the last queue stop function
  3751. delete hooks.stop;
  3752. fn.call( elem, next, hooks );
  3753. }
  3754. if ( !startLength && hooks ) {
  3755. hooks.empty.fire();
  3756. }
  3757. },
  3758. // Not public - generate a queueHooks object, or return the current one
  3759. _queueHooks: function( elem, type ) {
  3760. var key = type + "queueHooks";
  3761. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3762. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3763. dataPriv.remove( elem, [ type + "queue", key ] );
  3764. } )
  3765. } );
  3766. }
  3767. } );
  3768. jQuery.fn.extend( {
  3769. queue: function( type, data ) {
  3770. var setter = 2;
  3771. if ( typeof type !== "string" ) {
  3772. data = type;
  3773. type = "fx";
  3774. setter--;
  3775. }
  3776. if ( arguments.length < setter ) {
  3777. return jQuery.queue( this[ 0 ], type );
  3778. }
  3779. return data === undefined ?
  3780. this :
  3781. this.each( function() {
  3782. var queue = jQuery.queue( this, type, data );
  3783. // Ensure a hooks for this queue
  3784. jQuery._queueHooks( this, type );
  3785. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3786. jQuery.dequeue( this, type );
  3787. }
  3788. } );
  3789. },
  3790. dequeue: function( type ) {
  3791. return this.each( function() {
  3792. jQuery.dequeue( this, type );
  3793. } );
  3794. },
  3795. clearQueue: function( type ) {
  3796. return this.queue( type || "fx", [] );
  3797. },
  3798. // Get a promise resolved when queues of a certain type
  3799. // are emptied (fx is the type by default)
  3800. promise: function( type, obj ) {
  3801. var tmp,
  3802. count = 1,
  3803. defer = jQuery.Deferred(),
  3804. elements = this,
  3805. i = this.length,
  3806. resolve = function() {
  3807. if ( !( --count ) ) {
  3808. defer.resolveWith( elements, [ elements ] );
  3809. }
  3810. };
  3811. if ( typeof type !== "string" ) {
  3812. obj = type;
  3813. type = undefined;
  3814. }
  3815. type = type || "fx";
  3816. while ( i-- ) {
  3817. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3818. if ( tmp && tmp.empty ) {
  3819. count++;
  3820. tmp.empty.add( resolve );
  3821. }
  3822. }
  3823. resolve();
  3824. return defer.promise( obj );
  3825. }
  3826. } );
  3827. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3828. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3829. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3830. var documentElement = document.documentElement;
  3831. var isAttached = function( elem ) {
  3832. return jQuery.contains( elem.ownerDocument, elem );
  3833. },
  3834. composed = { composed: true };
  3835. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  3836. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  3837. // Support: iOS 10.0-10.2 only
  3838. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  3839. // leading to errors. We need to check for `getRootNode`.
  3840. if ( documentElement.getRootNode ) {
  3841. isAttached = function( elem ) {
  3842. return jQuery.contains( elem.ownerDocument, elem ) ||
  3843. elem.getRootNode( composed ) === elem.ownerDocument;
  3844. };
  3845. }
  3846. var isHiddenWithinTree = function( elem, el ) {
  3847. // isHiddenWithinTree might be called from jQuery#filter function;
  3848. // in that case, element will be second argument
  3849. elem = el || elem;
  3850. // Inline style trumps all
  3851. return elem.style.display === "none" ||
  3852. elem.style.display === "" &&
  3853. // Otherwise, check computed style
  3854. // Support: Firefox <=43 - 45
  3855. // Disconnected elements can have computed display: none, so first confirm that elem is
  3856. // in the document.
  3857. isAttached( elem ) &&
  3858. jQuery.css( elem, "display" ) === "none";
  3859. };
  3860. function adjustCSS( elem, prop, valueParts, tween ) {
  3861. var adjusted, scale,
  3862. maxIterations = 20,
  3863. currentValue = tween ?
  3864. function() {
  3865. return tween.cur();
  3866. } :
  3867. function() {
  3868. return jQuery.css( elem, prop, "" );
  3869. },
  3870. initial = currentValue(),
  3871. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3872. // Starting value computation is required for potential unit mismatches
  3873. initialInUnit = elem.nodeType &&
  3874. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3875. rcssNum.exec( jQuery.css( elem, prop ) );
  3876. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3877. // Support: Firefox <=54
  3878. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  3879. initial = initial / 2;
  3880. // Trust units reported by jQuery.css
  3881. unit = unit || initialInUnit[ 3 ];
  3882. // Iteratively approximate from a nonzero starting point
  3883. initialInUnit = +initial || 1;
  3884. while ( maxIterations-- ) {
  3885. // Evaluate and update our best guess (doubling guesses that zero out).
  3886. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  3887. jQuery.style( elem, prop, initialInUnit + unit );
  3888. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  3889. maxIterations = 0;
  3890. }
  3891. initialInUnit = initialInUnit / scale;
  3892. }
  3893. initialInUnit = initialInUnit * 2;
  3894. jQuery.style( elem, prop, initialInUnit + unit );
  3895. // Make sure we update the tween properties later on
  3896. valueParts = valueParts || [];
  3897. }
  3898. if ( valueParts ) {
  3899. initialInUnit = +initialInUnit || +initial || 0;
  3900. // Apply relative offset (+=/-=) if specified
  3901. adjusted = valueParts[ 1 ] ?
  3902. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3903. +valueParts[ 2 ];
  3904. if ( tween ) {
  3905. tween.unit = unit;
  3906. tween.start = initialInUnit;
  3907. tween.end = adjusted;
  3908. }
  3909. }
  3910. return adjusted;
  3911. }
  3912. var defaultDisplayMap = {};
  3913. function getDefaultDisplay( elem ) {
  3914. var temp,
  3915. doc = elem.ownerDocument,
  3916. nodeName = elem.nodeName,
  3917. display = defaultDisplayMap[ nodeName ];
  3918. if ( display ) {
  3919. return display;
  3920. }
  3921. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3922. display = jQuery.css( temp, "display" );
  3923. temp.parentNode.removeChild( temp );
  3924. if ( display === "none" ) {
  3925. display = "block";
  3926. }
  3927. defaultDisplayMap[ nodeName ] = display;
  3928. return display;
  3929. }
  3930. function showHide( elements, show ) {
  3931. var display, elem,
  3932. values = [],
  3933. index = 0,
  3934. length = elements.length;
  3935. // Determine new display value for elements that need to change
  3936. for ( ; index < length; index++ ) {
  3937. elem = elements[ index ];
  3938. if ( !elem.style ) {
  3939. continue;
  3940. }
  3941. display = elem.style.display;
  3942. if ( show ) {
  3943. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3944. // check is required in this first loop unless we have a nonempty display value (either
  3945. // inline or about-to-be-restored)
  3946. if ( display === "none" ) {
  3947. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3948. if ( !values[ index ] ) {
  3949. elem.style.display = "";
  3950. }
  3951. }
  3952. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3953. values[ index ] = getDefaultDisplay( elem );
  3954. }
  3955. } else {
  3956. if ( display !== "none" ) {
  3957. values[ index ] = "none";
  3958. // Remember what we're overwriting
  3959. dataPriv.set( elem, "display", display );
  3960. }
  3961. }
  3962. }
  3963. // Set the display of the elements in a second loop to avoid constant reflow
  3964. for ( index = 0; index < length; index++ ) {
  3965. if ( values[ index ] != null ) {
  3966. elements[ index ].style.display = values[ index ];
  3967. }
  3968. }
  3969. return elements;
  3970. }
  3971. jQuery.fn.extend( {
  3972. show: function() {
  3973. return showHide( this, true );
  3974. },
  3975. hide: function() {
  3976. return showHide( this );
  3977. },
  3978. toggle: function( state ) {
  3979. if ( typeof state === "boolean" ) {
  3980. return state ? this.show() : this.hide();
  3981. }
  3982. return this.each( function() {
  3983. if ( isHiddenWithinTree( this ) ) {
  3984. jQuery( this ).show();
  3985. } else {
  3986. jQuery( this ).hide();
  3987. }
  3988. } );
  3989. }
  3990. } );
  3991. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3992. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  3993. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  3994. ( function() {
  3995. var fragment = document.createDocumentFragment(),
  3996. div = fragment.appendChild( document.createElement( "div" ) ),
  3997. input = document.createElement( "input" );
  3998. // Support: Android 4.0 - 4.3 only
  3999. // Check state lost if the name is set (#11217)
  4000. // Support: Windows Web Apps (WWA)
  4001. // `name` and `type` must use .setAttribute for WWA (#14901)
  4002. input.setAttribute( "type", "radio" );
  4003. input.setAttribute( "checked", "checked" );
  4004. input.setAttribute( "name", "t" );
  4005. div.appendChild( input );
  4006. // Support: Android <=4.1 only
  4007. // Older WebKit doesn't clone checked state correctly in fragments
  4008. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4009. // Support: IE <=11 only
  4010. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4011. div.innerHTML = "<textarea>x</textarea>";
  4012. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4013. // Support: IE <=9 only
  4014. // IE <=9 replaces <option> tags with their contents when inserted outside of
  4015. // the select element.
  4016. div.innerHTML = "<option></option>";
  4017. support.option = !!div.lastChild;
  4018. } )();
  4019. // We have to close these tags to support XHTML (#13200)
  4020. var wrapMap = {
  4021. // XHTML parsers do not magically insert elements in the
  4022. // same way that tag soup parsers do. So we cannot shorten
  4023. // this by omitting <tbody> or other required elements.
  4024. thead: [ 1, "<table>", "</table>" ],
  4025. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4026. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4027. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4028. _default: [ 0, "", "" ]
  4029. };
  4030. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4031. wrapMap.th = wrapMap.td;
  4032. // Support: IE <=9 only
  4033. if ( !support.option ) {
  4034. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  4035. }
  4036. function getAll( context, tag ) {
  4037. // Support: IE <=9 - 11 only
  4038. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  4039. var ret;
  4040. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4041. ret = context.getElementsByTagName( tag || "*" );
  4042. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  4043. ret = context.querySelectorAll( tag || "*" );
  4044. } else {
  4045. ret = [];
  4046. }
  4047. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  4048. return jQuery.merge( [ context ], ret );
  4049. }
  4050. return ret;
  4051. }
  4052. // Mark scripts as having already been evaluated
  4053. function setGlobalEval( elems, refElements ) {
  4054. var i = 0,
  4055. l = elems.length;
  4056. for ( ; i < l; i++ ) {
  4057. dataPriv.set(
  4058. elems[ i ],
  4059. "globalEval",
  4060. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  4061. );
  4062. }
  4063. }
  4064. var rhtml = /<|&#?\w+;/;
  4065. function buildFragment( elems, context, scripts, selection, ignored ) {
  4066. var elem, tmp, tag, wrap, attached, j,
  4067. fragment = context.createDocumentFragment(),
  4068. nodes = [],
  4069. i = 0,
  4070. l = elems.length;
  4071. for ( ; i < l; i++ ) {
  4072. elem = elems[ i ];
  4073. if ( elem || elem === 0 ) {
  4074. // Add nodes directly
  4075. if ( toType( elem ) === "object" ) {
  4076. // Support: Android <=4.0 only, PhantomJS 1 only
  4077. // push.apply(_, arraylike) throws on ancient WebKit
  4078. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4079. // Convert non-html into a text node
  4080. } else if ( !rhtml.test( elem ) ) {
  4081. nodes.push( context.createTextNode( elem ) );
  4082. // Convert html into DOM nodes
  4083. } else {
  4084. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  4085. // Deserialize a standard representation
  4086. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4087. wrap = wrapMap[ tag ] || wrapMap._default;
  4088. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4089. // Descend through wrappers to the right content
  4090. j = wrap[ 0 ];
  4091. while ( j-- ) {
  4092. tmp = tmp.lastChild;
  4093. }
  4094. // Support: Android <=4.0 only, PhantomJS 1 only
  4095. // push.apply(_, arraylike) throws on ancient WebKit
  4096. jQuery.merge( nodes, tmp.childNodes );
  4097. // Remember the top-level container
  4098. tmp = fragment.firstChild;
  4099. // Ensure the created nodes are orphaned (#12392)
  4100. tmp.textContent = "";
  4101. }
  4102. }
  4103. }
  4104. // Remove wrapper from fragment
  4105. fragment.textContent = "";
  4106. i = 0;
  4107. while ( ( elem = nodes[ i++ ] ) ) {
  4108. // Skip elements already in the context collection (trac-4087)
  4109. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  4110. if ( ignored ) {
  4111. ignored.push( elem );
  4112. }
  4113. continue;
  4114. }
  4115. attached = isAttached( elem );
  4116. // Append to fragment
  4117. tmp = getAll( fragment.appendChild( elem ), "script" );
  4118. // Preserve script evaluation history
  4119. if ( attached ) {
  4120. setGlobalEval( tmp );
  4121. }
  4122. // Capture executables
  4123. if ( scripts ) {
  4124. j = 0;
  4125. while ( ( elem = tmp[ j++ ] ) ) {
  4126. if ( rscriptType.test( elem.type || "" ) ) {
  4127. scripts.push( elem );
  4128. }
  4129. }
  4130. }
  4131. }
  4132. return fragment;
  4133. }
  4134. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4135. function returnTrue() {
  4136. return true;
  4137. }
  4138. function returnFalse() {
  4139. return false;
  4140. }
  4141. // Support: IE <=9 - 11+
  4142. // focus() and blur() are asynchronous, except when they are no-op.
  4143. // So expect focus to be synchronous when the element is already active,
  4144. // and blur to be synchronous when the element is not already active.
  4145. // (focus and blur are always synchronous in other supported browsers,
  4146. // this just defines when we can count on it).
  4147. function expectSync( elem, type ) {
  4148. return ( elem === safeActiveElement() ) === ( type === "focus" );
  4149. }
  4150. // Support: IE <=9 only
  4151. // Accessing document.activeElement can throw unexpectedly
  4152. // https://bugs.jquery.com/ticket/13393
  4153. function safeActiveElement() {
  4154. try {
  4155. return document.activeElement;
  4156. } catch ( err ) { }
  4157. }
  4158. function on( elem, types, selector, data, fn, one ) {
  4159. var origFn, type;
  4160. // Types can be a map of types/handlers
  4161. if ( typeof types === "object" ) {
  4162. // ( types-Object, selector, data )
  4163. if ( typeof selector !== "string" ) {
  4164. // ( types-Object, data )
  4165. data = data || selector;
  4166. selector = undefined;
  4167. }
  4168. for ( type in types ) {
  4169. on( elem, type, selector, data, types[ type ], one );
  4170. }
  4171. return elem;
  4172. }
  4173. if ( data == null && fn == null ) {
  4174. // ( types, fn )
  4175. fn = selector;
  4176. data = selector = undefined;
  4177. } else if ( fn == null ) {
  4178. if ( typeof selector === "string" ) {
  4179. // ( types, selector, fn )
  4180. fn = data;
  4181. data = undefined;
  4182. } else {
  4183. // ( types, data, fn )
  4184. fn = data;
  4185. data = selector;
  4186. selector = undefined;
  4187. }
  4188. }
  4189. if ( fn === false ) {
  4190. fn = returnFalse;
  4191. } else if ( !fn ) {
  4192. return elem;
  4193. }
  4194. if ( one === 1 ) {
  4195. origFn = fn;
  4196. fn = function( event ) {
  4197. // Can use an empty set, since event contains the info
  4198. jQuery().off( event );
  4199. return origFn.apply( this, arguments );
  4200. };
  4201. // Use same guid so caller can remove using origFn
  4202. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4203. }
  4204. return elem.each( function() {
  4205. jQuery.event.add( this, types, fn, data, selector );
  4206. } );
  4207. }
  4208. /*
  4209. * Helper functions for managing events -- not part of the public interface.
  4210. * Props to Dean Edwards' addEvent library for many of the ideas.
  4211. */
  4212. jQuery.event = {
  4213. global: {},
  4214. add: function( elem, types, handler, data, selector ) {
  4215. var handleObjIn, eventHandle, tmp,
  4216. events, t, handleObj,
  4217. special, handlers, type, namespaces, origType,
  4218. elemData = dataPriv.get( elem );
  4219. // Only attach events to objects that accept data
  4220. if ( !acceptData( elem ) ) {
  4221. return;
  4222. }
  4223. // Caller can pass in an object of custom data in lieu of the handler
  4224. if ( handler.handler ) {
  4225. handleObjIn = handler;
  4226. handler = handleObjIn.handler;
  4227. selector = handleObjIn.selector;
  4228. }
  4229. // Ensure that invalid selectors throw exceptions at attach time
  4230. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  4231. if ( selector ) {
  4232. jQuery.find.matchesSelector( documentElement, selector );
  4233. }
  4234. // Make sure that the handler has a unique ID, used to find/remove it later
  4235. if ( !handler.guid ) {
  4236. handler.guid = jQuery.guid++;
  4237. }
  4238. // Init the element's event structure and main handler, if this is the first
  4239. if ( !( events = elemData.events ) ) {
  4240. events = elemData.events = Object.create( null );
  4241. }
  4242. if ( !( eventHandle = elemData.handle ) ) {
  4243. eventHandle = elemData.handle = function( e ) {
  4244. // Discard the second event of a jQuery.event.trigger() and
  4245. // when an event is called after a page has unloaded
  4246. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  4247. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  4248. };
  4249. }
  4250. // Handle multiple events separated by a space
  4251. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4252. t = types.length;
  4253. while ( t-- ) {
  4254. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4255. type = origType = tmp[ 1 ];
  4256. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4257. // There *must* be a type, no attaching namespace-only handlers
  4258. if ( !type ) {
  4259. continue;
  4260. }
  4261. // If event changes its type, use the special event handlers for the changed type
  4262. special = jQuery.event.special[ type ] || {};
  4263. // If selector defined, determine special event api type, otherwise given type
  4264. type = ( selector ? special.delegateType : special.bindType ) || type;
  4265. // Update special based on newly reset type
  4266. special = jQuery.event.special[ type ] || {};
  4267. // handleObj is passed to all event handlers
  4268. handleObj = jQuery.extend( {
  4269. type: type,
  4270. origType: origType,
  4271. data: data,
  4272. handler: handler,
  4273. guid: handler.guid,
  4274. selector: selector,
  4275. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4276. namespace: namespaces.join( "." )
  4277. }, handleObjIn );
  4278. // Init the event handler queue if we're the first
  4279. if ( !( handlers = events[ type ] ) ) {
  4280. handlers = events[ type ] = [];
  4281. handlers.delegateCount = 0;
  4282. // Only use addEventListener if the special events handler returns false
  4283. if ( !special.setup ||
  4284. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4285. if ( elem.addEventListener ) {
  4286. elem.addEventListener( type, eventHandle );
  4287. }
  4288. }
  4289. }
  4290. if ( special.add ) {
  4291. special.add.call( elem, handleObj );
  4292. if ( !handleObj.handler.guid ) {
  4293. handleObj.handler.guid = handler.guid;
  4294. }
  4295. }
  4296. // Add to the element's handler list, delegates in front
  4297. if ( selector ) {
  4298. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4299. } else {
  4300. handlers.push( handleObj );
  4301. }
  4302. // Keep track of which events have ever been used, for event optimization
  4303. jQuery.event.global[ type ] = true;
  4304. }
  4305. },
  4306. // Detach an event or set of events from an element
  4307. remove: function( elem, types, handler, selector, mappedTypes ) {
  4308. var j, origCount, tmp,
  4309. events, t, handleObj,
  4310. special, handlers, type, namespaces, origType,
  4311. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4312. if ( !elemData || !( events = elemData.events ) ) {
  4313. return;
  4314. }
  4315. // Once for each type.namespace in types; type may be omitted
  4316. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4317. t = types.length;
  4318. while ( t-- ) {
  4319. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4320. type = origType = tmp[ 1 ];
  4321. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4322. // Unbind all events (on this namespace, if provided) for the element
  4323. if ( !type ) {
  4324. for ( type in events ) {
  4325. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4326. }
  4327. continue;
  4328. }
  4329. special = jQuery.event.special[ type ] || {};
  4330. type = ( selector ? special.delegateType : special.bindType ) || type;
  4331. handlers = events[ type ] || [];
  4332. tmp = tmp[ 2 ] &&
  4333. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4334. // Remove matching events
  4335. origCount = j = handlers.length;
  4336. while ( j-- ) {
  4337. handleObj = handlers[ j ];
  4338. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4339. ( !handler || handler.guid === handleObj.guid ) &&
  4340. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4341. ( !selector || selector === handleObj.selector ||
  4342. selector === "**" && handleObj.selector ) ) {
  4343. handlers.splice( j, 1 );
  4344. if ( handleObj.selector ) {
  4345. handlers.delegateCount--;
  4346. }
  4347. if ( special.remove ) {
  4348. special.remove.call( elem, handleObj );
  4349. }
  4350. }
  4351. }
  4352. // Remove generic event handler if we removed something and no more handlers exist
  4353. // (avoids potential for endless recursion during removal of special event handlers)
  4354. if ( origCount && !handlers.length ) {
  4355. if ( !special.teardown ||
  4356. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4357. jQuery.removeEvent( elem, type, elemData.handle );
  4358. }
  4359. delete events[ type ];
  4360. }
  4361. }
  4362. // Remove data and the expando if it's no longer used
  4363. if ( jQuery.isEmptyObject( events ) ) {
  4364. dataPriv.remove( elem, "handle events" );
  4365. }
  4366. },
  4367. dispatch: function( nativeEvent ) {
  4368. var i, j, ret, matched, handleObj, handlerQueue,
  4369. args = new Array( arguments.length ),
  4370. // Make a writable jQuery.Event from the native event object
  4371. event = jQuery.event.fix( nativeEvent ),
  4372. handlers = (
  4373. dataPriv.get( this, "events" ) || Object.create( null )
  4374. )[ event.type ] || [],
  4375. special = jQuery.event.special[ event.type ] || {};
  4376. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4377. args[ 0 ] = event;
  4378. for ( i = 1; i < arguments.length; i++ ) {
  4379. args[ i ] = arguments[ i ];
  4380. }
  4381. event.delegateTarget = this;
  4382. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4383. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4384. return;
  4385. }
  4386. // Determine handlers
  4387. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4388. // Run delegates first; they may want to stop propagation beneath us
  4389. i = 0;
  4390. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4391. event.currentTarget = matched.elem;
  4392. j = 0;
  4393. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4394. !event.isImmediatePropagationStopped() ) {
  4395. // If the event is namespaced, then each handler is only invoked if it is
  4396. // specially universal or its namespaces are a superset of the event's.
  4397. if ( !event.rnamespace || handleObj.namespace === false ||
  4398. event.rnamespace.test( handleObj.namespace ) ) {
  4399. event.handleObj = handleObj;
  4400. event.data = handleObj.data;
  4401. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4402. handleObj.handler ).apply( matched.elem, args );
  4403. if ( ret !== undefined ) {
  4404. if ( ( event.result = ret ) === false ) {
  4405. event.preventDefault();
  4406. event.stopPropagation();
  4407. }
  4408. }
  4409. }
  4410. }
  4411. }
  4412. // Call the postDispatch hook for the mapped type
  4413. if ( special.postDispatch ) {
  4414. special.postDispatch.call( this, event );
  4415. }
  4416. return event.result;
  4417. },
  4418. handlers: function( event, handlers ) {
  4419. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4420. handlerQueue = [],
  4421. delegateCount = handlers.delegateCount,
  4422. cur = event.target;
  4423. // Find delegate handlers
  4424. if ( delegateCount &&
  4425. // Support: IE <=9
  4426. // Black-hole SVG <use> instance trees (trac-13180)
  4427. cur.nodeType &&
  4428. // Support: Firefox <=42
  4429. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4430. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4431. // Support: IE 11 only
  4432. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4433. !( event.type === "click" && event.button >= 1 ) ) {
  4434. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4435. // Don't check non-elements (#13208)
  4436. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  4437. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4438. matchedHandlers = [];
  4439. matchedSelectors = {};
  4440. for ( i = 0; i < delegateCount; i++ ) {
  4441. handleObj = handlers[ i ];
  4442. // Don't conflict with Object.prototype properties (#13203)
  4443. sel = handleObj.selector + " ";
  4444. if ( matchedSelectors[ sel ] === undefined ) {
  4445. matchedSelectors[ sel ] = handleObj.needsContext ?
  4446. jQuery( sel, this ).index( cur ) > -1 :
  4447. jQuery.find( sel, this, null, [ cur ] ).length;
  4448. }
  4449. if ( matchedSelectors[ sel ] ) {
  4450. matchedHandlers.push( handleObj );
  4451. }
  4452. }
  4453. if ( matchedHandlers.length ) {
  4454. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4455. }
  4456. }
  4457. }
  4458. }
  4459. // Add the remaining (directly-bound) handlers
  4460. cur = this;
  4461. if ( delegateCount < handlers.length ) {
  4462. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4463. }
  4464. return handlerQueue;
  4465. },
  4466. addProp: function( name, hook ) {
  4467. Object.defineProperty( jQuery.Event.prototype, name, {
  4468. enumerable: true,
  4469. configurable: true,
  4470. get: isFunction( hook ) ?
  4471. function() {
  4472. if ( this.originalEvent ) {
  4473. return hook( this.originalEvent );
  4474. }
  4475. } :
  4476. function() {
  4477. if ( this.originalEvent ) {
  4478. return this.originalEvent[ name ];
  4479. }
  4480. },
  4481. set: function( value ) {
  4482. Object.defineProperty( this, name, {
  4483. enumerable: true,
  4484. configurable: true,
  4485. writable: true,
  4486. value: value
  4487. } );
  4488. }
  4489. } );
  4490. },
  4491. fix: function( originalEvent ) {
  4492. return originalEvent[ jQuery.expando ] ?
  4493. originalEvent :
  4494. new jQuery.Event( originalEvent );
  4495. },
  4496. special: {
  4497. load: {
  4498. // Prevent triggered image.load events from bubbling to window.load
  4499. noBubble: true
  4500. },
  4501. click: {
  4502. // Utilize native event to ensure correct state for checkable inputs
  4503. setup: function( data ) {
  4504. // For mutual compressibility with _default, replace `this` access with a local var.
  4505. // `|| data` is dead code meant only to preserve the variable through minification.
  4506. var el = this || data;
  4507. // Claim the first handler
  4508. if ( rcheckableType.test( el.type ) &&
  4509. el.click && nodeName( el, "input" ) ) {
  4510. // dataPriv.set( el, "click", ... )
  4511. leverageNative( el, "click", returnTrue );
  4512. }
  4513. // Return false to allow normal processing in the caller
  4514. return false;
  4515. },
  4516. trigger: function( data ) {
  4517. // For mutual compressibility with _default, replace `this` access with a local var.
  4518. // `|| data` is dead code meant only to preserve the variable through minification.
  4519. var el = this || data;
  4520. // Force setup before triggering a click
  4521. if ( rcheckableType.test( el.type ) &&
  4522. el.click && nodeName( el, "input" ) ) {
  4523. leverageNative( el, "click" );
  4524. }
  4525. // Return non-false to allow normal event-path propagation
  4526. return true;
  4527. },
  4528. // For cross-browser consistency, suppress native .click() on links
  4529. // Also prevent it if we're currently inside a leveraged native-event stack
  4530. _default: function( event ) {
  4531. var target = event.target;
  4532. return rcheckableType.test( target.type ) &&
  4533. target.click && nodeName( target, "input" ) &&
  4534. dataPriv.get( target, "click" ) ||
  4535. nodeName( target, "a" );
  4536. }
  4537. },
  4538. beforeunload: {
  4539. postDispatch: function( event ) {
  4540. // Support: Firefox 20+
  4541. // Firefox doesn't alert if the returnValue field is not set.
  4542. if ( event.result !== undefined && event.originalEvent ) {
  4543. event.originalEvent.returnValue = event.result;
  4544. }
  4545. }
  4546. }
  4547. }
  4548. };
  4549. // Ensure the presence of an event listener that handles manually-triggered
  4550. // synthetic events by interrupting progress until reinvoked in response to
  4551. // *native* events that it fires directly, ensuring that state changes have
  4552. // already occurred before other listeners are invoked.
  4553. function leverageNative( el, type, expectSync ) {
  4554. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  4555. if ( !expectSync ) {
  4556. if ( dataPriv.get( el, type ) === undefined ) {
  4557. jQuery.event.add( el, type, returnTrue );
  4558. }
  4559. return;
  4560. }
  4561. // Register the controller as a special universal handler for all event namespaces
  4562. dataPriv.set( el, type, false );
  4563. jQuery.event.add( el, type, {
  4564. namespace: false,
  4565. handler: function( event ) {
  4566. var notAsync, result,
  4567. saved = dataPriv.get( this, type );
  4568. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  4569. // Interrupt processing of the outer synthetic .trigger()ed event
  4570. // Saved data should be false in such cases, but might be a leftover capture object
  4571. // from an async native handler (gh-4350)
  4572. if ( !saved.length ) {
  4573. // Store arguments for use when handling the inner native event
  4574. // There will always be at least one argument (an event object), so this array
  4575. // will not be confused with a leftover capture object.
  4576. saved = slice.call( arguments );
  4577. dataPriv.set( this, type, saved );
  4578. // Trigger the native event and capture its result
  4579. // Support: IE <=9 - 11+
  4580. // focus() and blur() are asynchronous
  4581. notAsync = expectSync( this, type );
  4582. this[ type ]();
  4583. result = dataPriv.get( this, type );
  4584. if ( saved !== result || notAsync ) {
  4585. dataPriv.set( this, type, false );
  4586. } else {
  4587. result = {};
  4588. }
  4589. if ( saved !== result ) {
  4590. // Cancel the outer synthetic event
  4591. event.stopImmediatePropagation();
  4592. event.preventDefault();
  4593. // Support: Chrome 86+
  4594. // In Chrome, if an element having a focusout handler is blurred by
  4595. // clicking outside of it, it invokes the handler synchronously. If
  4596. // that handler calls `.remove()` on the element, the data is cleared,
  4597. // leaving `result` undefined. We need to guard against this.
  4598. return result && result.value;
  4599. }
  4600. // If this is an inner synthetic event for an event with a bubbling surrogate
  4601. // (focus or blur), assume that the surrogate already propagated from triggering the
  4602. // native event and prevent that from happening again here.
  4603. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  4604. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  4605. // less bad than duplication.
  4606. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  4607. event.stopPropagation();
  4608. }
  4609. // If this is a native event triggered above, everything is now in order
  4610. // Fire an inner synthetic event with the original arguments
  4611. } else if ( saved.length ) {
  4612. // ...and capture the result
  4613. dataPriv.set( this, type, {
  4614. value: jQuery.event.trigger(
  4615. // Support: IE <=9 - 11+
  4616. // Extend with the prototype to reset the above stopImmediatePropagation()
  4617. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  4618. saved.slice( 1 ),
  4619. this
  4620. )
  4621. } );
  4622. // Abort handling of the native event
  4623. event.stopImmediatePropagation();
  4624. }
  4625. }
  4626. } );
  4627. }
  4628. jQuery.removeEvent = function( elem, type, handle ) {
  4629. // This "if" is needed for plain objects
  4630. if ( elem.removeEventListener ) {
  4631. elem.removeEventListener( type, handle );
  4632. }
  4633. };
  4634. jQuery.Event = function( src, props ) {
  4635. // Allow instantiation without the 'new' keyword
  4636. if ( !( this instanceof jQuery.Event ) ) {
  4637. return new jQuery.Event( src, props );
  4638. }
  4639. // Event object
  4640. if ( src && src.type ) {
  4641. this.originalEvent = src;
  4642. this.type = src.type;
  4643. // Events bubbling up the document may have been marked as prevented
  4644. // by a handler lower down the tree; reflect the correct value.
  4645. this.isDefaultPrevented = src.defaultPrevented ||
  4646. src.defaultPrevented === undefined &&
  4647. // Support: Android <=2.3 only
  4648. src.returnValue === false ?
  4649. returnTrue :
  4650. returnFalse;
  4651. // Create target properties
  4652. // Support: Safari <=6 - 7 only
  4653. // Target should not be a text node (#504, #13143)
  4654. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4655. src.target.parentNode :
  4656. src.target;
  4657. this.currentTarget = src.currentTarget;
  4658. this.relatedTarget = src.relatedTarget;
  4659. // Event type
  4660. } else {
  4661. this.type = src;
  4662. }
  4663. // Put explicitly provided properties onto the event object
  4664. if ( props ) {
  4665. jQuery.extend( this, props );
  4666. }
  4667. // Create a timestamp if incoming event doesn't have one
  4668. this.timeStamp = src && src.timeStamp || Date.now();
  4669. // Mark it as fixed
  4670. this[ jQuery.expando ] = true;
  4671. };
  4672. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4673. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4674. jQuery.Event.prototype = {
  4675. constructor: jQuery.Event,
  4676. isDefaultPrevented: returnFalse,
  4677. isPropagationStopped: returnFalse,
  4678. isImmediatePropagationStopped: returnFalse,
  4679. isSimulated: false,
  4680. preventDefault: function() {
  4681. var e = this.originalEvent;
  4682. this.isDefaultPrevented = returnTrue;
  4683. if ( e && !this.isSimulated ) {
  4684. e.preventDefault();
  4685. }
  4686. },
  4687. stopPropagation: function() {
  4688. var e = this.originalEvent;
  4689. this.isPropagationStopped = returnTrue;
  4690. if ( e && !this.isSimulated ) {
  4691. e.stopPropagation();
  4692. }
  4693. },
  4694. stopImmediatePropagation: function() {
  4695. var e = this.originalEvent;
  4696. this.isImmediatePropagationStopped = returnTrue;
  4697. if ( e && !this.isSimulated ) {
  4698. e.stopImmediatePropagation();
  4699. }
  4700. this.stopPropagation();
  4701. }
  4702. };
  4703. // Includes all common event props including KeyEvent and MouseEvent specific props
  4704. jQuery.each( {
  4705. altKey: true,
  4706. bubbles: true,
  4707. cancelable: true,
  4708. changedTouches: true,
  4709. ctrlKey: true,
  4710. detail: true,
  4711. eventPhase: true,
  4712. metaKey: true,
  4713. pageX: true,
  4714. pageY: true,
  4715. shiftKey: true,
  4716. view: true,
  4717. "char": true,
  4718. code: true,
  4719. charCode: true,
  4720. key: true,
  4721. keyCode: true,
  4722. button: true,
  4723. buttons: true,
  4724. clientX: true,
  4725. clientY: true,
  4726. offsetX: true,
  4727. offsetY: true,
  4728. pointerId: true,
  4729. pointerType: true,
  4730. screenX: true,
  4731. screenY: true,
  4732. targetTouches: true,
  4733. toElement: true,
  4734. touches: true,
  4735. which: true
  4736. }, jQuery.event.addProp );
  4737. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  4738. jQuery.event.special[ type ] = {
  4739. // Utilize native event if possible so blur/focus sequence is correct
  4740. setup: function() {
  4741. // Claim the first handler
  4742. // dataPriv.set( this, "focus", ... )
  4743. // dataPriv.set( this, "blur", ... )
  4744. leverageNative( this, type, expectSync );
  4745. // Return false to allow normal processing in the caller
  4746. return false;
  4747. },
  4748. trigger: function() {
  4749. // Force setup before trigger
  4750. leverageNative( this, type );
  4751. // Return non-false to allow normal event-path propagation
  4752. return true;
  4753. },
  4754. // Suppress native focus or blur as it's already being fired
  4755. // in leverageNative.
  4756. _default: function() {
  4757. return true;
  4758. },
  4759. delegateType: delegateType
  4760. };
  4761. } );
  4762. // Create mouseenter/leave events using mouseover/out and event-time checks
  4763. // so that event delegation works in jQuery.
  4764. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4765. //
  4766. // Support: Safari 7 only
  4767. // Safari sends mouseenter too often; see:
  4768. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4769. // for the description of the bug (it existed in older Chrome versions as well).
  4770. jQuery.each( {
  4771. mouseenter: "mouseover",
  4772. mouseleave: "mouseout",
  4773. pointerenter: "pointerover",
  4774. pointerleave: "pointerout"
  4775. }, function( orig, fix ) {
  4776. jQuery.event.special[ orig ] = {
  4777. delegateType: fix,
  4778. bindType: fix,
  4779. handle: function( event ) {
  4780. var ret,
  4781. target = this,
  4782. related = event.relatedTarget,
  4783. handleObj = event.handleObj;
  4784. // For mouseenter/leave call the handler if related is outside the target.
  4785. // NB: No relatedTarget if the mouse left/entered the browser window
  4786. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4787. event.type = handleObj.origType;
  4788. ret = handleObj.handler.apply( this, arguments );
  4789. event.type = fix;
  4790. }
  4791. return ret;
  4792. }
  4793. };
  4794. } );
  4795. jQuery.fn.extend( {
  4796. on: function( types, selector, data, fn ) {
  4797. return on( this, types, selector, data, fn );
  4798. },
  4799. one: function( types, selector, data, fn ) {
  4800. return on( this, types, selector, data, fn, 1 );
  4801. },
  4802. off: function( types, selector, fn ) {
  4803. var handleObj, type;
  4804. if ( types && types.preventDefault && types.handleObj ) {
  4805. // ( event ) dispatched jQuery.Event
  4806. handleObj = types.handleObj;
  4807. jQuery( types.delegateTarget ).off(
  4808. handleObj.namespace ?
  4809. handleObj.origType + "." + handleObj.namespace :
  4810. handleObj.origType,
  4811. handleObj.selector,
  4812. handleObj.handler
  4813. );
  4814. return this;
  4815. }
  4816. if ( typeof types === "object" ) {
  4817. // ( types-object [, selector] )
  4818. for ( type in types ) {
  4819. this.off( type, selector, types[ type ] );
  4820. }
  4821. return this;
  4822. }
  4823. if ( selector === false || typeof selector === "function" ) {
  4824. // ( types [, fn] )
  4825. fn = selector;
  4826. selector = undefined;
  4827. }
  4828. if ( fn === false ) {
  4829. fn = returnFalse;
  4830. }
  4831. return this.each( function() {
  4832. jQuery.event.remove( this, types, fn, selector );
  4833. } );
  4834. }
  4835. } );
  4836. var
  4837. // Support: IE <=10 - 11, Edge 12 - 13 only
  4838. // In IE/Edge using regex groups here causes severe slowdowns.
  4839. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4840. rnoInnerhtml = /<script|<style|<link/i,
  4841. // checked="checked" or checked
  4842. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4843. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  4844. // Prefer a tbody over its parent table for containing new rows
  4845. function manipulationTarget( elem, content ) {
  4846. if ( nodeName( elem, "table" ) &&
  4847. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4848. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  4849. }
  4850. return elem;
  4851. }
  4852. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4853. function disableScript( elem ) {
  4854. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4855. return elem;
  4856. }
  4857. function restoreScript( elem ) {
  4858. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  4859. elem.type = elem.type.slice( 5 );
  4860. } else {
  4861. elem.removeAttribute( "type" );
  4862. }
  4863. return elem;
  4864. }
  4865. function cloneCopyEvent( src, dest ) {
  4866. var i, l, type, pdataOld, udataOld, udataCur, events;
  4867. if ( dest.nodeType !== 1 ) {
  4868. return;
  4869. }
  4870. // 1. Copy private data: events, handlers, etc.
  4871. if ( dataPriv.hasData( src ) ) {
  4872. pdataOld = dataPriv.get( src );
  4873. events = pdataOld.events;
  4874. if ( events ) {
  4875. dataPriv.remove( dest, "handle events" );
  4876. for ( type in events ) {
  4877. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4878. jQuery.event.add( dest, type, events[ type ][ i ] );
  4879. }
  4880. }
  4881. }
  4882. }
  4883. // 2. Copy user data
  4884. if ( dataUser.hasData( src ) ) {
  4885. udataOld = dataUser.access( src );
  4886. udataCur = jQuery.extend( {}, udataOld );
  4887. dataUser.set( dest, udataCur );
  4888. }
  4889. }
  4890. // Fix IE bugs, see support tests
  4891. function fixInput( src, dest ) {
  4892. var nodeName = dest.nodeName.toLowerCase();
  4893. // Fails to persist the checked state of a cloned checkbox or radio button.
  4894. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4895. dest.checked = src.checked;
  4896. // Fails to return the selected option to the default selected state when cloning options
  4897. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4898. dest.defaultValue = src.defaultValue;
  4899. }
  4900. }
  4901. function domManip( collection, args, callback, ignored ) {
  4902. // Flatten any nested arrays
  4903. args = flat( args );
  4904. var fragment, first, scripts, hasScripts, node, doc,
  4905. i = 0,
  4906. l = collection.length,
  4907. iNoClone = l - 1,
  4908. value = args[ 0 ],
  4909. valueIsFunction = isFunction( value );
  4910. // We can't cloneNode fragments that contain checked, in WebKit
  4911. if ( valueIsFunction ||
  4912. ( l > 1 && typeof value === "string" &&
  4913. !support.checkClone && rchecked.test( value ) ) ) {
  4914. return collection.each( function( index ) {
  4915. var self = collection.eq( index );
  4916. if ( valueIsFunction ) {
  4917. args[ 0 ] = value.call( this, index, self.html() );
  4918. }
  4919. domManip( self, args, callback, ignored );
  4920. } );
  4921. }
  4922. if ( l ) {
  4923. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4924. first = fragment.firstChild;
  4925. if ( fragment.childNodes.length === 1 ) {
  4926. fragment = first;
  4927. }
  4928. // Require either new content or an interest in ignored elements to invoke the callback
  4929. if ( first || ignored ) {
  4930. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4931. hasScripts = scripts.length;
  4932. // Use the original fragment for the last item
  4933. // instead of the first because it can end up
  4934. // being emptied incorrectly in certain situations (#8070).
  4935. for ( ; i < l; i++ ) {
  4936. node = fragment;
  4937. if ( i !== iNoClone ) {
  4938. node = jQuery.clone( node, true, true );
  4939. // Keep references to cloned scripts for later restoration
  4940. if ( hasScripts ) {
  4941. // Support: Android <=4.0 only, PhantomJS 1 only
  4942. // push.apply(_, arraylike) throws on ancient WebKit
  4943. jQuery.merge( scripts, getAll( node, "script" ) );
  4944. }
  4945. }
  4946. callback.call( collection[ i ], node, i );
  4947. }
  4948. if ( hasScripts ) {
  4949. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4950. // Reenable scripts
  4951. jQuery.map( scripts, restoreScript );
  4952. // Evaluate executable scripts on first document insertion
  4953. for ( i = 0; i < hasScripts; i++ ) {
  4954. node = scripts[ i ];
  4955. if ( rscriptType.test( node.type || "" ) &&
  4956. !dataPriv.access( node, "globalEval" ) &&
  4957. jQuery.contains( doc, node ) ) {
  4958. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  4959. // Optional AJAX dependency, but won't run scripts if not present
  4960. if ( jQuery._evalUrl && !node.noModule ) {
  4961. jQuery._evalUrl( node.src, {
  4962. nonce: node.nonce || node.getAttribute( "nonce" )
  4963. }, doc );
  4964. }
  4965. } else {
  4966. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  4967. }
  4968. }
  4969. }
  4970. }
  4971. }
  4972. }
  4973. return collection;
  4974. }
  4975. function remove( elem, selector, keepData ) {
  4976. var node,
  4977. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4978. i = 0;
  4979. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4980. if ( !keepData && node.nodeType === 1 ) {
  4981. jQuery.cleanData( getAll( node ) );
  4982. }
  4983. if ( node.parentNode ) {
  4984. if ( keepData && isAttached( node ) ) {
  4985. setGlobalEval( getAll( node, "script" ) );
  4986. }
  4987. node.parentNode.removeChild( node );
  4988. }
  4989. }
  4990. return elem;
  4991. }
  4992. jQuery.extend( {
  4993. htmlPrefilter: function( html ) {
  4994. return html;
  4995. },
  4996. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4997. var i, l, srcElements, destElements,
  4998. clone = elem.cloneNode( true ),
  4999. inPage = isAttached( elem );
  5000. // Fix IE cloning issues
  5001. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  5002. !jQuery.isXMLDoc( elem ) ) {
  5003. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  5004. destElements = getAll( clone );
  5005. srcElements = getAll( elem );
  5006. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5007. fixInput( srcElements[ i ], destElements[ i ] );
  5008. }
  5009. }
  5010. // Copy the events from the original to the clone
  5011. if ( dataAndEvents ) {
  5012. if ( deepDataAndEvents ) {
  5013. srcElements = srcElements || getAll( elem );
  5014. destElements = destElements || getAll( clone );
  5015. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  5016. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  5017. }
  5018. } else {
  5019. cloneCopyEvent( elem, clone );
  5020. }
  5021. }
  5022. // Preserve script evaluation history
  5023. destElements = getAll( clone, "script" );
  5024. if ( destElements.length > 0 ) {
  5025. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  5026. }
  5027. // Return the cloned set
  5028. return clone;
  5029. },
  5030. cleanData: function( elems ) {
  5031. var data, elem, type,
  5032. special = jQuery.event.special,
  5033. i = 0;
  5034. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  5035. if ( acceptData( elem ) ) {
  5036. if ( ( data = elem[ dataPriv.expando ] ) ) {
  5037. if ( data.events ) {
  5038. for ( type in data.events ) {
  5039. if ( special[ type ] ) {
  5040. jQuery.event.remove( elem, type );
  5041. // This is a shortcut to avoid jQuery.event.remove's overhead
  5042. } else {
  5043. jQuery.removeEvent( elem, type, data.handle );
  5044. }
  5045. }
  5046. }
  5047. // Support: Chrome <=35 - 45+
  5048. // Assign undefined instead of using delete, see Data#remove
  5049. elem[ dataPriv.expando ] = undefined;
  5050. }
  5051. if ( elem[ dataUser.expando ] ) {
  5052. // Support: Chrome <=35 - 45+
  5053. // Assign undefined instead of using delete, see Data#remove
  5054. elem[ dataUser.expando ] = undefined;
  5055. }
  5056. }
  5057. }
  5058. }
  5059. } );
  5060. jQuery.fn.extend( {
  5061. detach: function( selector ) {
  5062. return remove( this, selector, true );
  5063. },
  5064. remove: function( selector ) {
  5065. return remove( this, selector );
  5066. },
  5067. text: function( value ) {
  5068. return access( this, function( value ) {
  5069. return value === undefined ?
  5070. jQuery.text( this ) :
  5071. this.empty().each( function() {
  5072. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5073. this.textContent = value;
  5074. }
  5075. } );
  5076. }, null, value, arguments.length );
  5077. },
  5078. append: function() {
  5079. return domManip( this, arguments, function( elem ) {
  5080. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5081. var target = manipulationTarget( this, elem );
  5082. target.appendChild( elem );
  5083. }
  5084. } );
  5085. },
  5086. prepend: function() {
  5087. return domManip( this, arguments, function( elem ) {
  5088. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5089. var target = manipulationTarget( this, elem );
  5090. target.insertBefore( elem, target.firstChild );
  5091. }
  5092. } );
  5093. },
  5094. before: function() {
  5095. return domManip( this, arguments, function( elem ) {
  5096. if ( this.parentNode ) {
  5097. this.parentNode.insertBefore( elem, this );
  5098. }
  5099. } );
  5100. },
  5101. after: function() {
  5102. return domManip( this, arguments, function( elem ) {
  5103. if ( this.parentNode ) {
  5104. this.parentNode.insertBefore( elem, this.nextSibling );
  5105. }
  5106. } );
  5107. },
  5108. empty: function() {
  5109. var elem,
  5110. i = 0;
  5111. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  5112. if ( elem.nodeType === 1 ) {
  5113. // Prevent memory leaks
  5114. jQuery.cleanData( getAll( elem, false ) );
  5115. // Remove any remaining nodes
  5116. elem.textContent = "";
  5117. }
  5118. }
  5119. return this;
  5120. },
  5121. clone: function( dataAndEvents, deepDataAndEvents ) {
  5122. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  5123. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  5124. return this.map( function() {
  5125. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  5126. } );
  5127. },
  5128. html: function( value ) {
  5129. return access( this, function( value ) {
  5130. var elem = this[ 0 ] || {},
  5131. i = 0,
  5132. l = this.length;
  5133. if ( value === undefined && elem.nodeType === 1 ) {
  5134. return elem.innerHTML;
  5135. }
  5136. // See if we can take a shortcut and just use innerHTML
  5137. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  5138. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  5139. value = jQuery.htmlPrefilter( value );
  5140. try {
  5141. for ( ; i < l; i++ ) {
  5142. elem = this[ i ] || {};
  5143. // Remove element nodes and prevent memory leaks
  5144. if ( elem.nodeType === 1 ) {
  5145. jQuery.cleanData( getAll( elem, false ) );
  5146. elem.innerHTML = value;
  5147. }
  5148. }
  5149. elem = 0;
  5150. // If using innerHTML throws an exception, use the fallback method
  5151. } catch ( e ) {}
  5152. }
  5153. if ( elem ) {
  5154. this.empty().append( value );
  5155. }
  5156. }, null, value, arguments.length );
  5157. },
  5158. replaceWith: function() {
  5159. var ignored = [];
  5160. // Make the changes, replacing each non-ignored context element with the new content
  5161. return domManip( this, arguments, function( elem ) {
  5162. var parent = this.parentNode;
  5163. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5164. jQuery.cleanData( getAll( this ) );
  5165. if ( parent ) {
  5166. parent.replaceChild( elem, this );
  5167. }
  5168. }
  5169. // Force callback invocation
  5170. }, ignored );
  5171. }
  5172. } );
  5173. jQuery.each( {
  5174. appendTo: "append",
  5175. prependTo: "prepend",
  5176. insertBefore: "before",
  5177. insertAfter: "after",
  5178. replaceAll: "replaceWith"
  5179. }, function( name, original ) {
  5180. jQuery.fn[ name ] = function( selector ) {
  5181. var elems,
  5182. ret = [],
  5183. insert = jQuery( selector ),
  5184. last = insert.length - 1,
  5185. i = 0;
  5186. for ( ; i <= last; i++ ) {
  5187. elems = i === last ? this : this.clone( true );
  5188. jQuery( insert[ i ] )[ original ]( elems );
  5189. // Support: Android <=4.0 only, PhantomJS 1 only
  5190. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5191. push.apply( ret, elems.get() );
  5192. }
  5193. return this.pushStack( ret );
  5194. };
  5195. } );
  5196. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5197. var getStyles = function( elem ) {
  5198. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  5199. // IE throws on elements created in popups
  5200. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5201. var view = elem.ownerDocument.defaultView;
  5202. if ( !view || !view.opener ) {
  5203. view = window;
  5204. }
  5205. return view.getComputedStyle( elem );
  5206. };
  5207. var swap = function( elem, options, callback ) {
  5208. var ret, name,
  5209. old = {};
  5210. // Remember the old values, and insert the new ones
  5211. for ( name in options ) {
  5212. old[ name ] = elem.style[ name ];
  5213. elem.style[ name ] = options[ name ];
  5214. }
  5215. ret = callback.call( elem );
  5216. // Revert the old values
  5217. for ( name in options ) {
  5218. elem.style[ name ] = old[ name ];
  5219. }
  5220. return ret;
  5221. };
  5222. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  5223. ( function() {
  5224. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5225. // so they're executed at the same time to save the second computation.
  5226. function computeStyleTests() {
  5227. // This is a singleton, we need to execute it only once
  5228. if ( !div ) {
  5229. return;
  5230. }
  5231. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  5232. "margin-top:1px;padding:0;border:0";
  5233. div.style.cssText =
  5234. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  5235. "margin:auto;border:1px;padding:1px;" +
  5236. "width:60%;top:1%";
  5237. documentElement.appendChild( container ).appendChild( div );
  5238. var divStyle = window.getComputedStyle( div );
  5239. pixelPositionVal = divStyle.top !== "1%";
  5240. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5241. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  5242. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  5243. // Some styles come back with percentage values, even though they shouldn't
  5244. div.style.right = "60%";
  5245. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  5246. // Support: IE 9 - 11 only
  5247. // Detect misreporting of content dimensions for box-sizing:border-box elements
  5248. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  5249. // Support: IE 9 only
  5250. // Detect overflow:scroll screwiness (gh-3699)
  5251. // Support: Chrome <=64
  5252. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  5253. div.style.position = "absolute";
  5254. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  5255. documentElement.removeChild( container );
  5256. // Nullify the div so it wouldn't be stored in the memory and
  5257. // it will also be a sign that checks already performed
  5258. div = null;
  5259. }
  5260. function roundPixelMeasures( measure ) {
  5261. return Math.round( parseFloat( measure ) );
  5262. }
  5263. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  5264. reliableTrDimensionsVal, reliableMarginLeftVal,
  5265. container = document.createElement( "div" ),
  5266. div = document.createElement( "div" );
  5267. // Finish early in limited (non-browser) environments
  5268. if ( !div.style ) {
  5269. return;
  5270. }
  5271. // Support: IE <=9 - 11 only
  5272. // Style of cloned element affects source element cloned (#8908)
  5273. div.style.backgroundClip = "content-box";
  5274. div.cloneNode( true ).style.backgroundClip = "";
  5275. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5276. jQuery.extend( support, {
  5277. boxSizingReliable: function() {
  5278. computeStyleTests();
  5279. return boxSizingReliableVal;
  5280. },
  5281. pixelBoxStyles: function() {
  5282. computeStyleTests();
  5283. return pixelBoxStylesVal;
  5284. },
  5285. pixelPosition: function() {
  5286. computeStyleTests();
  5287. return pixelPositionVal;
  5288. },
  5289. reliableMarginLeft: function() {
  5290. computeStyleTests();
  5291. return reliableMarginLeftVal;
  5292. },
  5293. scrollboxSize: function() {
  5294. computeStyleTests();
  5295. return scrollboxSizeVal;
  5296. },
  5297. // Support: IE 9 - 11+, Edge 15 - 18+
  5298. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5299. // set in CSS while `offset*` properties report correct values.
  5300. // Behavior in IE 9 is more subtle than in newer versions & it passes
  5301. // some versions of this test; make sure not to make it pass there!
  5302. //
  5303. // Support: Firefox 70+
  5304. // Only Firefox includes border widths
  5305. // in computed dimensions. (gh-4529)
  5306. reliableTrDimensions: function() {
  5307. var table, tr, trChild, trStyle;
  5308. if ( reliableTrDimensionsVal == null ) {
  5309. table = document.createElement( "table" );
  5310. tr = document.createElement( "tr" );
  5311. trChild = document.createElement( "div" );
  5312. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  5313. tr.style.cssText = "border:1px solid";
  5314. // Support: Chrome 86+
  5315. // Height set through cssText does not get applied.
  5316. // Computed height then comes back as 0.
  5317. tr.style.height = "1px";
  5318. trChild.style.height = "9px";
  5319. // Support: Android 8 Chrome 86+
  5320. // In our bodyBackground.html iframe,
  5321. // display for all div elements is set to "inline",
  5322. // which causes a problem only in Android 8 Chrome 86.
  5323. // Ensuring the div is display: block
  5324. // gets around this issue.
  5325. trChild.style.display = "block";
  5326. documentElement
  5327. .appendChild( table )
  5328. .appendChild( tr )
  5329. .appendChild( trChild );
  5330. trStyle = window.getComputedStyle( tr );
  5331. reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
  5332. parseInt( trStyle.borderTopWidth, 10 ) +
  5333. parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
  5334. documentElement.removeChild( table );
  5335. }
  5336. return reliableTrDimensionsVal;
  5337. }
  5338. } );
  5339. } )();
  5340. function curCSS( elem, name, computed ) {
  5341. var width, minWidth, maxWidth, ret,
  5342. // Support: Firefox 51+
  5343. // Retrieving style before computed somehow
  5344. // fixes an issue with getting wrong values
  5345. // on detached elements
  5346. style = elem.style;
  5347. computed = computed || getStyles( elem );
  5348. // getPropertyValue is needed for:
  5349. // .css('filter') (IE 9 only, #12537)
  5350. // .css('--customProperty) (#3144)
  5351. if ( computed ) {
  5352. ret = computed.getPropertyValue( name ) || computed[ name ];
  5353. if ( ret === "" && !isAttached( elem ) ) {
  5354. ret = jQuery.style( elem, name );
  5355. }
  5356. // A tribute to the "awesome hack by Dean Edwards"
  5357. // Android Browser returns percentage for some values,
  5358. // but width seems to be reliably pixels.
  5359. // This is against the CSSOM draft spec:
  5360. // https://drafts.csswg.org/cssom/#resolved-values
  5361. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  5362. // Remember the original values
  5363. width = style.width;
  5364. minWidth = style.minWidth;
  5365. maxWidth = style.maxWidth;
  5366. // Put in the new values to get a computed value out
  5367. style.minWidth = style.maxWidth = style.width = ret;
  5368. ret = computed.width;
  5369. // Revert the changed values
  5370. style.width = width;
  5371. style.minWidth = minWidth;
  5372. style.maxWidth = maxWidth;
  5373. }
  5374. }
  5375. return ret !== undefined ?
  5376. // Support: IE <=9 - 11 only
  5377. // IE returns zIndex value as an integer.
  5378. ret + "" :
  5379. ret;
  5380. }
  5381. function addGetHookIf( conditionFn, hookFn ) {
  5382. // Define the hook, we'll check on the first run if it's really needed.
  5383. return {
  5384. get: function() {
  5385. if ( conditionFn() ) {
  5386. // Hook not needed (or it's not possible to use it due
  5387. // to missing dependency), remove it.
  5388. delete this.get;
  5389. return;
  5390. }
  5391. // Hook needed; redefine it so that the support test is not executed again.
  5392. return ( this.get = hookFn ).apply( this, arguments );
  5393. }
  5394. };
  5395. }
  5396. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5397. emptyStyle = document.createElement( "div" ).style,
  5398. vendorProps = {};
  5399. // Return a vendor-prefixed property or undefined
  5400. function vendorPropName( name ) {
  5401. // Check for vendor prefixed names
  5402. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5403. i = cssPrefixes.length;
  5404. while ( i-- ) {
  5405. name = cssPrefixes[ i ] + capName;
  5406. if ( name in emptyStyle ) {
  5407. return name;
  5408. }
  5409. }
  5410. }
  5411. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  5412. function finalPropName( name ) {
  5413. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  5414. if ( final ) {
  5415. return final;
  5416. }
  5417. if ( name in emptyStyle ) {
  5418. return name;
  5419. }
  5420. return vendorProps[ name ] = vendorPropName( name ) || name;
  5421. }
  5422. var
  5423. // Swappable if display is none or starts with table
  5424. // except "table", "table-cell", or "table-caption"
  5425. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5426. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5427. rcustomProp = /^--/,
  5428. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5429. cssNormalTransform = {
  5430. letterSpacing: "0",
  5431. fontWeight: "400"
  5432. };
  5433. function setPositiveNumber( _elem, value, subtract ) {
  5434. // Any relative (+/-) values have already been
  5435. // normalized at this point
  5436. var matches = rcssNum.exec( value );
  5437. return matches ?
  5438. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5439. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5440. value;
  5441. }
  5442. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  5443. var i = dimension === "width" ? 1 : 0,
  5444. extra = 0,
  5445. delta = 0;
  5446. // Adjustment may not be necessary
  5447. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  5448. return 0;
  5449. }
  5450. for ( ; i < 4; i += 2 ) {
  5451. // Both box models exclude margin
  5452. if ( box === "margin" ) {
  5453. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  5454. }
  5455. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  5456. if ( !isBorderBox ) {
  5457. // Add padding
  5458. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5459. // For "border" or "margin", add border
  5460. if ( box !== "padding" ) {
  5461. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5462. // But still keep track of it otherwise
  5463. } else {
  5464. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5465. }
  5466. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  5467. // "padding" or "margin"
  5468. } else {
  5469. // For "content", subtract padding
  5470. if ( box === "content" ) {
  5471. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5472. }
  5473. // For "content" or "padding", subtract border
  5474. if ( box !== "margin" ) {
  5475. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5476. }
  5477. }
  5478. }
  5479. // Account for positive content-box scroll gutter when requested by providing computedVal
  5480. if ( !isBorderBox && computedVal >= 0 ) {
  5481. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  5482. // Assuming integer scroll gutter, subtract the rest and round down
  5483. delta += Math.max( 0, Math.ceil(
  5484. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5485. computedVal -
  5486. delta -
  5487. extra -
  5488. 0.5
  5489. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  5490. // Use an explicit zero to avoid NaN (gh-3964)
  5491. ) ) || 0;
  5492. }
  5493. return delta;
  5494. }
  5495. function getWidthOrHeight( elem, dimension, extra ) {
  5496. // Start with computed style
  5497. var styles = getStyles( elem ),
  5498. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  5499. // Fake content-box until we know it's needed to know the true value.
  5500. boxSizingNeeded = !support.boxSizingReliable() || extra,
  5501. isBorderBox = boxSizingNeeded &&
  5502. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5503. valueIsBorderBox = isBorderBox,
  5504. val = curCSS( elem, dimension, styles ),
  5505. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  5506. // Support: Firefox <=54
  5507. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  5508. if ( rnumnonpx.test( val ) ) {
  5509. if ( !extra ) {
  5510. return val;
  5511. }
  5512. val = "auto";
  5513. }
  5514. // Support: IE 9 - 11 only
  5515. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  5516. // In those cases, the computed value can be trusted to be border-box.
  5517. if ( ( !support.boxSizingReliable() && isBorderBox ||
  5518. // Support: IE 10 - 11+, Edge 15 - 18+
  5519. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5520. // set in CSS while `offset*` properties report correct values.
  5521. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  5522. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  5523. // Fall back to offsetWidth/offsetHeight when value is "auto"
  5524. // This happens for inline elements with no explicit setting (gh-3571)
  5525. val === "auto" ||
  5526. // Support: Android <=4.1 - 4.3 only
  5527. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  5528. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  5529. // Make sure the element is visible & connected
  5530. elem.getClientRects().length ) {
  5531. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5532. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  5533. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  5534. // retrieved value as a content box dimension.
  5535. valueIsBorderBox = offsetProp in elem;
  5536. if ( valueIsBorderBox ) {
  5537. val = elem[ offsetProp ];
  5538. }
  5539. }
  5540. // Normalize "" and auto
  5541. val = parseFloat( val ) || 0;
  5542. // Adjust for the element's box model
  5543. return ( val +
  5544. boxModelAdjustment(
  5545. elem,
  5546. dimension,
  5547. extra || ( isBorderBox ? "border" : "content" ),
  5548. valueIsBorderBox,
  5549. styles,
  5550. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  5551. val
  5552. )
  5553. ) + "px";
  5554. }
  5555. jQuery.extend( {
  5556. // Add in style property hooks for overriding the default
  5557. // behavior of getting and setting a style property
  5558. cssHooks: {
  5559. opacity: {
  5560. get: function( elem, computed ) {
  5561. if ( computed ) {
  5562. // We should always get a number back from opacity
  5563. var ret = curCSS( elem, "opacity" );
  5564. return ret === "" ? "1" : ret;
  5565. }
  5566. }
  5567. }
  5568. },
  5569. // Don't automatically add "px" to these possibly-unitless properties
  5570. cssNumber: {
  5571. "animationIterationCount": true,
  5572. "columnCount": true,
  5573. "fillOpacity": true,
  5574. "flexGrow": true,
  5575. "flexShrink": true,
  5576. "fontWeight": true,
  5577. "gridArea": true,
  5578. "gridColumn": true,
  5579. "gridColumnEnd": true,
  5580. "gridColumnStart": true,
  5581. "gridRow": true,
  5582. "gridRowEnd": true,
  5583. "gridRowStart": true,
  5584. "lineHeight": true,
  5585. "opacity": true,
  5586. "order": true,
  5587. "orphans": true,
  5588. "widows": true,
  5589. "zIndex": true,
  5590. "zoom": true
  5591. },
  5592. // Add in properties whose names you wish to fix before
  5593. // setting or getting the value
  5594. cssProps: {},
  5595. // Get and set the style property on a DOM Node
  5596. style: function( elem, name, value, extra ) {
  5597. // Don't set styles on text and comment nodes
  5598. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5599. return;
  5600. }
  5601. // Make sure that we're working with the right name
  5602. var ret, type, hooks,
  5603. origName = camelCase( name ),
  5604. isCustomProp = rcustomProp.test( name ),
  5605. style = elem.style;
  5606. // Make sure that we're working with the right name. We don't
  5607. // want to query the value if it is a CSS custom property
  5608. // since they are user-defined.
  5609. if ( !isCustomProp ) {
  5610. name = finalPropName( origName );
  5611. }
  5612. // Gets hook for the prefixed version, then unprefixed version
  5613. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5614. // Check if we're setting a value
  5615. if ( value !== undefined ) {
  5616. type = typeof value;
  5617. // Convert "+=" or "-=" to relative numbers (#7345)
  5618. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5619. value = adjustCSS( elem, name, ret );
  5620. // Fixes bug #9237
  5621. type = "number";
  5622. }
  5623. // Make sure that null and NaN values aren't set (#7116)
  5624. if ( value == null || value !== value ) {
  5625. return;
  5626. }
  5627. // If a number was passed in, add the unit (except for certain CSS properties)
  5628. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  5629. // "px" to a few hardcoded values.
  5630. if ( type === "number" && !isCustomProp ) {
  5631. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5632. }
  5633. // background-* props affect original clone's values
  5634. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5635. style[ name ] = "inherit";
  5636. }
  5637. // If a hook was provided, use that value, otherwise just set the specified value
  5638. if ( !hooks || !( "set" in hooks ) ||
  5639. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5640. if ( isCustomProp ) {
  5641. style.setProperty( name, value );
  5642. } else {
  5643. style[ name ] = value;
  5644. }
  5645. }
  5646. } else {
  5647. // If a hook was provided get the non-computed value from there
  5648. if ( hooks && "get" in hooks &&
  5649. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5650. return ret;
  5651. }
  5652. // Otherwise just get the value from the style object
  5653. return style[ name ];
  5654. }
  5655. },
  5656. css: function( elem, name, extra, styles ) {
  5657. var val, num, hooks,
  5658. origName = camelCase( name ),
  5659. isCustomProp = rcustomProp.test( name );
  5660. // Make sure that we're working with the right name. We don't
  5661. // want to modify the value if it is a CSS custom property
  5662. // since they are user-defined.
  5663. if ( !isCustomProp ) {
  5664. name = finalPropName( origName );
  5665. }
  5666. // Try prefixed name followed by the unprefixed name
  5667. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5668. // If a hook was provided get the computed value from there
  5669. if ( hooks && "get" in hooks ) {
  5670. val = hooks.get( elem, true, extra );
  5671. }
  5672. // Otherwise, if a way to get the computed value exists, use that
  5673. if ( val === undefined ) {
  5674. val = curCSS( elem, name, styles );
  5675. }
  5676. // Convert "normal" to computed value
  5677. if ( val === "normal" && name in cssNormalTransform ) {
  5678. val = cssNormalTransform[ name ];
  5679. }
  5680. // Make numeric if forced or a qualifier was provided and val looks numeric
  5681. if ( extra === "" || extra ) {
  5682. num = parseFloat( val );
  5683. return extra === true || isFinite( num ) ? num || 0 : val;
  5684. }
  5685. return val;
  5686. }
  5687. } );
  5688. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  5689. jQuery.cssHooks[ dimension ] = {
  5690. get: function( elem, computed, extra ) {
  5691. if ( computed ) {
  5692. // Certain elements can have dimension info if we invisibly show them
  5693. // but it must have a current display style that would benefit
  5694. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5695. // Support: Safari 8+
  5696. // Table columns in Safari have non-zero offsetWidth & zero
  5697. // getBoundingClientRect().width unless display is changed.
  5698. // Support: IE <=11 only
  5699. // Running getBoundingClientRect on a disconnected node
  5700. // in IE throws an error.
  5701. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5702. swap( elem, cssShow, function() {
  5703. return getWidthOrHeight( elem, dimension, extra );
  5704. } ) :
  5705. getWidthOrHeight( elem, dimension, extra );
  5706. }
  5707. },
  5708. set: function( elem, value, extra ) {
  5709. var matches,
  5710. styles = getStyles( elem ),
  5711. // Only read styles.position if the test has a chance to fail
  5712. // to avoid forcing a reflow.
  5713. scrollboxSizeBuggy = !support.scrollboxSize() &&
  5714. styles.position === "absolute",
  5715. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  5716. boxSizingNeeded = scrollboxSizeBuggy || extra,
  5717. isBorderBox = boxSizingNeeded &&
  5718. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5719. subtract = extra ?
  5720. boxModelAdjustment(
  5721. elem,
  5722. dimension,
  5723. extra,
  5724. isBorderBox,
  5725. styles
  5726. ) :
  5727. 0;
  5728. // Account for unreliable border-box dimensions by comparing offset* to computed and
  5729. // faking a content-box to get border and padding (gh-3699)
  5730. if ( isBorderBox && scrollboxSizeBuggy ) {
  5731. subtract -= Math.ceil(
  5732. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5733. parseFloat( styles[ dimension ] ) -
  5734. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  5735. 0.5
  5736. );
  5737. }
  5738. // Convert to pixels if value adjustment is needed
  5739. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5740. ( matches[ 3 ] || "px" ) !== "px" ) {
  5741. elem.style[ dimension ] = value;
  5742. value = jQuery.css( elem, dimension );
  5743. }
  5744. return setPositiveNumber( elem, value, subtract );
  5745. }
  5746. };
  5747. } );
  5748. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5749. function( elem, computed ) {
  5750. if ( computed ) {
  5751. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5752. elem.getBoundingClientRect().left -
  5753. swap( elem, { marginLeft: 0 }, function() {
  5754. return elem.getBoundingClientRect().left;
  5755. } )
  5756. ) + "px";
  5757. }
  5758. }
  5759. );
  5760. // These hooks are used by animate to expand properties
  5761. jQuery.each( {
  5762. margin: "",
  5763. padding: "",
  5764. border: "Width"
  5765. }, function( prefix, suffix ) {
  5766. jQuery.cssHooks[ prefix + suffix ] = {
  5767. expand: function( value ) {
  5768. var i = 0,
  5769. expanded = {},
  5770. // Assumes a single number if not a string
  5771. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5772. for ( ; i < 4; i++ ) {
  5773. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5774. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5775. }
  5776. return expanded;
  5777. }
  5778. };
  5779. if ( prefix !== "margin" ) {
  5780. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5781. }
  5782. } );
  5783. jQuery.fn.extend( {
  5784. css: function( name, value ) {
  5785. return access( this, function( elem, name, value ) {
  5786. var styles, len,
  5787. map = {},
  5788. i = 0;
  5789. if ( Array.isArray( name ) ) {
  5790. styles = getStyles( elem );
  5791. len = name.length;
  5792. for ( ; i < len; i++ ) {
  5793. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5794. }
  5795. return map;
  5796. }
  5797. return value !== undefined ?
  5798. jQuery.style( elem, name, value ) :
  5799. jQuery.css( elem, name );
  5800. }, name, value, arguments.length > 1 );
  5801. }
  5802. } );
  5803. function Tween( elem, options, prop, end, easing ) {
  5804. return new Tween.prototype.init( elem, options, prop, end, easing );
  5805. }
  5806. jQuery.Tween = Tween;
  5807. Tween.prototype = {
  5808. constructor: Tween,
  5809. init: function( elem, options, prop, end, easing, unit ) {
  5810. this.elem = elem;
  5811. this.prop = prop;
  5812. this.easing = easing || jQuery.easing._default;
  5813. this.options = options;
  5814. this.start = this.now = this.cur();
  5815. this.end = end;
  5816. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5817. },
  5818. cur: function() {
  5819. var hooks = Tween.propHooks[ this.prop ];
  5820. return hooks && hooks.get ?
  5821. hooks.get( this ) :
  5822. Tween.propHooks._default.get( this );
  5823. },
  5824. run: function( percent ) {
  5825. var eased,
  5826. hooks = Tween.propHooks[ this.prop ];
  5827. if ( this.options.duration ) {
  5828. this.pos = eased = jQuery.easing[ this.easing ](
  5829. percent, this.options.duration * percent, 0, 1, this.options.duration
  5830. );
  5831. } else {
  5832. this.pos = eased = percent;
  5833. }
  5834. this.now = ( this.end - this.start ) * eased + this.start;
  5835. if ( this.options.step ) {
  5836. this.options.step.call( this.elem, this.now, this );
  5837. }
  5838. if ( hooks && hooks.set ) {
  5839. hooks.set( this );
  5840. } else {
  5841. Tween.propHooks._default.set( this );
  5842. }
  5843. return this;
  5844. }
  5845. };
  5846. Tween.prototype.init.prototype = Tween.prototype;
  5847. Tween.propHooks = {
  5848. _default: {
  5849. get: function( tween ) {
  5850. var result;
  5851. // Use a property on the element directly when it is not a DOM element,
  5852. // or when there is no matching style property that exists.
  5853. if ( tween.elem.nodeType !== 1 ||
  5854. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5855. return tween.elem[ tween.prop ];
  5856. }
  5857. // Passing an empty string as a 3rd parameter to .css will automatically
  5858. // attempt a parseFloat and fallback to a string if the parse fails.
  5859. // Simple values such as "10px" are parsed to Float;
  5860. // complex values such as "rotate(1rad)" are returned as-is.
  5861. result = jQuery.css( tween.elem, tween.prop, "" );
  5862. // Empty strings, null, undefined and "auto" are converted to 0.
  5863. return !result || result === "auto" ? 0 : result;
  5864. },
  5865. set: function( tween ) {
  5866. // Use step hook for back compat.
  5867. // Use cssHook if its there.
  5868. // Use .style if available and use plain properties where available.
  5869. if ( jQuery.fx.step[ tween.prop ] ) {
  5870. jQuery.fx.step[ tween.prop ]( tween );
  5871. } else if ( tween.elem.nodeType === 1 && (
  5872. jQuery.cssHooks[ tween.prop ] ||
  5873. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  5874. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5875. } else {
  5876. tween.elem[ tween.prop ] = tween.now;
  5877. }
  5878. }
  5879. }
  5880. };
  5881. // Support: IE <=9 only
  5882. // Panic based approach to setting things on disconnected nodes
  5883. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5884. set: function( tween ) {
  5885. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5886. tween.elem[ tween.prop ] = tween.now;
  5887. }
  5888. }
  5889. };
  5890. jQuery.easing = {
  5891. linear: function( p ) {
  5892. return p;
  5893. },
  5894. swing: function( p ) {
  5895. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5896. },
  5897. _default: "swing"
  5898. };
  5899. jQuery.fx = Tween.prototype.init;
  5900. // Back compat <1.8 extension point
  5901. jQuery.fx.step = {};
  5902. var
  5903. fxNow, inProgress,
  5904. rfxtypes = /^(?:toggle|show|hide)$/,
  5905. rrun = /queueHooks$/;
  5906. function schedule() {
  5907. if ( inProgress ) {
  5908. if ( document.hidden === false && window.requestAnimationFrame ) {
  5909. window.requestAnimationFrame( schedule );
  5910. } else {
  5911. window.setTimeout( schedule, jQuery.fx.interval );
  5912. }
  5913. jQuery.fx.tick();
  5914. }
  5915. }
  5916. // Animations created synchronously will run synchronously
  5917. function createFxNow() {
  5918. window.setTimeout( function() {
  5919. fxNow = undefined;
  5920. } );
  5921. return ( fxNow = Date.now() );
  5922. }
  5923. // Generate parameters to create a standard animation
  5924. function genFx( type, includeWidth ) {
  5925. var which,
  5926. i = 0,
  5927. attrs = { height: type };
  5928. // If we include width, step value is 1 to do all cssExpand values,
  5929. // otherwise step value is 2 to skip over Left and Right
  5930. includeWidth = includeWidth ? 1 : 0;
  5931. for ( ; i < 4; i += 2 - includeWidth ) {
  5932. which = cssExpand[ i ];
  5933. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5934. }
  5935. if ( includeWidth ) {
  5936. attrs.opacity = attrs.width = type;
  5937. }
  5938. return attrs;
  5939. }
  5940. function createTween( value, prop, animation ) {
  5941. var tween,
  5942. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5943. index = 0,
  5944. length = collection.length;
  5945. for ( ; index < length; index++ ) {
  5946. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5947. // We're done with this property
  5948. return tween;
  5949. }
  5950. }
  5951. }
  5952. function defaultPrefilter( elem, props, opts ) {
  5953. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5954. isBox = "width" in props || "height" in props,
  5955. anim = this,
  5956. orig = {},
  5957. style = elem.style,
  5958. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5959. dataShow = dataPriv.get( elem, "fxshow" );
  5960. // Queue-skipping animations hijack the fx hooks
  5961. if ( !opts.queue ) {
  5962. hooks = jQuery._queueHooks( elem, "fx" );
  5963. if ( hooks.unqueued == null ) {
  5964. hooks.unqueued = 0;
  5965. oldfire = hooks.empty.fire;
  5966. hooks.empty.fire = function() {
  5967. if ( !hooks.unqueued ) {
  5968. oldfire();
  5969. }
  5970. };
  5971. }
  5972. hooks.unqueued++;
  5973. anim.always( function() {
  5974. // Ensure the complete handler is called before this completes
  5975. anim.always( function() {
  5976. hooks.unqueued--;
  5977. if ( !jQuery.queue( elem, "fx" ).length ) {
  5978. hooks.empty.fire();
  5979. }
  5980. } );
  5981. } );
  5982. }
  5983. // Detect show/hide animations
  5984. for ( prop in props ) {
  5985. value = props[ prop ];
  5986. if ( rfxtypes.test( value ) ) {
  5987. delete props[ prop ];
  5988. toggle = toggle || value === "toggle";
  5989. if ( value === ( hidden ? "hide" : "show" ) ) {
  5990. // Pretend to be hidden if this is a "show" and
  5991. // there is still data from a stopped show/hide
  5992. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5993. hidden = true;
  5994. // Ignore all other no-op show/hide data
  5995. } else {
  5996. continue;
  5997. }
  5998. }
  5999. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  6000. }
  6001. }
  6002. // Bail out if this is a no-op like .hide().hide()
  6003. propTween = !jQuery.isEmptyObject( props );
  6004. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  6005. return;
  6006. }
  6007. // Restrict "overflow" and "display" styles during box animations
  6008. if ( isBox && elem.nodeType === 1 ) {
  6009. // Support: IE <=9 - 11, Edge 12 - 15
  6010. // Record all 3 overflow attributes because IE does not infer the shorthand
  6011. // from identically-valued overflowX and overflowY and Edge just mirrors
  6012. // the overflowX value there.
  6013. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  6014. // Identify a display type, preferring old show/hide data over the CSS cascade
  6015. restoreDisplay = dataShow && dataShow.display;
  6016. if ( restoreDisplay == null ) {
  6017. restoreDisplay = dataPriv.get( elem, "display" );
  6018. }
  6019. display = jQuery.css( elem, "display" );
  6020. if ( display === "none" ) {
  6021. if ( restoreDisplay ) {
  6022. display = restoreDisplay;
  6023. } else {
  6024. // Get nonempty value(s) by temporarily forcing visibility
  6025. showHide( [ elem ], true );
  6026. restoreDisplay = elem.style.display || restoreDisplay;
  6027. display = jQuery.css( elem, "display" );
  6028. showHide( [ elem ] );
  6029. }
  6030. }
  6031. // Animate inline elements as inline-block
  6032. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  6033. if ( jQuery.css( elem, "float" ) === "none" ) {
  6034. // Restore the original display value at the end of pure show/hide animations
  6035. if ( !propTween ) {
  6036. anim.done( function() {
  6037. style.display = restoreDisplay;
  6038. } );
  6039. if ( restoreDisplay == null ) {
  6040. display = style.display;
  6041. restoreDisplay = display === "none" ? "" : display;
  6042. }
  6043. }
  6044. style.display = "inline-block";
  6045. }
  6046. }
  6047. }
  6048. if ( opts.overflow ) {
  6049. style.overflow = "hidden";
  6050. anim.always( function() {
  6051. style.overflow = opts.overflow[ 0 ];
  6052. style.overflowX = opts.overflow[ 1 ];
  6053. style.overflowY = opts.overflow[ 2 ];
  6054. } );
  6055. }
  6056. // Implement show/hide animations
  6057. propTween = false;
  6058. for ( prop in orig ) {
  6059. // General show/hide setup for this element animation
  6060. if ( !propTween ) {
  6061. if ( dataShow ) {
  6062. if ( "hidden" in dataShow ) {
  6063. hidden = dataShow.hidden;
  6064. }
  6065. } else {
  6066. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  6067. }
  6068. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  6069. if ( toggle ) {
  6070. dataShow.hidden = !hidden;
  6071. }
  6072. // Show elements before animating them
  6073. if ( hidden ) {
  6074. showHide( [ elem ], true );
  6075. }
  6076. /* eslint-disable no-loop-func */
  6077. anim.done( function() {
  6078. /* eslint-enable no-loop-func */
  6079. // The final step of a "hide" animation is actually hiding the element
  6080. if ( !hidden ) {
  6081. showHide( [ elem ] );
  6082. }
  6083. dataPriv.remove( elem, "fxshow" );
  6084. for ( prop in orig ) {
  6085. jQuery.style( elem, prop, orig[ prop ] );
  6086. }
  6087. } );
  6088. }
  6089. // Per-property setup
  6090. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  6091. if ( !( prop in dataShow ) ) {
  6092. dataShow[ prop ] = propTween.start;
  6093. if ( hidden ) {
  6094. propTween.end = propTween.start;
  6095. propTween.start = 0;
  6096. }
  6097. }
  6098. }
  6099. }
  6100. function propFilter( props, specialEasing ) {
  6101. var index, name, easing, value, hooks;
  6102. // camelCase, specialEasing and expand cssHook pass
  6103. for ( index in props ) {
  6104. name = camelCase( index );
  6105. easing = specialEasing[ name ];
  6106. value = props[ index ];
  6107. if ( Array.isArray( value ) ) {
  6108. easing = value[ 1 ];
  6109. value = props[ index ] = value[ 0 ];
  6110. }
  6111. if ( index !== name ) {
  6112. props[ name ] = value;
  6113. delete props[ index ];
  6114. }
  6115. hooks = jQuery.cssHooks[ name ];
  6116. if ( hooks && "expand" in hooks ) {
  6117. value = hooks.expand( value );
  6118. delete props[ name ];
  6119. // Not quite $.extend, this won't overwrite existing keys.
  6120. // Reusing 'index' because we have the correct "name"
  6121. for ( index in value ) {
  6122. if ( !( index in props ) ) {
  6123. props[ index ] = value[ index ];
  6124. specialEasing[ index ] = easing;
  6125. }
  6126. }
  6127. } else {
  6128. specialEasing[ name ] = easing;
  6129. }
  6130. }
  6131. }
  6132. function Animation( elem, properties, options ) {
  6133. var result,
  6134. stopped,
  6135. index = 0,
  6136. length = Animation.prefilters.length,
  6137. deferred = jQuery.Deferred().always( function() {
  6138. // Don't match elem in the :animated selector
  6139. delete tick.elem;
  6140. } ),
  6141. tick = function() {
  6142. if ( stopped ) {
  6143. return false;
  6144. }
  6145. var currentTime = fxNow || createFxNow(),
  6146. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6147. // Support: Android 2.3 only
  6148. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  6149. temp = remaining / animation.duration || 0,
  6150. percent = 1 - temp,
  6151. index = 0,
  6152. length = animation.tweens.length;
  6153. for ( ; index < length; index++ ) {
  6154. animation.tweens[ index ].run( percent );
  6155. }
  6156. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  6157. // If there's more to do, yield
  6158. if ( percent < 1 && length ) {
  6159. return remaining;
  6160. }
  6161. // If this was an empty animation, synthesize a final progress notification
  6162. if ( !length ) {
  6163. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6164. }
  6165. // Resolve the animation and report its conclusion
  6166. deferred.resolveWith( elem, [ animation ] );
  6167. return false;
  6168. },
  6169. animation = deferred.promise( {
  6170. elem: elem,
  6171. props: jQuery.extend( {}, properties ),
  6172. opts: jQuery.extend( true, {
  6173. specialEasing: {},
  6174. easing: jQuery.easing._default
  6175. }, options ),
  6176. originalProperties: properties,
  6177. originalOptions: options,
  6178. startTime: fxNow || createFxNow(),
  6179. duration: options.duration,
  6180. tweens: [],
  6181. createTween: function( prop, end ) {
  6182. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6183. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6184. animation.tweens.push( tween );
  6185. return tween;
  6186. },
  6187. stop: function( gotoEnd ) {
  6188. var index = 0,
  6189. // If we are going to the end, we want to run all the tweens
  6190. // otherwise we skip this part
  6191. length = gotoEnd ? animation.tweens.length : 0;
  6192. if ( stopped ) {
  6193. return this;
  6194. }
  6195. stopped = true;
  6196. for ( ; index < length; index++ ) {
  6197. animation.tweens[ index ].run( 1 );
  6198. }
  6199. // Resolve when we played the last frame; otherwise, reject
  6200. if ( gotoEnd ) {
  6201. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6202. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6203. } else {
  6204. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6205. }
  6206. return this;
  6207. }
  6208. } ),
  6209. props = animation.props;
  6210. propFilter( props, animation.opts.specialEasing );
  6211. for ( ; index < length; index++ ) {
  6212. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  6213. if ( result ) {
  6214. if ( isFunction( result.stop ) ) {
  6215. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  6216. result.stop.bind( result );
  6217. }
  6218. return result;
  6219. }
  6220. }
  6221. jQuery.map( props, createTween, animation );
  6222. if ( isFunction( animation.opts.start ) ) {
  6223. animation.opts.start.call( elem, animation );
  6224. }
  6225. // Attach callbacks from options
  6226. animation
  6227. .progress( animation.opts.progress )
  6228. .done( animation.opts.done, animation.opts.complete )
  6229. .fail( animation.opts.fail )
  6230. .always( animation.opts.always );
  6231. jQuery.fx.timer(
  6232. jQuery.extend( tick, {
  6233. elem: elem,
  6234. anim: animation,
  6235. queue: animation.opts.queue
  6236. } )
  6237. );
  6238. return animation;
  6239. }
  6240. jQuery.Animation = jQuery.extend( Animation, {
  6241. tweeners: {
  6242. "*": [ function( prop, value ) {
  6243. var tween = this.createTween( prop, value );
  6244. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  6245. return tween;
  6246. } ]
  6247. },
  6248. tweener: function( props, callback ) {
  6249. if ( isFunction( props ) ) {
  6250. callback = props;
  6251. props = [ "*" ];
  6252. } else {
  6253. props = props.match( rnothtmlwhite );
  6254. }
  6255. var prop,
  6256. index = 0,
  6257. length = props.length;
  6258. for ( ; index < length; index++ ) {
  6259. prop = props[ index ];
  6260. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  6261. Animation.tweeners[ prop ].unshift( callback );
  6262. }
  6263. },
  6264. prefilters: [ defaultPrefilter ],
  6265. prefilter: function( callback, prepend ) {
  6266. if ( prepend ) {
  6267. Animation.prefilters.unshift( callback );
  6268. } else {
  6269. Animation.prefilters.push( callback );
  6270. }
  6271. }
  6272. } );
  6273. jQuery.speed = function( speed, easing, fn ) {
  6274. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6275. complete: fn || !fn && easing ||
  6276. isFunction( speed ) && speed,
  6277. duration: speed,
  6278. easing: fn && easing || easing && !isFunction( easing ) && easing
  6279. };
  6280. // Go to the end state if fx are off
  6281. if ( jQuery.fx.off ) {
  6282. opt.duration = 0;
  6283. } else {
  6284. if ( typeof opt.duration !== "number" ) {
  6285. if ( opt.duration in jQuery.fx.speeds ) {
  6286. opt.duration = jQuery.fx.speeds[ opt.duration ];
  6287. } else {
  6288. opt.duration = jQuery.fx.speeds._default;
  6289. }
  6290. }
  6291. }
  6292. // Normalize opt.queue - true/undefined/null -> "fx"
  6293. if ( opt.queue == null || opt.queue === true ) {
  6294. opt.queue = "fx";
  6295. }
  6296. // Queueing
  6297. opt.old = opt.complete;
  6298. opt.complete = function() {
  6299. if ( isFunction( opt.old ) ) {
  6300. opt.old.call( this );
  6301. }
  6302. if ( opt.queue ) {
  6303. jQuery.dequeue( this, opt.queue );
  6304. }
  6305. };
  6306. return opt;
  6307. };
  6308. jQuery.fn.extend( {
  6309. fadeTo: function( speed, to, easing, callback ) {
  6310. // Show any hidden elements after setting opacity to 0
  6311. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6312. // Animate to the value specified
  6313. .end().animate( { opacity: to }, speed, easing, callback );
  6314. },
  6315. animate: function( prop, speed, easing, callback ) {
  6316. var empty = jQuery.isEmptyObject( prop ),
  6317. optall = jQuery.speed( speed, easing, callback ),
  6318. doAnimation = function() {
  6319. // Operate on a copy of prop so per-property easing won't be lost
  6320. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6321. // Empty animations, or finishing resolves immediately
  6322. if ( empty || dataPriv.get( this, "finish" ) ) {
  6323. anim.stop( true );
  6324. }
  6325. };
  6326. doAnimation.finish = doAnimation;
  6327. return empty || optall.queue === false ?
  6328. this.each( doAnimation ) :
  6329. this.queue( optall.queue, doAnimation );
  6330. },
  6331. stop: function( type, clearQueue, gotoEnd ) {
  6332. var stopQueue = function( hooks ) {
  6333. var stop = hooks.stop;
  6334. delete hooks.stop;
  6335. stop( gotoEnd );
  6336. };
  6337. if ( typeof type !== "string" ) {
  6338. gotoEnd = clearQueue;
  6339. clearQueue = type;
  6340. type = undefined;
  6341. }
  6342. if ( clearQueue ) {
  6343. this.queue( type || "fx", [] );
  6344. }
  6345. return this.each( function() {
  6346. var dequeue = true,
  6347. index = type != null && type + "queueHooks",
  6348. timers = jQuery.timers,
  6349. data = dataPriv.get( this );
  6350. if ( index ) {
  6351. if ( data[ index ] && data[ index ].stop ) {
  6352. stopQueue( data[ index ] );
  6353. }
  6354. } else {
  6355. for ( index in data ) {
  6356. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6357. stopQueue( data[ index ] );
  6358. }
  6359. }
  6360. }
  6361. for ( index = timers.length; index--; ) {
  6362. if ( timers[ index ].elem === this &&
  6363. ( type == null || timers[ index ].queue === type ) ) {
  6364. timers[ index ].anim.stop( gotoEnd );
  6365. dequeue = false;
  6366. timers.splice( index, 1 );
  6367. }
  6368. }
  6369. // Start the next in the queue if the last step wasn't forced.
  6370. // Timers currently will call their complete callbacks, which
  6371. // will dequeue but only if they were gotoEnd.
  6372. if ( dequeue || !gotoEnd ) {
  6373. jQuery.dequeue( this, type );
  6374. }
  6375. } );
  6376. },
  6377. finish: function( type ) {
  6378. if ( type !== false ) {
  6379. type = type || "fx";
  6380. }
  6381. return this.each( function() {
  6382. var index,
  6383. data = dataPriv.get( this ),
  6384. queue = data[ type + "queue" ],
  6385. hooks = data[ type + "queueHooks" ],
  6386. timers = jQuery.timers,
  6387. length = queue ? queue.length : 0;
  6388. // Enable finishing flag on private data
  6389. data.finish = true;
  6390. // Empty the queue first
  6391. jQuery.queue( this, type, [] );
  6392. if ( hooks && hooks.stop ) {
  6393. hooks.stop.call( this, true );
  6394. }
  6395. // Look for any active animations, and finish them
  6396. for ( index = timers.length; index--; ) {
  6397. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6398. timers[ index ].anim.stop( true );
  6399. timers.splice( index, 1 );
  6400. }
  6401. }
  6402. // Look for any animations in the old queue and finish them
  6403. for ( index = 0; index < length; index++ ) {
  6404. if ( queue[ index ] && queue[ index ].finish ) {
  6405. queue[ index ].finish.call( this );
  6406. }
  6407. }
  6408. // Turn off finishing flag
  6409. delete data.finish;
  6410. } );
  6411. }
  6412. } );
  6413. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  6414. var cssFn = jQuery.fn[ name ];
  6415. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6416. return speed == null || typeof speed === "boolean" ?
  6417. cssFn.apply( this, arguments ) :
  6418. this.animate( genFx( name, true ), speed, easing, callback );
  6419. };
  6420. } );
  6421. // Generate shortcuts for custom animations
  6422. jQuery.each( {
  6423. slideDown: genFx( "show" ),
  6424. slideUp: genFx( "hide" ),
  6425. slideToggle: genFx( "toggle" ),
  6426. fadeIn: { opacity: "show" },
  6427. fadeOut: { opacity: "hide" },
  6428. fadeToggle: { opacity: "toggle" }
  6429. }, function( name, props ) {
  6430. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6431. return this.animate( props, speed, easing, callback );
  6432. };
  6433. } );
  6434. jQuery.timers = [];
  6435. jQuery.fx.tick = function() {
  6436. var timer,
  6437. i = 0,
  6438. timers = jQuery.timers;
  6439. fxNow = Date.now();
  6440. for ( ; i < timers.length; i++ ) {
  6441. timer = timers[ i ];
  6442. // Run the timer and safely remove it when done (allowing for external removal)
  6443. if ( !timer() && timers[ i ] === timer ) {
  6444. timers.splice( i--, 1 );
  6445. }
  6446. }
  6447. if ( !timers.length ) {
  6448. jQuery.fx.stop();
  6449. }
  6450. fxNow = undefined;
  6451. };
  6452. jQuery.fx.timer = function( timer ) {
  6453. jQuery.timers.push( timer );
  6454. jQuery.fx.start();
  6455. };
  6456. jQuery.fx.interval = 13;
  6457. jQuery.fx.start = function() {
  6458. if ( inProgress ) {
  6459. return;
  6460. }
  6461. inProgress = true;
  6462. schedule();
  6463. };
  6464. jQuery.fx.stop = function() {
  6465. inProgress = null;
  6466. };
  6467. jQuery.fx.speeds = {
  6468. slow: 600,
  6469. fast: 200,
  6470. // Default speed
  6471. _default: 400
  6472. };
  6473. // Based off of the plugin by Clint Helfers, with permission.
  6474. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  6475. jQuery.fn.delay = function( time, type ) {
  6476. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6477. type = type || "fx";
  6478. return this.queue( type, function( next, hooks ) {
  6479. var timeout = window.setTimeout( next, time );
  6480. hooks.stop = function() {
  6481. window.clearTimeout( timeout );
  6482. };
  6483. } );
  6484. };
  6485. ( function() {
  6486. var input = document.createElement( "input" ),
  6487. select = document.createElement( "select" ),
  6488. opt = select.appendChild( document.createElement( "option" ) );
  6489. input.type = "checkbox";
  6490. // Support: Android <=4.3 only
  6491. // Default value for a checkbox should be "on"
  6492. support.checkOn = input.value !== "";
  6493. // Support: IE <=11 only
  6494. // Must access selectedIndex to make default options select
  6495. support.optSelected = opt.selected;
  6496. // Support: IE <=11 only
  6497. // An input loses its value after becoming a radio
  6498. input = document.createElement( "input" );
  6499. input.value = "t";
  6500. input.type = "radio";
  6501. support.radioValue = input.value === "t";
  6502. } )();
  6503. var boolHook,
  6504. attrHandle = jQuery.expr.attrHandle;
  6505. jQuery.fn.extend( {
  6506. attr: function( name, value ) {
  6507. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6508. },
  6509. removeAttr: function( name ) {
  6510. return this.each( function() {
  6511. jQuery.removeAttr( this, name );
  6512. } );
  6513. }
  6514. } );
  6515. jQuery.extend( {
  6516. attr: function( elem, name, value ) {
  6517. var ret, hooks,
  6518. nType = elem.nodeType;
  6519. // Don't get/set attributes on text, comment and attribute nodes
  6520. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6521. return;
  6522. }
  6523. // Fallback to prop when attributes are not supported
  6524. if ( typeof elem.getAttribute === "undefined" ) {
  6525. return jQuery.prop( elem, name, value );
  6526. }
  6527. // Attribute hooks are determined by the lowercase version
  6528. // Grab necessary hook if one is defined
  6529. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6530. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6531. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6532. }
  6533. if ( value !== undefined ) {
  6534. if ( value === null ) {
  6535. jQuery.removeAttr( elem, name );
  6536. return;
  6537. }
  6538. if ( hooks && "set" in hooks &&
  6539. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6540. return ret;
  6541. }
  6542. elem.setAttribute( name, value + "" );
  6543. return value;
  6544. }
  6545. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6546. return ret;
  6547. }
  6548. ret = jQuery.find.attr( elem, name );
  6549. // Non-existent attributes return null, we normalize to undefined
  6550. return ret == null ? undefined : ret;
  6551. },
  6552. attrHooks: {
  6553. type: {
  6554. set: function( elem, value ) {
  6555. if ( !support.radioValue && value === "radio" &&
  6556. nodeName( elem, "input" ) ) {
  6557. var val = elem.value;
  6558. elem.setAttribute( "type", value );
  6559. if ( val ) {
  6560. elem.value = val;
  6561. }
  6562. return value;
  6563. }
  6564. }
  6565. }
  6566. },
  6567. removeAttr: function( elem, value ) {
  6568. var name,
  6569. i = 0,
  6570. // Attribute names can contain non-HTML whitespace characters
  6571. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6572. attrNames = value && value.match( rnothtmlwhite );
  6573. if ( attrNames && elem.nodeType === 1 ) {
  6574. while ( ( name = attrNames[ i++ ] ) ) {
  6575. elem.removeAttribute( name );
  6576. }
  6577. }
  6578. }
  6579. } );
  6580. // Hooks for boolean attributes
  6581. boolHook = {
  6582. set: function( elem, value, name ) {
  6583. if ( value === false ) {
  6584. // Remove boolean attributes when set to false
  6585. jQuery.removeAttr( elem, name );
  6586. } else {
  6587. elem.setAttribute( name, name );
  6588. }
  6589. return name;
  6590. }
  6591. };
  6592. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  6593. var getter = attrHandle[ name ] || jQuery.find.attr;
  6594. attrHandle[ name ] = function( elem, name, isXML ) {
  6595. var ret, handle,
  6596. lowercaseName = name.toLowerCase();
  6597. if ( !isXML ) {
  6598. // Avoid an infinite loop by temporarily removing this function from the getter
  6599. handle = attrHandle[ lowercaseName ];
  6600. attrHandle[ lowercaseName ] = ret;
  6601. ret = getter( elem, name, isXML ) != null ?
  6602. lowercaseName :
  6603. null;
  6604. attrHandle[ lowercaseName ] = handle;
  6605. }
  6606. return ret;
  6607. };
  6608. } );
  6609. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6610. rclickable = /^(?:a|area)$/i;
  6611. jQuery.fn.extend( {
  6612. prop: function( name, value ) {
  6613. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6614. },
  6615. removeProp: function( name ) {
  6616. return this.each( function() {
  6617. delete this[ jQuery.propFix[ name ] || name ];
  6618. } );
  6619. }
  6620. } );
  6621. jQuery.extend( {
  6622. prop: function( elem, name, value ) {
  6623. var ret, hooks,
  6624. nType = elem.nodeType;
  6625. // Don't get/set properties on text, comment and attribute nodes
  6626. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6627. return;
  6628. }
  6629. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6630. // Fix name and attach hooks
  6631. name = jQuery.propFix[ name ] || name;
  6632. hooks = jQuery.propHooks[ name ];
  6633. }
  6634. if ( value !== undefined ) {
  6635. if ( hooks && "set" in hooks &&
  6636. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6637. return ret;
  6638. }
  6639. return ( elem[ name ] = value );
  6640. }
  6641. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6642. return ret;
  6643. }
  6644. return elem[ name ];
  6645. },
  6646. propHooks: {
  6647. tabIndex: {
  6648. get: function( elem ) {
  6649. // Support: IE <=9 - 11 only
  6650. // elem.tabIndex doesn't always return the
  6651. // correct value when it hasn't been explicitly set
  6652. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  6653. // Use proper attribute retrieval(#12072)
  6654. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6655. if ( tabindex ) {
  6656. return parseInt( tabindex, 10 );
  6657. }
  6658. if (
  6659. rfocusable.test( elem.nodeName ) ||
  6660. rclickable.test( elem.nodeName ) &&
  6661. elem.href
  6662. ) {
  6663. return 0;
  6664. }
  6665. return -1;
  6666. }
  6667. }
  6668. },
  6669. propFix: {
  6670. "for": "htmlFor",
  6671. "class": "className"
  6672. }
  6673. } );
  6674. // Support: IE <=11 only
  6675. // Accessing the selectedIndex property
  6676. // forces the browser to respect setting selected
  6677. // on the option
  6678. // The getter ensures a default option is selected
  6679. // when in an optgroup
  6680. // eslint rule "no-unused-expressions" is disabled for this code
  6681. // since it considers such accessions noop
  6682. if ( !support.optSelected ) {
  6683. jQuery.propHooks.selected = {
  6684. get: function( elem ) {
  6685. /* eslint no-unused-expressions: "off" */
  6686. var parent = elem.parentNode;
  6687. if ( parent && parent.parentNode ) {
  6688. parent.parentNode.selectedIndex;
  6689. }
  6690. return null;
  6691. },
  6692. set: function( elem ) {
  6693. /* eslint no-unused-expressions: "off" */
  6694. var parent = elem.parentNode;
  6695. if ( parent ) {
  6696. parent.selectedIndex;
  6697. if ( parent.parentNode ) {
  6698. parent.parentNode.selectedIndex;
  6699. }
  6700. }
  6701. }
  6702. };
  6703. }
  6704. jQuery.each( [
  6705. "tabIndex",
  6706. "readOnly",
  6707. "maxLength",
  6708. "cellSpacing",
  6709. "cellPadding",
  6710. "rowSpan",
  6711. "colSpan",
  6712. "useMap",
  6713. "frameBorder",
  6714. "contentEditable"
  6715. ], function() {
  6716. jQuery.propFix[ this.toLowerCase() ] = this;
  6717. } );
  6718. // Strip and collapse whitespace according to HTML spec
  6719. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  6720. function stripAndCollapse( value ) {
  6721. var tokens = value.match( rnothtmlwhite ) || [];
  6722. return tokens.join( " " );
  6723. }
  6724. function getClass( elem ) {
  6725. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6726. }
  6727. function classesToArray( value ) {
  6728. if ( Array.isArray( value ) ) {
  6729. return value;
  6730. }
  6731. if ( typeof value === "string" ) {
  6732. return value.match( rnothtmlwhite ) || [];
  6733. }
  6734. return [];
  6735. }
  6736. jQuery.fn.extend( {
  6737. addClass: function( value ) {
  6738. var classes, elem, cur, curValue, clazz, j, finalValue,
  6739. i = 0;
  6740. if ( isFunction( value ) ) {
  6741. return this.each( function( j ) {
  6742. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6743. } );
  6744. }
  6745. classes = classesToArray( value );
  6746. if ( classes.length ) {
  6747. while ( ( elem = this[ i++ ] ) ) {
  6748. curValue = getClass( elem );
  6749. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6750. if ( cur ) {
  6751. j = 0;
  6752. while ( ( clazz = classes[ j++ ] ) ) {
  6753. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6754. cur += clazz + " ";
  6755. }
  6756. }
  6757. // Only assign if different to avoid unneeded rendering.
  6758. finalValue = stripAndCollapse( cur );
  6759. if ( curValue !== finalValue ) {
  6760. elem.setAttribute( "class", finalValue );
  6761. }
  6762. }
  6763. }
  6764. }
  6765. return this;
  6766. },
  6767. removeClass: function( value ) {
  6768. var classes, elem, cur, curValue, clazz, j, finalValue,
  6769. i = 0;
  6770. if ( isFunction( value ) ) {
  6771. return this.each( function( j ) {
  6772. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6773. } );
  6774. }
  6775. if ( !arguments.length ) {
  6776. return this.attr( "class", "" );
  6777. }
  6778. classes = classesToArray( value );
  6779. if ( classes.length ) {
  6780. while ( ( elem = this[ i++ ] ) ) {
  6781. curValue = getClass( elem );
  6782. // This expression is here for better compressibility (see addClass)
  6783. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6784. if ( cur ) {
  6785. j = 0;
  6786. while ( ( clazz = classes[ j++ ] ) ) {
  6787. // Remove *all* instances
  6788. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  6789. cur = cur.replace( " " + clazz + " ", " " );
  6790. }
  6791. }
  6792. // Only assign if different to avoid unneeded rendering.
  6793. finalValue = stripAndCollapse( cur );
  6794. if ( curValue !== finalValue ) {
  6795. elem.setAttribute( "class", finalValue );
  6796. }
  6797. }
  6798. }
  6799. }
  6800. return this;
  6801. },
  6802. toggleClass: function( value, stateVal ) {
  6803. var type = typeof value,
  6804. isValidValue = type === "string" || Array.isArray( value );
  6805. if ( typeof stateVal === "boolean" && isValidValue ) {
  6806. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6807. }
  6808. if ( isFunction( value ) ) {
  6809. return this.each( function( i ) {
  6810. jQuery( this ).toggleClass(
  6811. value.call( this, i, getClass( this ), stateVal ),
  6812. stateVal
  6813. );
  6814. } );
  6815. }
  6816. return this.each( function() {
  6817. var className, i, self, classNames;
  6818. if ( isValidValue ) {
  6819. // Toggle individual class names
  6820. i = 0;
  6821. self = jQuery( this );
  6822. classNames = classesToArray( value );
  6823. while ( ( className = classNames[ i++ ] ) ) {
  6824. // Check each className given, space separated list
  6825. if ( self.hasClass( className ) ) {
  6826. self.removeClass( className );
  6827. } else {
  6828. self.addClass( className );
  6829. }
  6830. }
  6831. // Toggle whole class name
  6832. } else if ( value === undefined || type === "boolean" ) {
  6833. className = getClass( this );
  6834. if ( className ) {
  6835. // Store className if set
  6836. dataPriv.set( this, "__className__", className );
  6837. }
  6838. // If the element has a class name or if we're passed `false`,
  6839. // then remove the whole classname (if there was one, the above saved it).
  6840. // Otherwise bring back whatever was previously saved (if anything),
  6841. // falling back to the empty string if nothing was stored.
  6842. if ( this.setAttribute ) {
  6843. this.setAttribute( "class",
  6844. className || value === false ?
  6845. "" :
  6846. dataPriv.get( this, "__className__" ) || ""
  6847. );
  6848. }
  6849. }
  6850. } );
  6851. },
  6852. hasClass: function( selector ) {
  6853. var className, elem,
  6854. i = 0;
  6855. className = " " + selector + " ";
  6856. while ( ( elem = this[ i++ ] ) ) {
  6857. if ( elem.nodeType === 1 &&
  6858. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6859. return true;
  6860. }
  6861. }
  6862. return false;
  6863. }
  6864. } );
  6865. var rreturn = /\r/g;
  6866. jQuery.fn.extend( {
  6867. val: function( value ) {
  6868. var hooks, ret, valueIsFunction,
  6869. elem = this[ 0 ];
  6870. if ( !arguments.length ) {
  6871. if ( elem ) {
  6872. hooks = jQuery.valHooks[ elem.type ] ||
  6873. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6874. if ( hooks &&
  6875. "get" in hooks &&
  6876. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6877. ) {
  6878. return ret;
  6879. }
  6880. ret = elem.value;
  6881. // Handle most common string cases
  6882. if ( typeof ret === "string" ) {
  6883. return ret.replace( rreturn, "" );
  6884. }
  6885. // Handle cases where value is null/undef or number
  6886. return ret == null ? "" : ret;
  6887. }
  6888. return;
  6889. }
  6890. valueIsFunction = isFunction( value );
  6891. return this.each( function( i ) {
  6892. var val;
  6893. if ( this.nodeType !== 1 ) {
  6894. return;
  6895. }
  6896. if ( valueIsFunction ) {
  6897. val = value.call( this, i, jQuery( this ).val() );
  6898. } else {
  6899. val = value;
  6900. }
  6901. // Treat null/undefined as ""; convert numbers to string
  6902. if ( val == null ) {
  6903. val = "";
  6904. } else if ( typeof val === "number" ) {
  6905. val += "";
  6906. } else if ( Array.isArray( val ) ) {
  6907. val = jQuery.map( val, function( value ) {
  6908. return value == null ? "" : value + "";
  6909. } );
  6910. }
  6911. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6912. // If set returns undefined, fall back to normal setting
  6913. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6914. this.value = val;
  6915. }
  6916. } );
  6917. }
  6918. } );
  6919. jQuery.extend( {
  6920. valHooks: {
  6921. option: {
  6922. get: function( elem ) {
  6923. var val = jQuery.find.attr( elem, "value" );
  6924. return val != null ?
  6925. val :
  6926. // Support: IE <=10 - 11 only
  6927. // option.text throws exceptions (#14686, #14858)
  6928. // Strip and collapse whitespace
  6929. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6930. stripAndCollapse( jQuery.text( elem ) );
  6931. }
  6932. },
  6933. select: {
  6934. get: function( elem ) {
  6935. var value, option, i,
  6936. options = elem.options,
  6937. index = elem.selectedIndex,
  6938. one = elem.type === "select-one",
  6939. values = one ? null : [],
  6940. max = one ? index + 1 : options.length;
  6941. if ( index < 0 ) {
  6942. i = max;
  6943. } else {
  6944. i = one ? index : 0;
  6945. }
  6946. // Loop through all the selected options
  6947. for ( ; i < max; i++ ) {
  6948. option = options[ i ];
  6949. // Support: IE <=9 only
  6950. // IE8-9 doesn't update selected after form reset (#2551)
  6951. if ( ( option.selected || i === index ) &&
  6952. // Don't return options that are disabled or in a disabled optgroup
  6953. !option.disabled &&
  6954. ( !option.parentNode.disabled ||
  6955. !nodeName( option.parentNode, "optgroup" ) ) ) {
  6956. // Get the specific value for the option
  6957. value = jQuery( option ).val();
  6958. // We don't need an array for one selects
  6959. if ( one ) {
  6960. return value;
  6961. }
  6962. // Multi-Selects return an array
  6963. values.push( value );
  6964. }
  6965. }
  6966. return values;
  6967. },
  6968. set: function( elem, value ) {
  6969. var optionSet, option,
  6970. options = elem.options,
  6971. values = jQuery.makeArray( value ),
  6972. i = options.length;
  6973. while ( i-- ) {
  6974. option = options[ i ];
  6975. /* eslint-disable no-cond-assign */
  6976. if ( option.selected =
  6977. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6978. ) {
  6979. optionSet = true;
  6980. }
  6981. /* eslint-enable no-cond-assign */
  6982. }
  6983. // Force browsers to behave consistently when non-matching value is set
  6984. if ( !optionSet ) {
  6985. elem.selectedIndex = -1;
  6986. }
  6987. return values;
  6988. }
  6989. }
  6990. }
  6991. } );
  6992. // Radios and checkboxes getter/setter
  6993. jQuery.each( [ "radio", "checkbox" ], function() {
  6994. jQuery.valHooks[ this ] = {
  6995. set: function( elem, value ) {
  6996. if ( Array.isArray( value ) ) {
  6997. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6998. }
  6999. }
  7000. };
  7001. if ( !support.checkOn ) {
  7002. jQuery.valHooks[ this ].get = function( elem ) {
  7003. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  7004. };
  7005. }
  7006. } );
  7007. // Return jQuery for attributes-only inclusion
  7008. support.focusin = "onfocusin" in window;
  7009. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7010. stopPropagationCallback = function( e ) {
  7011. e.stopPropagation();
  7012. };
  7013. jQuery.extend( jQuery.event, {
  7014. trigger: function( event, data, elem, onlyHandlers ) {
  7015. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7016. eventPath = [ elem || document ],
  7017. type = hasOwn.call( event, "type" ) ? event.type : event,
  7018. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7019. cur = lastElement = tmp = elem = elem || document;
  7020. // Don't do events on text and comment nodes
  7021. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7022. return;
  7023. }
  7024. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7025. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7026. return;
  7027. }
  7028. if ( type.indexOf( "." ) > -1 ) {
  7029. // Namespaced trigger; create a regexp to match event type in handle()
  7030. namespaces = type.split( "." );
  7031. type = namespaces.shift();
  7032. namespaces.sort();
  7033. }
  7034. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7035. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7036. event = event[ jQuery.expando ] ?
  7037. event :
  7038. new jQuery.Event( type, typeof event === "object" && event );
  7039. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7040. event.isTrigger = onlyHandlers ? 2 : 3;
  7041. event.namespace = namespaces.join( "." );
  7042. event.rnamespace = event.namespace ?
  7043. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7044. null;
  7045. // Clean up the event in case it is being reused
  7046. event.result = undefined;
  7047. if ( !event.target ) {
  7048. event.target = elem;
  7049. }
  7050. // Clone any incoming data and prepend the event, creating the handler arg list
  7051. data = data == null ?
  7052. [ event ] :
  7053. jQuery.makeArray( data, [ event ] );
  7054. // Allow special events to draw outside the lines
  7055. special = jQuery.event.special[ type ] || {};
  7056. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  7057. return;
  7058. }
  7059. // Determine event propagation path in advance, per W3C events spec (#9951)
  7060. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  7061. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  7062. bubbleType = special.delegateType || type;
  7063. if ( !rfocusMorph.test( bubbleType + type ) ) {
  7064. cur = cur.parentNode;
  7065. }
  7066. for ( ; cur; cur = cur.parentNode ) {
  7067. eventPath.push( cur );
  7068. tmp = cur;
  7069. }
  7070. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  7071. if ( tmp === ( elem.ownerDocument || document ) ) {
  7072. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  7073. }
  7074. }
  7075. // Fire handlers on the event path
  7076. i = 0;
  7077. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  7078. lastElement = cur;
  7079. event.type = i > 1 ?
  7080. bubbleType :
  7081. special.bindType || type;
  7082. // jQuery handler
  7083. handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
  7084. dataPriv.get( cur, "handle" );
  7085. if ( handle ) {
  7086. handle.apply( cur, data );
  7087. }
  7088. // Native handler
  7089. handle = ontype && cur[ ontype ];
  7090. if ( handle && handle.apply && acceptData( cur ) ) {
  7091. event.result = handle.apply( cur, data );
  7092. if ( event.result === false ) {
  7093. event.preventDefault();
  7094. }
  7095. }
  7096. }
  7097. event.type = type;
  7098. // If nobody prevented the default action, do it now
  7099. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7100. if ( ( !special._default ||
  7101. special._default.apply( eventPath.pop(), data ) === false ) &&
  7102. acceptData( elem ) ) {
  7103. // Call a native DOM method on the target with the same name as the event.
  7104. // Don't do default actions on window, that's where global variables be (#6170)
  7105. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7106. // Don't re-trigger an onFOO event when we call its FOO() method
  7107. tmp = elem[ ontype ];
  7108. if ( tmp ) {
  7109. elem[ ontype ] = null;
  7110. }
  7111. // Prevent re-triggering of the same event, since we already bubbled it above
  7112. jQuery.event.triggered = type;
  7113. if ( event.isPropagationStopped() ) {
  7114. lastElement.addEventListener( type, stopPropagationCallback );
  7115. }
  7116. elem[ type ]();
  7117. if ( event.isPropagationStopped() ) {
  7118. lastElement.removeEventListener( type, stopPropagationCallback );
  7119. }
  7120. jQuery.event.triggered = undefined;
  7121. if ( tmp ) {
  7122. elem[ ontype ] = tmp;
  7123. }
  7124. }
  7125. }
  7126. }
  7127. return event.result;
  7128. },
  7129. // Piggyback on a donor event to simulate a different one
  7130. // Used only for `focus(in | out)` events
  7131. simulate: function( type, elem, event ) {
  7132. var e = jQuery.extend(
  7133. new jQuery.Event(),
  7134. event,
  7135. {
  7136. type: type,
  7137. isSimulated: true
  7138. }
  7139. );
  7140. jQuery.event.trigger( e, null, elem );
  7141. }
  7142. } );
  7143. jQuery.fn.extend( {
  7144. trigger: function( type, data ) {
  7145. return this.each( function() {
  7146. jQuery.event.trigger( type, data, this );
  7147. } );
  7148. },
  7149. triggerHandler: function( type, data ) {
  7150. var elem = this[ 0 ];
  7151. if ( elem ) {
  7152. return jQuery.event.trigger( type, data, elem, true );
  7153. }
  7154. }
  7155. } );
  7156. // Support: Firefox <=44
  7157. // Firefox doesn't have focus(in | out) events
  7158. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  7159. //
  7160. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  7161. // focus(in | out) events fire after focus & blur events,
  7162. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  7163. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  7164. if ( !support.focusin ) {
  7165. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  7166. // Attach a single capturing handler on the document while someone wants focusin/focusout
  7167. var handler = function( event ) {
  7168. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  7169. };
  7170. jQuery.event.special[ fix ] = {
  7171. setup: function() {
  7172. // Handle: regular nodes (via `this.ownerDocument`), window
  7173. // (via `this.document`) & document (via `this`).
  7174. var doc = this.ownerDocument || this.document || this,
  7175. attaches = dataPriv.access( doc, fix );
  7176. if ( !attaches ) {
  7177. doc.addEventListener( orig, handler, true );
  7178. }
  7179. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  7180. },
  7181. teardown: function() {
  7182. var doc = this.ownerDocument || this.document || this,
  7183. attaches = dataPriv.access( doc, fix ) - 1;
  7184. if ( !attaches ) {
  7185. doc.removeEventListener( orig, handler, true );
  7186. dataPriv.remove( doc, fix );
  7187. } else {
  7188. dataPriv.access( doc, fix, attaches );
  7189. }
  7190. }
  7191. };
  7192. } );
  7193. }
  7194. var location = window.location;
  7195. var nonce = { guid: Date.now() };
  7196. var rquery = ( /\?/ );
  7197. // Cross-browser xml parsing
  7198. jQuery.parseXML = function( data ) {
  7199. var xml, parserErrorElem;
  7200. if ( !data || typeof data !== "string" ) {
  7201. return null;
  7202. }
  7203. // Support: IE 9 - 11 only
  7204. // IE throws on parseFromString with invalid input.
  7205. try {
  7206. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  7207. } catch ( e ) {}
  7208. parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
  7209. if ( !xml || parserErrorElem ) {
  7210. jQuery.error( "Invalid XML: " + (
  7211. parserErrorElem ?
  7212. jQuery.map( parserErrorElem.childNodes, function( el ) {
  7213. return el.textContent;
  7214. } ).join( "\n" ) :
  7215. data
  7216. ) );
  7217. }
  7218. return xml;
  7219. };
  7220. var
  7221. rbracket = /\[\]$/,
  7222. rCRLF = /\r?\n/g,
  7223. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7224. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7225. function buildParams( prefix, obj, traditional, add ) {
  7226. var name;
  7227. if ( Array.isArray( obj ) ) {
  7228. // Serialize array item.
  7229. jQuery.each( obj, function( i, v ) {
  7230. if ( traditional || rbracket.test( prefix ) ) {
  7231. // Treat each array item as a scalar.
  7232. add( prefix, v );
  7233. } else {
  7234. // Item is non-scalar (array or object), encode its numeric index.
  7235. buildParams(
  7236. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7237. v,
  7238. traditional,
  7239. add
  7240. );
  7241. }
  7242. } );
  7243. } else if ( !traditional && toType( obj ) === "object" ) {
  7244. // Serialize object item.
  7245. for ( name in obj ) {
  7246. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7247. }
  7248. } else {
  7249. // Serialize scalar item.
  7250. add( prefix, obj );
  7251. }
  7252. }
  7253. // Serialize an array of form elements or a set of
  7254. // key/values into a query string
  7255. jQuery.param = function( a, traditional ) {
  7256. var prefix,
  7257. s = [],
  7258. add = function( key, valueOrFunction ) {
  7259. // If value is a function, invoke it and use its return value
  7260. var value = isFunction( valueOrFunction ) ?
  7261. valueOrFunction() :
  7262. valueOrFunction;
  7263. s[ s.length ] = encodeURIComponent( key ) + "=" +
  7264. encodeURIComponent( value == null ? "" : value );
  7265. };
  7266. if ( a == null ) {
  7267. return "";
  7268. }
  7269. // If an array was passed in, assume that it is an array of form elements.
  7270. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7271. // Serialize the form elements
  7272. jQuery.each( a, function() {
  7273. add( this.name, this.value );
  7274. } );
  7275. } else {
  7276. // If traditional, encode the "old" way (the way 1.3.2 or older
  7277. // did it), otherwise encode params recursively.
  7278. for ( prefix in a ) {
  7279. buildParams( prefix, a[ prefix ], traditional, add );
  7280. }
  7281. }
  7282. // Return the resulting serialization
  7283. return s.join( "&" );
  7284. };
  7285. jQuery.fn.extend( {
  7286. serialize: function() {
  7287. return jQuery.param( this.serializeArray() );
  7288. },
  7289. serializeArray: function() {
  7290. return this.map( function() {
  7291. // Can add propHook for "elements" to filter or add form elements
  7292. var elements = jQuery.prop( this, "elements" );
  7293. return elements ? jQuery.makeArray( elements ) : this;
  7294. } ).filter( function() {
  7295. var type = this.type;
  7296. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7297. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7298. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7299. ( this.checked || !rcheckableType.test( type ) );
  7300. } ).map( function( _i, elem ) {
  7301. var val = jQuery( this ).val();
  7302. if ( val == null ) {
  7303. return null;
  7304. }
  7305. if ( Array.isArray( val ) ) {
  7306. return jQuery.map( val, function( val ) {
  7307. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7308. } );
  7309. }
  7310. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7311. } ).get();
  7312. }
  7313. } );
  7314. var
  7315. r20 = /%20/g,
  7316. rhash = /#.*$/,
  7317. rantiCache = /([?&])_=[^&]*/,
  7318. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7319. // #7653, #8125, #8152: local protocol detection
  7320. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7321. rnoContent = /^(?:GET|HEAD)$/,
  7322. rprotocol = /^\/\//,
  7323. /* Prefilters
  7324. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7325. * 2) These are called:
  7326. * - BEFORE asking for a transport
  7327. * - AFTER param serialization (s.data is a string if s.processData is true)
  7328. * 3) key is the dataType
  7329. * 4) the catchall symbol "*" can be used
  7330. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7331. */
  7332. prefilters = {},
  7333. /* Transports bindings
  7334. * 1) key is the dataType
  7335. * 2) the catchall symbol "*" can be used
  7336. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7337. */
  7338. transports = {},
  7339. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  7340. allTypes = "*/".concat( "*" ),
  7341. // Anchor tag for parsing the document origin
  7342. originAnchor = document.createElement( "a" );
  7343. originAnchor.href = location.href;
  7344. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7345. function addToPrefiltersOrTransports( structure ) {
  7346. // dataTypeExpression is optional and defaults to "*"
  7347. return function( dataTypeExpression, func ) {
  7348. if ( typeof dataTypeExpression !== "string" ) {
  7349. func = dataTypeExpression;
  7350. dataTypeExpression = "*";
  7351. }
  7352. var dataType,
  7353. i = 0,
  7354. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7355. if ( isFunction( func ) ) {
  7356. // For each dataType in the dataTypeExpression
  7357. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7358. // Prepend if requested
  7359. if ( dataType[ 0 ] === "+" ) {
  7360. dataType = dataType.slice( 1 ) || "*";
  7361. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7362. // Otherwise append
  7363. } else {
  7364. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7365. }
  7366. }
  7367. }
  7368. };
  7369. }
  7370. // Base inspection function for prefilters and transports
  7371. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7372. var inspected = {},
  7373. seekingTransport = ( structure === transports );
  7374. function inspect( dataType ) {
  7375. var selected;
  7376. inspected[ dataType ] = true;
  7377. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7378. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7379. if ( typeof dataTypeOrTransport === "string" &&
  7380. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7381. options.dataTypes.unshift( dataTypeOrTransport );
  7382. inspect( dataTypeOrTransport );
  7383. return false;
  7384. } else if ( seekingTransport ) {
  7385. return !( selected = dataTypeOrTransport );
  7386. }
  7387. } );
  7388. return selected;
  7389. }
  7390. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7391. }
  7392. // A special extend for ajax options
  7393. // that takes "flat" options (not to be deep extended)
  7394. // Fixes #9887
  7395. function ajaxExtend( target, src ) {
  7396. var key, deep,
  7397. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7398. for ( key in src ) {
  7399. if ( src[ key ] !== undefined ) {
  7400. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7401. }
  7402. }
  7403. if ( deep ) {
  7404. jQuery.extend( true, target, deep );
  7405. }
  7406. return target;
  7407. }
  7408. /* Handles responses to an ajax request:
  7409. * - finds the right dataType (mediates between content-type and expected dataType)
  7410. * - returns the corresponding response
  7411. */
  7412. function ajaxHandleResponses( s, jqXHR, responses ) {
  7413. var ct, type, finalDataType, firstDataType,
  7414. contents = s.contents,
  7415. dataTypes = s.dataTypes;
  7416. // Remove auto dataType and get content-type in the process
  7417. while ( dataTypes[ 0 ] === "*" ) {
  7418. dataTypes.shift();
  7419. if ( ct === undefined ) {
  7420. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7421. }
  7422. }
  7423. // Check if we're dealing with a known content-type
  7424. if ( ct ) {
  7425. for ( type in contents ) {
  7426. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7427. dataTypes.unshift( type );
  7428. break;
  7429. }
  7430. }
  7431. }
  7432. // Check to see if we have a response for the expected dataType
  7433. if ( dataTypes[ 0 ] in responses ) {
  7434. finalDataType = dataTypes[ 0 ];
  7435. } else {
  7436. // Try convertible dataTypes
  7437. for ( type in responses ) {
  7438. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7439. finalDataType = type;
  7440. break;
  7441. }
  7442. if ( !firstDataType ) {
  7443. firstDataType = type;
  7444. }
  7445. }
  7446. // Or just use first one
  7447. finalDataType = finalDataType || firstDataType;
  7448. }
  7449. // If we found a dataType
  7450. // We add the dataType to the list if needed
  7451. // and return the corresponding response
  7452. if ( finalDataType ) {
  7453. if ( finalDataType !== dataTypes[ 0 ] ) {
  7454. dataTypes.unshift( finalDataType );
  7455. }
  7456. return responses[ finalDataType ];
  7457. }
  7458. }
  7459. /* Chain conversions given the request and the original response
  7460. * Also sets the responseXXX fields on the jqXHR instance
  7461. */
  7462. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7463. var conv2, current, conv, tmp, prev,
  7464. converters = {},
  7465. // Work with a copy of dataTypes in case we need to modify it for conversion
  7466. dataTypes = s.dataTypes.slice();
  7467. // Create converters map with lowercased keys
  7468. if ( dataTypes[ 1 ] ) {
  7469. for ( conv in s.converters ) {
  7470. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7471. }
  7472. }
  7473. current = dataTypes.shift();
  7474. // Convert to each sequential dataType
  7475. while ( current ) {
  7476. if ( s.responseFields[ current ] ) {
  7477. jqXHR[ s.responseFields[ current ] ] = response;
  7478. }
  7479. // Apply the dataFilter if provided
  7480. if ( !prev && isSuccess && s.dataFilter ) {
  7481. response = s.dataFilter( response, s.dataType );
  7482. }
  7483. prev = current;
  7484. current = dataTypes.shift();
  7485. if ( current ) {
  7486. // There's only work to do if current dataType is non-auto
  7487. if ( current === "*" ) {
  7488. current = prev;
  7489. // Convert response if prev dataType is non-auto and differs from current
  7490. } else if ( prev !== "*" && prev !== current ) {
  7491. // Seek a direct converter
  7492. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7493. // If none found, seek a pair
  7494. if ( !conv ) {
  7495. for ( conv2 in converters ) {
  7496. // If conv2 outputs current
  7497. tmp = conv2.split( " " );
  7498. if ( tmp[ 1 ] === current ) {
  7499. // If prev can be converted to accepted input
  7500. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7501. converters[ "* " + tmp[ 0 ] ];
  7502. if ( conv ) {
  7503. // Condense equivalence converters
  7504. if ( conv === true ) {
  7505. conv = converters[ conv2 ];
  7506. // Otherwise, insert the intermediate dataType
  7507. } else if ( converters[ conv2 ] !== true ) {
  7508. current = tmp[ 0 ];
  7509. dataTypes.unshift( tmp[ 1 ] );
  7510. }
  7511. break;
  7512. }
  7513. }
  7514. }
  7515. }
  7516. // Apply converter (if not an equivalence)
  7517. if ( conv !== true ) {
  7518. // Unless errors are allowed to bubble, catch and return them
  7519. if ( conv && s.throws ) {
  7520. response = conv( response );
  7521. } else {
  7522. try {
  7523. response = conv( response );
  7524. } catch ( e ) {
  7525. return {
  7526. state: "parsererror",
  7527. error: conv ? e : "No conversion from " + prev + " to " + current
  7528. };
  7529. }
  7530. }
  7531. }
  7532. }
  7533. }
  7534. }
  7535. return { state: "success", data: response };
  7536. }
  7537. jQuery.extend( {
  7538. // Counter for holding the number of active queries
  7539. active: 0,
  7540. // Last-Modified header cache for next request
  7541. lastModified: {},
  7542. etag: {},
  7543. ajaxSettings: {
  7544. url: location.href,
  7545. type: "GET",
  7546. isLocal: rlocalProtocol.test( location.protocol ),
  7547. global: true,
  7548. processData: true,
  7549. async: true,
  7550. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7551. /*
  7552. timeout: 0,
  7553. data: null,
  7554. dataType: null,
  7555. username: null,
  7556. password: null,
  7557. cache: null,
  7558. throws: false,
  7559. traditional: false,
  7560. headers: {},
  7561. */
  7562. accepts: {
  7563. "*": allTypes,
  7564. text: "text/plain",
  7565. html: "text/html",
  7566. xml: "application/xml, text/xml",
  7567. json: "application/json, text/javascript"
  7568. },
  7569. contents: {
  7570. xml: /\bxml\b/,
  7571. html: /\bhtml/,
  7572. json: /\bjson\b/
  7573. },
  7574. responseFields: {
  7575. xml: "responseXML",
  7576. text: "responseText",
  7577. json: "responseJSON"
  7578. },
  7579. // Data converters
  7580. // Keys separate source (or catchall "*") and destination types with a single space
  7581. converters: {
  7582. // Convert anything to text
  7583. "* text": String,
  7584. // Text to html (true = no transformation)
  7585. "text html": true,
  7586. // Evaluate text as a json expression
  7587. "text json": JSON.parse,
  7588. // Parse text as xml
  7589. "text xml": jQuery.parseXML
  7590. },
  7591. // For options that shouldn't be deep extended:
  7592. // you can add your own custom options here if
  7593. // and when you create one that shouldn't be
  7594. // deep extended (see ajaxExtend)
  7595. flatOptions: {
  7596. url: true,
  7597. context: true
  7598. }
  7599. },
  7600. // Creates a full fledged settings object into target
  7601. // with both ajaxSettings and settings fields.
  7602. // If target is omitted, writes into ajaxSettings.
  7603. ajaxSetup: function( target, settings ) {
  7604. return settings ?
  7605. // Building a settings object
  7606. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7607. // Extending ajaxSettings
  7608. ajaxExtend( jQuery.ajaxSettings, target );
  7609. },
  7610. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7611. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7612. // Main method
  7613. ajax: function( url, options ) {
  7614. // If url is an object, simulate pre-1.5 signature
  7615. if ( typeof url === "object" ) {
  7616. options = url;
  7617. url = undefined;
  7618. }
  7619. // Force options to be an object
  7620. options = options || {};
  7621. var transport,
  7622. // URL without anti-cache param
  7623. cacheURL,
  7624. // Response headers
  7625. responseHeadersString,
  7626. responseHeaders,
  7627. // timeout handle
  7628. timeoutTimer,
  7629. // Url cleanup var
  7630. urlAnchor,
  7631. // Request state (becomes false upon send and true upon completion)
  7632. completed,
  7633. // To know if global events are to be dispatched
  7634. fireGlobals,
  7635. // Loop variable
  7636. i,
  7637. // uncached part of the url
  7638. uncached,
  7639. // Create the final options object
  7640. s = jQuery.ajaxSetup( {}, options ),
  7641. // Callbacks context
  7642. callbackContext = s.context || s,
  7643. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7644. globalEventContext = s.context &&
  7645. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7646. jQuery( callbackContext ) :
  7647. jQuery.event,
  7648. // Deferreds
  7649. deferred = jQuery.Deferred(),
  7650. completeDeferred = jQuery.Callbacks( "once memory" ),
  7651. // Status-dependent callbacks
  7652. statusCode = s.statusCode || {},
  7653. // Headers (they are sent all at once)
  7654. requestHeaders = {},
  7655. requestHeadersNames = {},
  7656. // Default abort message
  7657. strAbort = "canceled",
  7658. // Fake xhr
  7659. jqXHR = {
  7660. readyState: 0,
  7661. // Builds headers hashtable if needed
  7662. getResponseHeader: function( key ) {
  7663. var match;
  7664. if ( completed ) {
  7665. if ( !responseHeaders ) {
  7666. responseHeaders = {};
  7667. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7668. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  7669. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  7670. .concat( match[ 2 ] );
  7671. }
  7672. }
  7673. match = responseHeaders[ key.toLowerCase() + " " ];
  7674. }
  7675. return match == null ? null : match.join( ", " );
  7676. },
  7677. // Raw string
  7678. getAllResponseHeaders: function() {
  7679. return completed ? responseHeadersString : null;
  7680. },
  7681. // Caches the header
  7682. setRequestHeader: function( name, value ) {
  7683. if ( completed == null ) {
  7684. name = requestHeadersNames[ name.toLowerCase() ] =
  7685. requestHeadersNames[ name.toLowerCase() ] || name;
  7686. requestHeaders[ name ] = value;
  7687. }
  7688. return this;
  7689. },
  7690. // Overrides response content-type header
  7691. overrideMimeType: function( type ) {
  7692. if ( completed == null ) {
  7693. s.mimeType = type;
  7694. }
  7695. return this;
  7696. },
  7697. // Status-dependent callbacks
  7698. statusCode: function( map ) {
  7699. var code;
  7700. if ( map ) {
  7701. if ( completed ) {
  7702. // Execute the appropriate callbacks
  7703. jqXHR.always( map[ jqXHR.status ] );
  7704. } else {
  7705. // Lazy-add the new callbacks in a way that preserves old ones
  7706. for ( code in map ) {
  7707. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7708. }
  7709. }
  7710. }
  7711. return this;
  7712. },
  7713. // Cancel the request
  7714. abort: function( statusText ) {
  7715. var finalText = statusText || strAbort;
  7716. if ( transport ) {
  7717. transport.abort( finalText );
  7718. }
  7719. done( 0, finalText );
  7720. return this;
  7721. }
  7722. };
  7723. // Attach deferreds
  7724. deferred.promise( jqXHR );
  7725. // Add protocol if not provided (prefilters might expect it)
  7726. // Handle falsy url in the settings object (#10093: consistency with old signature)
  7727. // We also use the url parameter if available
  7728. s.url = ( ( url || s.url || location.href ) + "" )
  7729. .replace( rprotocol, location.protocol + "//" );
  7730. // Alias method option to type as per ticket #12004
  7731. s.type = options.method || options.type || s.method || s.type;
  7732. // Extract dataTypes list
  7733. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7734. // A cross-domain request is in order when the origin doesn't match the current origin.
  7735. if ( s.crossDomain == null ) {
  7736. urlAnchor = document.createElement( "a" );
  7737. // Support: IE <=8 - 11, Edge 12 - 15
  7738. // IE throws exception on accessing the href property if url is malformed,
  7739. // e.g. http://example.com:80x/
  7740. try {
  7741. urlAnchor.href = s.url;
  7742. // Support: IE <=8 - 11 only
  7743. // Anchor's host property isn't correctly set when s.url is relative
  7744. urlAnchor.href = urlAnchor.href;
  7745. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7746. urlAnchor.protocol + "//" + urlAnchor.host;
  7747. } catch ( e ) {
  7748. // If there is an error parsing the URL, assume it is crossDomain,
  7749. // it can be rejected by the transport if it is invalid
  7750. s.crossDomain = true;
  7751. }
  7752. }
  7753. // Convert data if not already a string
  7754. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7755. s.data = jQuery.param( s.data, s.traditional );
  7756. }
  7757. // Apply prefilters
  7758. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7759. // If request was aborted inside a prefilter, stop there
  7760. if ( completed ) {
  7761. return jqXHR;
  7762. }
  7763. // We can fire global events as of now if asked to
  7764. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  7765. fireGlobals = jQuery.event && s.global;
  7766. // Watch for a new set of requests
  7767. if ( fireGlobals && jQuery.active++ === 0 ) {
  7768. jQuery.event.trigger( "ajaxStart" );
  7769. }
  7770. // Uppercase the type
  7771. s.type = s.type.toUpperCase();
  7772. // Determine if request has content
  7773. s.hasContent = !rnoContent.test( s.type );
  7774. // Save the URL in case we're toying with the If-Modified-Since
  7775. // and/or If-None-Match header later on
  7776. // Remove hash to simplify url manipulation
  7777. cacheURL = s.url.replace( rhash, "" );
  7778. // More options handling for requests with no content
  7779. if ( !s.hasContent ) {
  7780. // Remember the hash so we can put it back
  7781. uncached = s.url.slice( cacheURL.length );
  7782. // If data is available and should be processed, append data to url
  7783. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  7784. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7785. // #9682: remove data so that it's not used in an eventual retry
  7786. delete s.data;
  7787. }
  7788. // Add or update anti-cache param if needed
  7789. if ( s.cache === false ) {
  7790. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7791. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  7792. uncached;
  7793. }
  7794. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7795. s.url = cacheURL + uncached;
  7796. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7797. } else if ( s.data && s.processData &&
  7798. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7799. s.data = s.data.replace( r20, "+" );
  7800. }
  7801. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7802. if ( s.ifModified ) {
  7803. if ( jQuery.lastModified[ cacheURL ] ) {
  7804. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7805. }
  7806. if ( jQuery.etag[ cacheURL ] ) {
  7807. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7808. }
  7809. }
  7810. // Set the correct header, if data is being sent
  7811. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7812. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7813. }
  7814. // Set the Accepts header for the server, depending on the dataType
  7815. jqXHR.setRequestHeader(
  7816. "Accept",
  7817. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7818. s.accepts[ s.dataTypes[ 0 ] ] +
  7819. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7820. s.accepts[ "*" ]
  7821. );
  7822. // Check for headers option
  7823. for ( i in s.headers ) {
  7824. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7825. }
  7826. // Allow custom headers/mimetypes and early abort
  7827. if ( s.beforeSend &&
  7828. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7829. // Abort if not done already and return
  7830. return jqXHR.abort();
  7831. }
  7832. // Aborting is no longer a cancellation
  7833. strAbort = "abort";
  7834. // Install callbacks on deferreds
  7835. completeDeferred.add( s.complete );
  7836. jqXHR.done( s.success );
  7837. jqXHR.fail( s.error );
  7838. // Get transport
  7839. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7840. // If no transport, we auto-abort
  7841. if ( !transport ) {
  7842. done( -1, "No Transport" );
  7843. } else {
  7844. jqXHR.readyState = 1;
  7845. // Send global event
  7846. if ( fireGlobals ) {
  7847. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7848. }
  7849. // If request was aborted inside ajaxSend, stop there
  7850. if ( completed ) {
  7851. return jqXHR;
  7852. }
  7853. // Timeout
  7854. if ( s.async && s.timeout > 0 ) {
  7855. timeoutTimer = window.setTimeout( function() {
  7856. jqXHR.abort( "timeout" );
  7857. }, s.timeout );
  7858. }
  7859. try {
  7860. completed = false;
  7861. transport.send( requestHeaders, done );
  7862. } catch ( e ) {
  7863. // Rethrow post-completion exceptions
  7864. if ( completed ) {
  7865. throw e;
  7866. }
  7867. // Propagate others as results
  7868. done( -1, e );
  7869. }
  7870. }
  7871. // Callback for when everything is done
  7872. function done( status, nativeStatusText, responses, headers ) {
  7873. var isSuccess, success, error, response, modified,
  7874. statusText = nativeStatusText;
  7875. // Ignore repeat invocations
  7876. if ( completed ) {
  7877. return;
  7878. }
  7879. completed = true;
  7880. // Clear timeout if it exists
  7881. if ( timeoutTimer ) {
  7882. window.clearTimeout( timeoutTimer );
  7883. }
  7884. // Dereference transport for early garbage collection
  7885. // (no matter how long the jqXHR object will be used)
  7886. transport = undefined;
  7887. // Cache response headers
  7888. responseHeadersString = headers || "";
  7889. // Set readyState
  7890. jqXHR.readyState = status > 0 ? 4 : 0;
  7891. // Determine if successful
  7892. isSuccess = status >= 200 && status < 300 || status === 304;
  7893. // Get response data
  7894. if ( responses ) {
  7895. response = ajaxHandleResponses( s, jqXHR, responses );
  7896. }
  7897. // Use a noop converter for missing script but not if jsonp
  7898. if ( !isSuccess &&
  7899. jQuery.inArray( "script", s.dataTypes ) > -1 &&
  7900. jQuery.inArray( "json", s.dataTypes ) < 0 ) {
  7901. s.converters[ "text script" ] = function() {};
  7902. }
  7903. // Convert no matter what (that way responseXXX fields are always set)
  7904. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7905. // If successful, handle type chaining
  7906. if ( isSuccess ) {
  7907. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7908. if ( s.ifModified ) {
  7909. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7910. if ( modified ) {
  7911. jQuery.lastModified[ cacheURL ] = modified;
  7912. }
  7913. modified = jqXHR.getResponseHeader( "etag" );
  7914. if ( modified ) {
  7915. jQuery.etag[ cacheURL ] = modified;
  7916. }
  7917. }
  7918. // if no content
  7919. if ( status === 204 || s.type === "HEAD" ) {
  7920. statusText = "nocontent";
  7921. // if not modified
  7922. } else if ( status === 304 ) {
  7923. statusText = "notmodified";
  7924. // If we have data, let's convert it
  7925. } else {
  7926. statusText = response.state;
  7927. success = response.data;
  7928. error = response.error;
  7929. isSuccess = !error;
  7930. }
  7931. } else {
  7932. // Extract error from statusText and normalize for non-aborts
  7933. error = statusText;
  7934. if ( status || !statusText ) {
  7935. statusText = "error";
  7936. if ( status < 0 ) {
  7937. status = 0;
  7938. }
  7939. }
  7940. }
  7941. // Set data for the fake xhr object
  7942. jqXHR.status = status;
  7943. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7944. // Success/Error
  7945. if ( isSuccess ) {
  7946. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7947. } else {
  7948. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7949. }
  7950. // Status-dependent callbacks
  7951. jqXHR.statusCode( statusCode );
  7952. statusCode = undefined;
  7953. if ( fireGlobals ) {
  7954. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7955. [ jqXHR, s, isSuccess ? success : error ] );
  7956. }
  7957. // Complete
  7958. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7959. if ( fireGlobals ) {
  7960. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7961. // Handle the global AJAX counter
  7962. if ( !( --jQuery.active ) ) {
  7963. jQuery.event.trigger( "ajaxStop" );
  7964. }
  7965. }
  7966. }
  7967. return jqXHR;
  7968. },
  7969. getJSON: function( url, data, callback ) {
  7970. return jQuery.get( url, data, callback, "json" );
  7971. },
  7972. getScript: function( url, callback ) {
  7973. return jQuery.get( url, undefined, callback, "script" );
  7974. }
  7975. } );
  7976. jQuery.each( [ "get", "post" ], function( _i, method ) {
  7977. jQuery[ method ] = function( url, data, callback, type ) {
  7978. // Shift arguments if data argument was omitted
  7979. if ( isFunction( data ) ) {
  7980. type = type || callback;
  7981. callback = data;
  7982. data = undefined;
  7983. }
  7984. // The url can be an options object (which then must have .url)
  7985. return jQuery.ajax( jQuery.extend( {
  7986. url: url,
  7987. type: method,
  7988. dataType: type,
  7989. data: data,
  7990. success: callback
  7991. }, jQuery.isPlainObject( url ) && url ) );
  7992. };
  7993. } );
  7994. jQuery.ajaxPrefilter( function( s ) {
  7995. var i;
  7996. for ( i in s.headers ) {
  7997. if ( i.toLowerCase() === "content-type" ) {
  7998. s.contentType = s.headers[ i ] || "";
  7999. }
  8000. }
  8001. } );
  8002. jQuery._evalUrl = function( url, options, doc ) {
  8003. return jQuery.ajax( {
  8004. url: url,
  8005. // Make this explicit, since user can override this through ajaxSetup (#11264)
  8006. type: "GET",
  8007. dataType: "script",
  8008. cache: true,
  8009. async: false,
  8010. global: false,
  8011. // Only evaluate the response if it is successful (gh-4126)
  8012. // dataFilter is not invoked for failure responses, so using it instead
  8013. // of the default converter is kludgy but it works.
  8014. converters: {
  8015. "text script": function() {}
  8016. },
  8017. dataFilter: function( response ) {
  8018. jQuery.globalEval( response, options, doc );
  8019. }
  8020. } );
  8021. };
  8022. jQuery.fn.extend( {
  8023. wrapAll: function( html ) {
  8024. var wrap;
  8025. if ( this[ 0 ] ) {
  8026. if ( isFunction( html ) ) {
  8027. html = html.call( this[ 0 ] );
  8028. }
  8029. // The elements to wrap the target around
  8030. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  8031. if ( this[ 0 ].parentNode ) {
  8032. wrap.insertBefore( this[ 0 ] );
  8033. }
  8034. wrap.map( function() {
  8035. var elem = this;
  8036. while ( elem.firstElementChild ) {
  8037. elem = elem.firstElementChild;
  8038. }
  8039. return elem;
  8040. } ).append( this );
  8041. }
  8042. return this;
  8043. },
  8044. wrapInner: function( html ) {
  8045. if ( isFunction( html ) ) {
  8046. return this.each( function( i ) {
  8047. jQuery( this ).wrapInner( html.call( this, i ) );
  8048. } );
  8049. }
  8050. return this.each( function() {
  8051. var self = jQuery( this ),
  8052. contents = self.contents();
  8053. if ( contents.length ) {
  8054. contents.wrapAll( html );
  8055. } else {
  8056. self.append( html );
  8057. }
  8058. } );
  8059. },
  8060. wrap: function( html ) {
  8061. var htmlIsFunction = isFunction( html );
  8062. return this.each( function( i ) {
  8063. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8064. } );
  8065. },
  8066. unwrap: function( selector ) {
  8067. this.parent( selector ).not( "body" ).each( function() {
  8068. jQuery( this ).replaceWith( this.childNodes );
  8069. } );
  8070. return this;
  8071. }
  8072. } );
  8073. jQuery.expr.pseudos.hidden = function( elem ) {
  8074. return !jQuery.expr.pseudos.visible( elem );
  8075. };
  8076. jQuery.expr.pseudos.visible = function( elem ) {
  8077. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8078. };
  8079. jQuery.ajaxSettings.xhr = function() {
  8080. try {
  8081. return new window.XMLHttpRequest();
  8082. } catch ( e ) {}
  8083. };
  8084. var xhrSuccessStatus = {
  8085. // File protocol always yields status code 0, assume 200
  8086. 0: 200,
  8087. // Support: IE <=9 only
  8088. // #1450: sometimes IE returns 1223 when it should be 204
  8089. 1223: 204
  8090. },
  8091. xhrSupported = jQuery.ajaxSettings.xhr();
  8092. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  8093. support.ajax = xhrSupported = !!xhrSupported;
  8094. jQuery.ajaxTransport( function( options ) {
  8095. var callback, errorCallback;
  8096. // Cross domain only allowed if supported through XMLHttpRequest
  8097. if ( support.cors || xhrSupported && !options.crossDomain ) {
  8098. return {
  8099. send: function( headers, complete ) {
  8100. var i,
  8101. xhr = options.xhr();
  8102. xhr.open(
  8103. options.type,
  8104. options.url,
  8105. options.async,
  8106. options.username,
  8107. options.password
  8108. );
  8109. // Apply custom fields if provided
  8110. if ( options.xhrFields ) {
  8111. for ( i in options.xhrFields ) {
  8112. xhr[ i ] = options.xhrFields[ i ];
  8113. }
  8114. }
  8115. // Override mime type if needed
  8116. if ( options.mimeType && xhr.overrideMimeType ) {
  8117. xhr.overrideMimeType( options.mimeType );
  8118. }
  8119. // X-Requested-With header
  8120. // For cross-domain requests, seeing as conditions for a preflight are
  8121. // akin to a jigsaw puzzle, we simply never set it to be sure.
  8122. // (it can always be set on a per-request basis or even using ajaxSetup)
  8123. // For same-domain requests, won't change header if already provided.
  8124. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  8125. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  8126. }
  8127. // Set headers
  8128. for ( i in headers ) {
  8129. xhr.setRequestHeader( i, headers[ i ] );
  8130. }
  8131. // Callback
  8132. callback = function( type ) {
  8133. return function() {
  8134. if ( callback ) {
  8135. callback = errorCallback = xhr.onload =
  8136. xhr.onerror = xhr.onabort = xhr.ontimeout =
  8137. xhr.onreadystatechange = null;
  8138. if ( type === "abort" ) {
  8139. xhr.abort();
  8140. } else if ( type === "error" ) {
  8141. // Support: IE <=9 only
  8142. // On a manual native abort, IE9 throws
  8143. // errors on any property access that is not readyState
  8144. if ( typeof xhr.status !== "number" ) {
  8145. complete( 0, "error" );
  8146. } else {
  8147. complete(
  8148. // File: protocol always yields status 0; see #8605, #14207
  8149. xhr.status,
  8150. xhr.statusText
  8151. );
  8152. }
  8153. } else {
  8154. complete(
  8155. xhrSuccessStatus[ xhr.status ] || xhr.status,
  8156. xhr.statusText,
  8157. // Support: IE <=9 only
  8158. // IE9 has no XHR2 but throws on binary (trac-11426)
  8159. // For XHR2 non-text, let the caller handle it (gh-2498)
  8160. ( xhr.responseType || "text" ) !== "text" ||
  8161. typeof xhr.responseText !== "string" ?
  8162. { binary: xhr.response } :
  8163. { text: xhr.responseText },
  8164. xhr.getAllResponseHeaders()
  8165. );
  8166. }
  8167. }
  8168. };
  8169. };
  8170. // Listen to events
  8171. xhr.onload = callback();
  8172. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  8173. // Support: IE 9 only
  8174. // Use onreadystatechange to replace onabort
  8175. // to handle uncaught aborts
  8176. if ( xhr.onabort !== undefined ) {
  8177. xhr.onabort = errorCallback;
  8178. } else {
  8179. xhr.onreadystatechange = function() {
  8180. // Check readyState before timeout as it changes
  8181. if ( xhr.readyState === 4 ) {
  8182. // Allow onerror to be called first,
  8183. // but that will not handle a native abort
  8184. // Also, save errorCallback to a variable
  8185. // as xhr.onerror cannot be accessed
  8186. window.setTimeout( function() {
  8187. if ( callback ) {
  8188. errorCallback();
  8189. }
  8190. } );
  8191. }
  8192. };
  8193. }
  8194. // Create the abort callback
  8195. callback = callback( "abort" );
  8196. try {
  8197. // Do send the request (this may raise an exception)
  8198. xhr.send( options.hasContent && options.data || null );
  8199. } catch ( e ) {
  8200. // #14683: Only rethrow if this hasn't been notified as an error yet
  8201. if ( callback ) {
  8202. throw e;
  8203. }
  8204. }
  8205. },
  8206. abort: function() {
  8207. if ( callback ) {
  8208. callback();
  8209. }
  8210. }
  8211. };
  8212. }
  8213. } );
  8214. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  8215. jQuery.ajaxPrefilter( function( s ) {
  8216. if ( s.crossDomain ) {
  8217. s.contents.script = false;
  8218. }
  8219. } );
  8220. // Install script dataType
  8221. jQuery.ajaxSetup( {
  8222. accepts: {
  8223. script: "text/javascript, application/javascript, " +
  8224. "application/ecmascript, application/x-ecmascript"
  8225. },
  8226. contents: {
  8227. script: /\b(?:java|ecma)script\b/
  8228. },
  8229. converters: {
  8230. "text script": function( text ) {
  8231. jQuery.globalEval( text );
  8232. return text;
  8233. }
  8234. }
  8235. } );
  8236. // Handle cache's special case and crossDomain
  8237. jQuery.ajaxPrefilter( "script", function( s ) {
  8238. if ( s.cache === undefined ) {
  8239. s.cache = false;
  8240. }
  8241. if ( s.crossDomain ) {
  8242. s.type = "GET";
  8243. }
  8244. } );
  8245. // Bind script tag hack transport
  8246. jQuery.ajaxTransport( "script", function( s ) {
  8247. // This transport only deals with cross domain or forced-by-attrs requests
  8248. if ( s.crossDomain || s.scriptAttrs ) {
  8249. var script, callback;
  8250. return {
  8251. send: function( _, complete ) {
  8252. script = jQuery( "<script>" )
  8253. .attr( s.scriptAttrs || {} )
  8254. .prop( { charset: s.scriptCharset, src: s.url } )
  8255. .on( "load error", callback = function( evt ) {
  8256. script.remove();
  8257. callback = null;
  8258. if ( evt ) {
  8259. complete( evt.type === "error" ? 404 : 200, evt.type );
  8260. }
  8261. } );
  8262. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8263. document.head.appendChild( script[ 0 ] );
  8264. },
  8265. abort: function() {
  8266. if ( callback ) {
  8267. callback();
  8268. }
  8269. }
  8270. };
  8271. }
  8272. } );
  8273. var oldCallbacks = [],
  8274. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8275. // Default jsonp settings
  8276. jQuery.ajaxSetup( {
  8277. jsonp: "callback",
  8278. jsonpCallback: function() {
  8279. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  8280. this[ callback ] = true;
  8281. return callback;
  8282. }
  8283. } );
  8284. // Detect, normalize options and install callbacks for jsonp requests
  8285. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8286. var callbackName, overwritten, responseContainer,
  8287. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8288. "url" :
  8289. typeof s.data === "string" &&
  8290. ( s.contentType || "" )
  8291. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  8292. rjsonp.test( s.data ) && "data"
  8293. );
  8294. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8295. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8296. // Get callback name, remembering preexisting value associated with it
  8297. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  8298. s.jsonpCallback() :
  8299. s.jsonpCallback;
  8300. // Insert callback into url or form data
  8301. if ( jsonProp ) {
  8302. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8303. } else if ( s.jsonp !== false ) {
  8304. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8305. }
  8306. // Use data converter to retrieve json after script execution
  8307. s.converters[ "script json" ] = function() {
  8308. if ( !responseContainer ) {
  8309. jQuery.error( callbackName + " was not called" );
  8310. }
  8311. return responseContainer[ 0 ];
  8312. };
  8313. // Force json dataType
  8314. s.dataTypes[ 0 ] = "json";
  8315. // Install callback
  8316. overwritten = window[ callbackName ];
  8317. window[ callbackName ] = function() {
  8318. responseContainer = arguments;
  8319. };
  8320. // Clean-up function (fires after converters)
  8321. jqXHR.always( function() {
  8322. // If previous value didn't exist - remove it
  8323. if ( overwritten === undefined ) {
  8324. jQuery( window ).removeProp( callbackName );
  8325. // Otherwise restore preexisting value
  8326. } else {
  8327. window[ callbackName ] = overwritten;
  8328. }
  8329. // Save back as free
  8330. if ( s[ callbackName ] ) {
  8331. // Make sure that re-using the options doesn't screw things around
  8332. s.jsonpCallback = originalSettings.jsonpCallback;
  8333. // Save the callback name for future use
  8334. oldCallbacks.push( callbackName );
  8335. }
  8336. // Call if it was a function and we have a response
  8337. if ( responseContainer && isFunction( overwritten ) ) {
  8338. overwritten( responseContainer[ 0 ] );
  8339. }
  8340. responseContainer = overwritten = undefined;
  8341. } );
  8342. // Delegate to script
  8343. return "script";
  8344. }
  8345. } );
  8346. // Support: Safari 8 only
  8347. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8348. // collapse sibling forms: the second one becomes a child of the first one.
  8349. // Because of that, this security measure has to be disabled in Safari 8.
  8350. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8351. support.createHTMLDocument = ( function() {
  8352. var body = document.implementation.createHTMLDocument( "" ).body;
  8353. body.innerHTML = "<form></form><form></form>";
  8354. return body.childNodes.length === 2;
  8355. } )();
  8356. // Argument "data" should be string of html
  8357. // context (optional): If specified, the fragment will be created in this context,
  8358. // defaults to document
  8359. // keepScripts (optional): If true, will include scripts passed in the html string
  8360. jQuery.parseHTML = function( data, context, keepScripts ) {
  8361. if ( typeof data !== "string" ) {
  8362. return [];
  8363. }
  8364. if ( typeof context === "boolean" ) {
  8365. keepScripts = context;
  8366. context = false;
  8367. }
  8368. var base, parsed, scripts;
  8369. if ( !context ) {
  8370. // Stop scripts or inline event handlers from being executed immediately
  8371. // by using document.implementation
  8372. if ( support.createHTMLDocument ) {
  8373. context = document.implementation.createHTMLDocument( "" );
  8374. // Set the base href for the created document
  8375. // so any parsed elements with URLs
  8376. // are based on the document's URL (gh-2965)
  8377. base = context.createElement( "base" );
  8378. base.href = document.location.href;
  8379. context.head.appendChild( base );
  8380. } else {
  8381. context = document;
  8382. }
  8383. }
  8384. parsed = rsingleTag.exec( data );
  8385. scripts = !keepScripts && [];
  8386. // Single tag
  8387. if ( parsed ) {
  8388. return [ context.createElement( parsed[ 1 ] ) ];
  8389. }
  8390. parsed = buildFragment( [ data ], context, scripts );
  8391. if ( scripts && scripts.length ) {
  8392. jQuery( scripts ).remove();
  8393. }
  8394. return jQuery.merge( [], parsed.childNodes );
  8395. };
  8396. /**
  8397. * Load a url into a page
  8398. */
  8399. jQuery.fn.load = function( url, params, callback ) {
  8400. var selector, type, response,
  8401. self = this,
  8402. off = url.indexOf( " " );
  8403. if ( off > -1 ) {
  8404. selector = stripAndCollapse( url.slice( off ) );
  8405. url = url.slice( 0, off );
  8406. }
  8407. // If it's a function
  8408. if ( isFunction( params ) ) {
  8409. // We assume that it's the callback
  8410. callback = params;
  8411. params = undefined;
  8412. // Otherwise, build a param string
  8413. } else if ( params && typeof params === "object" ) {
  8414. type = "POST";
  8415. }
  8416. // If we have elements to modify, make the request
  8417. if ( self.length > 0 ) {
  8418. jQuery.ajax( {
  8419. url: url,
  8420. // If "type" variable is undefined, then "GET" method will be used.
  8421. // Make value of this field explicit since
  8422. // user can override it through ajaxSetup method
  8423. type: type || "GET",
  8424. dataType: "html",
  8425. data: params
  8426. } ).done( function( responseText ) {
  8427. // Save response for use in complete callback
  8428. response = arguments;
  8429. self.html( selector ?
  8430. // If a selector was specified, locate the right elements in a dummy div
  8431. // Exclude scripts to avoid IE 'Permission Denied' errors
  8432. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8433. // Otherwise use the full result
  8434. responseText );
  8435. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8436. // but they are ignored because response was set above.
  8437. // If it fails, this function gets "jqXHR", "status", "error"
  8438. } ).always( callback && function( jqXHR, status ) {
  8439. self.each( function() {
  8440. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8441. } );
  8442. } );
  8443. }
  8444. return this;
  8445. };
  8446. jQuery.expr.pseudos.animated = function( elem ) {
  8447. return jQuery.grep( jQuery.timers, function( fn ) {
  8448. return elem === fn.elem;
  8449. } ).length;
  8450. };
  8451. jQuery.offset = {
  8452. setOffset: function( elem, options, i ) {
  8453. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8454. position = jQuery.css( elem, "position" ),
  8455. curElem = jQuery( elem ),
  8456. props = {};
  8457. // Set position first, in-case top/left are set even on static elem
  8458. if ( position === "static" ) {
  8459. elem.style.position = "relative";
  8460. }
  8461. curOffset = curElem.offset();
  8462. curCSSTop = jQuery.css( elem, "top" );
  8463. curCSSLeft = jQuery.css( elem, "left" );
  8464. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8465. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8466. // Need to be able to calculate position if either
  8467. // top or left is auto and position is either absolute or fixed
  8468. if ( calculatePosition ) {
  8469. curPosition = curElem.position();
  8470. curTop = curPosition.top;
  8471. curLeft = curPosition.left;
  8472. } else {
  8473. curTop = parseFloat( curCSSTop ) || 0;
  8474. curLeft = parseFloat( curCSSLeft ) || 0;
  8475. }
  8476. if ( isFunction( options ) ) {
  8477. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8478. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8479. }
  8480. if ( options.top != null ) {
  8481. props.top = ( options.top - curOffset.top ) + curTop;
  8482. }
  8483. if ( options.left != null ) {
  8484. props.left = ( options.left - curOffset.left ) + curLeft;
  8485. }
  8486. if ( "using" in options ) {
  8487. options.using.call( elem, props );
  8488. } else {
  8489. curElem.css( props );
  8490. }
  8491. }
  8492. };
  8493. jQuery.fn.extend( {
  8494. // offset() relates an element's border box to the document origin
  8495. offset: function( options ) {
  8496. // Preserve chaining for setter
  8497. if ( arguments.length ) {
  8498. return options === undefined ?
  8499. this :
  8500. this.each( function( i ) {
  8501. jQuery.offset.setOffset( this, options, i );
  8502. } );
  8503. }
  8504. var rect, win,
  8505. elem = this[ 0 ];
  8506. if ( !elem ) {
  8507. return;
  8508. }
  8509. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8510. // Support: IE <=11 only
  8511. // Running getBoundingClientRect on a
  8512. // disconnected node in IE throws an error
  8513. if ( !elem.getClientRects().length ) {
  8514. return { top: 0, left: 0 };
  8515. }
  8516. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8517. rect = elem.getBoundingClientRect();
  8518. win = elem.ownerDocument.defaultView;
  8519. return {
  8520. top: rect.top + win.pageYOffset,
  8521. left: rect.left + win.pageXOffset
  8522. };
  8523. },
  8524. // position() relates an element's margin box to its offset parent's padding box
  8525. // This corresponds to the behavior of CSS absolute positioning
  8526. position: function() {
  8527. if ( !this[ 0 ] ) {
  8528. return;
  8529. }
  8530. var offsetParent, offset, doc,
  8531. elem = this[ 0 ],
  8532. parentOffset = { top: 0, left: 0 };
  8533. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8534. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8535. // Assume position:fixed implies availability of getBoundingClientRect
  8536. offset = elem.getBoundingClientRect();
  8537. } else {
  8538. offset = this.offset();
  8539. // Account for the *real* offset parent, which can be the document or its root element
  8540. // when a statically positioned element is identified
  8541. doc = elem.ownerDocument;
  8542. offsetParent = elem.offsetParent || doc.documentElement;
  8543. while ( offsetParent &&
  8544. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8545. jQuery.css( offsetParent, "position" ) === "static" ) {
  8546. offsetParent = offsetParent.parentNode;
  8547. }
  8548. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8549. // Incorporate borders into its offset, since they are outside its content origin
  8550. parentOffset = jQuery( offsetParent ).offset();
  8551. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8552. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8553. }
  8554. }
  8555. // Subtract parent offsets and element margins
  8556. return {
  8557. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8558. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8559. };
  8560. },
  8561. // This method will return documentElement in the following cases:
  8562. // 1) For the element inside the iframe without offsetParent, this method will return
  8563. // documentElement of the parent window
  8564. // 2) For the hidden or detached element
  8565. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8566. //
  8567. // but those exceptions were never presented as a real life use-cases
  8568. // and might be considered as more preferable results.
  8569. //
  8570. // This logic, however, is not guaranteed and can change at any point in the future
  8571. offsetParent: function() {
  8572. return this.map( function() {
  8573. var offsetParent = this.offsetParent;
  8574. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8575. offsetParent = offsetParent.offsetParent;
  8576. }
  8577. return offsetParent || documentElement;
  8578. } );
  8579. }
  8580. } );
  8581. // Create scrollLeft and scrollTop methods
  8582. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8583. var top = "pageYOffset" === prop;
  8584. jQuery.fn[ method ] = function( val ) {
  8585. return access( this, function( elem, method, val ) {
  8586. // Coalesce documents and windows
  8587. var win;
  8588. if ( isWindow( elem ) ) {
  8589. win = elem;
  8590. } else if ( elem.nodeType === 9 ) {
  8591. win = elem.defaultView;
  8592. }
  8593. if ( val === undefined ) {
  8594. return win ? win[ prop ] : elem[ method ];
  8595. }
  8596. if ( win ) {
  8597. win.scrollTo(
  8598. !top ? val : win.pageXOffset,
  8599. top ? val : win.pageYOffset
  8600. );
  8601. } else {
  8602. elem[ method ] = val;
  8603. }
  8604. }, method, val, arguments.length );
  8605. };
  8606. } );
  8607. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8608. // Add the top/left cssHooks using jQuery.fn.position
  8609. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8610. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8611. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8612. // rather than make the css module depend on the offset module, just check for it here
  8613. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8614. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8615. function( elem, computed ) {
  8616. if ( computed ) {
  8617. computed = curCSS( elem, prop );
  8618. // If curCSS returns percentage, fallback to offset
  8619. return rnumnonpx.test( computed ) ?
  8620. jQuery( elem ).position()[ prop ] + "px" :
  8621. computed;
  8622. }
  8623. }
  8624. );
  8625. } );
  8626. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8627. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8628. jQuery.each( {
  8629. padding: "inner" + name,
  8630. content: type,
  8631. "": "outer" + name
  8632. }, function( defaultExtra, funcName ) {
  8633. // Margin is only for outerHeight, outerWidth
  8634. jQuery.fn[ funcName ] = function( margin, value ) {
  8635. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8636. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8637. return access( this, function( elem, type, value ) {
  8638. var doc;
  8639. if ( isWindow( elem ) ) {
  8640. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8641. return funcName.indexOf( "outer" ) === 0 ?
  8642. elem[ "inner" + name ] :
  8643. elem.document.documentElement[ "client" + name ];
  8644. }
  8645. // Get document width or height
  8646. if ( elem.nodeType === 9 ) {
  8647. doc = elem.documentElement;
  8648. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8649. // whichever is greatest
  8650. return Math.max(
  8651. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8652. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8653. doc[ "client" + name ]
  8654. );
  8655. }
  8656. return value === undefined ?
  8657. // Get width or height on the element, requesting but not forcing parseFloat
  8658. jQuery.css( elem, type, extra ) :
  8659. // Set width or height on the element
  8660. jQuery.style( elem, type, value, extra );
  8661. }, type, chainable ? margin : undefined, chainable );
  8662. };
  8663. } );
  8664. } );
  8665. jQuery.each( [
  8666. "ajaxStart",
  8667. "ajaxStop",
  8668. "ajaxComplete",
  8669. "ajaxError",
  8670. "ajaxSuccess",
  8671. "ajaxSend"
  8672. ], function( _i, type ) {
  8673. jQuery.fn[ type ] = function( fn ) {
  8674. return this.on( type, fn );
  8675. };
  8676. } );
  8677. jQuery.fn.extend( {
  8678. bind: function( types, data, fn ) {
  8679. return this.on( types, null, data, fn );
  8680. },
  8681. unbind: function( types, fn ) {
  8682. return this.off( types, null, fn );
  8683. },
  8684. delegate: function( selector, types, data, fn ) {
  8685. return this.on( types, selector, data, fn );
  8686. },
  8687. undelegate: function( selector, types, fn ) {
  8688. // ( namespace ) or ( selector, types [, fn] )
  8689. return arguments.length === 1 ?
  8690. this.off( selector, "**" ) :
  8691. this.off( types, selector || "**", fn );
  8692. },
  8693. hover: function( fnOver, fnOut ) {
  8694. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8695. }
  8696. } );
  8697. jQuery.each(
  8698. ( "blur focus focusin focusout resize scroll click dblclick " +
  8699. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8700. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8701. function( _i, name ) {
  8702. // Handle event binding
  8703. jQuery.fn[ name ] = function( data, fn ) {
  8704. return arguments.length > 0 ?
  8705. this.on( name, null, data, fn ) :
  8706. this.trigger( name );
  8707. };
  8708. }
  8709. );
  8710. // Support: Android <=4.0 only
  8711. // Make sure we trim BOM and NBSP
  8712. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  8713. // Bind a function to a context, optionally partially applying any
  8714. // arguments.
  8715. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8716. // However, it is not slated for removal any time soon
  8717. jQuery.proxy = function( fn, context ) {
  8718. var tmp, args, proxy;
  8719. if ( typeof context === "string" ) {
  8720. tmp = fn[ context ];
  8721. context = fn;
  8722. fn = tmp;
  8723. }
  8724. // Quick check to determine if target is callable, in the spec
  8725. // this throws a TypeError, but we will just return undefined.
  8726. if ( !isFunction( fn ) ) {
  8727. return undefined;
  8728. }
  8729. // Simulated bind
  8730. args = slice.call( arguments, 2 );
  8731. proxy = function() {
  8732. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8733. };
  8734. // Set the guid of unique handler to the same of original handler, so it can be removed
  8735. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8736. return proxy;
  8737. };
  8738. jQuery.holdReady = function( hold ) {
  8739. if ( hold ) {
  8740. jQuery.readyWait++;
  8741. } else {
  8742. jQuery.ready( true );
  8743. }
  8744. };
  8745. jQuery.isArray = Array.isArray;
  8746. jQuery.parseJSON = JSON.parse;
  8747. jQuery.nodeName = nodeName;
  8748. jQuery.isFunction = isFunction;
  8749. jQuery.isWindow = isWindow;
  8750. jQuery.camelCase = camelCase;
  8751. jQuery.type = toType;
  8752. jQuery.now = Date.now;
  8753. jQuery.isNumeric = function( obj ) {
  8754. // As of jQuery 3.0, isNumeric is limited to
  8755. // strings and numbers (primitives or objects)
  8756. // that can be coerced to finite numbers (gh-2662)
  8757. var type = jQuery.type( obj );
  8758. return ( type === "number" || type === "string" ) &&
  8759. // parseFloat NaNs numeric-cast false positives ("")
  8760. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8761. // subtraction forces infinities to NaN
  8762. !isNaN( obj - parseFloat( obj ) );
  8763. };
  8764. jQuery.trim = function( text ) {
  8765. return text == null ?
  8766. "" :
  8767. ( text + "" ).replace( rtrim, "" );
  8768. };
  8769. // Register as a named AMD module, since jQuery can be concatenated with other
  8770. // files that may use define, but not via a proper concatenation script that
  8771. // understands anonymous AMD modules. A named AMD is safest and most robust
  8772. // way to register. Lowercase jquery is used because AMD module names are
  8773. // derived from file names, and jQuery is normally delivered in a lowercase
  8774. // file name. Do this after creating the global so that if an AMD module wants
  8775. // to call noConflict to hide this version of jQuery, it will work.
  8776. // Note that for maximum portability, libraries that are not jQuery should
  8777. // declare themselves as anonymous modules, and avoid setting a global if an
  8778. // AMD loader is present. jQuery is a special case. For more information, see
  8779. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8780. if ( typeof define === "function" && define.amd ) {
  8781. define( "jquery", [], function() {
  8782. return jQuery;
  8783. } );
  8784. }
  8785. var
  8786. // Map over jQuery in case of overwrite
  8787. _jQuery = window.jQuery,
  8788. // Map over the $ in case of overwrite
  8789. _$ = window.$;
  8790. jQuery.noConflict = function( deep ) {
  8791. if ( window.$ === jQuery ) {
  8792. window.$ = _$;
  8793. }
  8794. if ( deep && window.jQuery === jQuery ) {
  8795. window.jQuery = _jQuery;
  8796. }
  8797. return jQuery;
  8798. };
  8799. // Expose jQuery and $ identifiers, even in AMD
  8800. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8801. // and CommonJS for browser emulators (#13566)
  8802. if ( typeof noGlobal === "undefined" ) {
  8803. window.jQuery = window.$ = jQuery;
  8804. }
  8805. return jQuery;
  8806. } );