jquery.js 252 KB

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