Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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