jquery.js 279 KB

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