jquery.js 282 KB

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