jquery.js 262 KB

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