jquery.js 242 KB

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