jquery.js 278 KB

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