the bola v2 website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 310KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ "./node_modules/aos/dist/aos.js":
  4. /*!**************************************!*\
  5. !*** ./node_modules/aos/dist/aos.js ***!
  6. \**************************************/
  7. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  8. !function(e,t){ true?module.exports=t():0}(this,function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{},t="Expected a function",n=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,l=u||d||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,b=function(){return l.Date.now()};function v(e,n,o){var i,a,r,c,s,u,d=0,l=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function y(t){var n=i,o=a;return i=a=void 0,d=t,c=e.apply(o,n)}function h(e){var t=e-u;return void 0===u||t>=n||t<0||f&&e-d>=r}function k(){var e=b();if(h(e))return x(e);s=setTimeout(k,function(e){var t=n-(e-u);return f?p(t,r-(e-d)):t}(e))}function x(e){return s=void 0,v&&i?y(e):(i=a=void 0,c)}function O(){var e=b(),t=h(e);if(i=arguments,a=this,u=e,t){if(void 0===s)return function(e){return d=e,s=setTimeout(k,n),l?y(e):c}(u);if(f)return s=setTimeout(k,n),y(u)}return void 0===s&&(s=setTimeout(k,n)),c}return n=w(n)||0,g(o)&&(l=!!o.leading,r=(f="maxWait"in o)?m(w(o.maxWait)||0,n):r,v="trailing"in o?!!o.trailing:v),O.cancel=function(){void 0!==s&&clearTimeout(s),d=0,i=u=a=s=void 0},O.flush=function(){return void 0===s?c:x(b())},O}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return n;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var u=r.test(e);return u||c.test(e)?s(e.slice(2),u?2:8):a.test(e)?n:+e}var y=function(e,n,o){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(t);return g(o)&&(i="leading"in o?!!o.leading:i,a="trailing"in o?!!o.trailing:a),v(e,n,{leading:i,maxWait:n,trailing:a})},h="Expected a function",k=NaN,x="[object Symbol]",O=/^\s+|\s+$/g,j=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,N=/^0o[0-7]+$/i,z=parseInt,C="object"==typeof e&&e&&e.Object===Object&&e,A="object"==typeof self&&self&&self.Object===Object&&self,q=C||A||Function("return this")(),L=Object.prototype.toString,T=Math.max,M=Math.min,S=function(){return q.Date.now()};function D(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function H(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&L.call(e)==x}(e))return k;if(D(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=D(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(O,"");var n=E.test(e);return n||N.test(e)?z(e.slice(2),n?2:8):j.test(e)?k:+e}var $=function(e,t,n){var o,i,a,r,c,s,u=0,d=!1,l=!1,f=!0;if("function"!=typeof e)throw new TypeError(h);function m(t){var n=o,a=i;return o=i=void 0,u=t,r=e.apply(a,n)}function p(e){var n=e-s;return void 0===s||n>=t||n<0||l&&e-u>=a}function b(){var e=S();if(p(e))return v(e);c=setTimeout(b,function(e){var n=t-(e-s);return l?M(n,a-(e-u)):n}(e))}function v(e){return c=void 0,f&&o?m(e):(o=i=void 0,r)}function g(){var e=S(),n=p(e);if(o=arguments,i=this,s=e,n){if(void 0===c)return function(e){return u=e,c=setTimeout(b,t),d?m(e):r}(s);if(l)return c=setTimeout(b,t),m(s)}return void 0===c&&(c=setTimeout(b,t)),r}return t=H(t)||0,D(n)&&(d=!!n.leading,a=(l="maxWait"in n)?T(H(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=s=i=c=void 0},g.flush=function(){return void 0===c?r:v(S())},g},W=function(){};function P(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes);if(function e(t){var n=void 0,o=void 0;for(n=0;n<t.length;n+=1){if((o=t[n]).dataset&&o.dataset.aos)return!0;if(o.children&&e(o.children))return!0}return!1}(t.concat(n)))return W()})}function Y(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var _={isSupported:function(){return!!Y()},ready:function(e,t){var n=window.document,o=new(Y())(P);W=t,o.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},B=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,G=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,J=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,Q=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function R(){return navigator.userAgent||navigator.vendor||window.opera||""}var U=new(function(){function e(){B(this,e)}return F(e,[{key:"phone",value:function(){var e=R();return!(!K.test(e)&&!G.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=R();return!(!J.test(e)&&!Q.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),e}()),V=function(e,t){var n=void 0;return U.ie11()?(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,{detail:t}):n=new CustomEvent(e,{detail:t}),document.dispatchEvent(n)},X=function(e){return e.forEach(function(e,t){return function(e,t){var n=e.options,o=e.position,i=e.node,a=(e.data,function(){e.animated&&(function(e,t){t&&t.forEach(function(t){return e.classList.remove(t)})}(i,n.animatedClassNames),V("aos:out",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!1)});n.mirror&&t>=o.out&&!n.once?a():t>=o.in?e.animated||(function(e,t){t&&t.forEach(function(t){return e.classList.add(t)})}(i,n.animatedClassNames),V("aos:in",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!0):e.animated&&!n.once&&a()}(e,window.pageYOffset)})},Z=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}},ee=function(e,t,n){var o=e.getAttribute("data-aos-"+t);if(void 0!==o){if("true"===o)return!0;if("false"===o)return!1}return o||n},te=function(e,t){return e.forEach(function(e,n){var o=ee(e.node,"mirror",t.mirror),i=ee(e.node,"once",t.once),a=ee(e.node,"id"),r=t.useClassNames&&e.node.getAttribute("data-aos"),c=[t.animatedClassName].concat(r?r.split(" "):[]).filter(function(e){return"string"==typeof e});t.initClassName&&e.node.classList.add(t.initClassName),e.position={in:function(e,t,n){var o=window.innerHeight,i=ee(e,"anchor"),a=ee(e,"anchor-placement"),r=Number(ee(e,"offset",a?0:t)),c=a||n,s=e;i&&document.querySelectorAll(i)&&(s=document.querySelectorAll(i)[0]);var u=Z(s).top-o;switch(c){case"top-bottom":break;case"center-bottom":u+=s.offsetHeight/2;break;case"bottom-bottom":u+=s.offsetHeight;break;case"top-center":u+=o/2;break;case"center-center":u+=o/2+s.offsetHeight/2;break;case"bottom-center":u+=o/2+s.offsetHeight;break;case"top-top":u+=o;break;case"bottom-top":u+=o+s.offsetHeight;break;case"center-top":u+=o+s.offsetHeight/2}return u+r}(e.node,t.offset,t.anchorPlacement),out:o&&function(e,t){window.innerHeight;var n=ee(e,"anchor"),o=ee(e,"offset",t),i=e;return n&&document.querySelectorAll(n)&&(i=document.querySelectorAll(n)[0]),Z(i).top+i.offsetHeight-o}(e.node,t.offset)},e.options={once:i,mirror:o,animatedClassNames:c,id:a}}),e},ne=function(){var e=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(e,function(e){return{node:e}})},oe=[],ie=!1,ae={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},re=function(){return document.all&&!window.atob},ce=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(ie=!0),ie&&(oe=te(oe,ae),X(oe),window.addEventListener("scroll",y(function(){X(oe,ae.once)},ae.throttleDelay)))},se=function(){if(oe=ne(),de(ae.disable)||re())return ue();ce()},ue=function(){oe.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay"),ae.initClassName&&e.node.classList.remove(ae.initClassName),ae.animatedClassName&&e.node.classList.remove(ae.animatedClassName)})},de=function(e){return!0===e||"mobile"===e&&U.mobile()||"phone"===e&&U.phone()||"tablet"===e&&U.tablet()||"function"==typeof e&&!0===e()};return{init:function(e){return ae=I(ae,e),oe=ne(),ae.disableMutationObserver||_.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),ae.disableMutationObserver=!0),ae.disableMutationObserver||_.ready("[data-aos]",se),de(ae.disable)||re()?ue():(document.querySelector("body").setAttribute("data-aos-easing",ae.easing),document.querySelector("body").setAttribute("data-aos-duration",ae.duration),document.querySelector("body").setAttribute("data-aos-delay",ae.delay),-1===["DOMContentLoaded","load"].indexOf(ae.startEvent)?document.addEventListener(ae.startEvent,function(){ce(!0)}):window.addEventListener("load",function(){ce(!0)}),"DOMContentLoaded"===ae.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1&&ce(!0),window.addEventListener("resize",$(ce,ae.debounceDelay,!0)),window.addEventListener("orientationchange",$(ce,ae.debounceDelay,!0)),oe)},refresh:ce,refreshHard:se}});
  9. /***/ }),
  10. /***/ "./resources/js/api/api.js":
  11. /*!*********************************!*\
  12. !*** ./resources/js/api/api.js ***!
  13. \*********************************/
  14. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  15. "use strict";
  16. __webpack_require__.r(__webpack_exports__);
  17. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18. /* harmony export */ "default": () => (/* binding */ API)
  19. /* harmony export */ });
  20. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
  21. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
  23. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  24. function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
  25. function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
  26. var server_url = "https://thebola.club";
  27. var API = /*#__PURE__*/function () {
  28. function API() {
  29. _classCallCheck(this, API);
  30. this.prefix = server_url;
  31. this.url = "/api";
  32. this.test = 200;
  33. }
  34. _createClass(API, [{
  35. key: "listState",
  36. value: function listState(_ref) {
  37. var _ref$_callback = _ref._callback,
  38. _callback = _ref$_callback === void 0 ? function () {} : _ref$_callback;
  39. var url = "".concat(this.prefix).concat(this.url, "/public/event/location/state");
  40. fetch(url).then(function (response) {
  41. return response.json();
  42. }).then(function (data) {
  43. return _callback(data);
  44. })["catch"](function (err) {
  45. return console.log(err);
  46. });
  47. }
  48. }, {
  49. key: "listLocation",
  50. value: function listLocation(_ref2) {
  51. var state = _ref2.state,
  52. city = _ref2.city,
  53. _ref2$_callback = _ref2._callback,
  54. _callback = _ref2$_callback === void 0 ? function () {} : _ref2$_callback;
  55. var url = "".concat(this.prefix).concat(this.url, "/public/event/location/field?") + new URLSearchParams({
  56. state: state,
  57. city: city
  58. });
  59. fetch(url).then(function (response) {
  60. return response.json();
  61. }).then(function (data) {
  62. return _callback(data);
  63. })["catch"](function (err) {
  64. return console.log(err);
  65. });
  66. }
  67. }, {
  68. key: "listField",
  69. value: function listField(_ref3) {
  70. var state = _ref3.state,
  71. city = _ref3.city,
  72. field_name = _ref3.field_name,
  73. _ref3$_callback = _ref3._callback,
  74. _callback = _ref3$_callback === void 0 ? function () {} : _ref3$_callback;
  75. var url = "".concat(this.prefix).concat(this.url, "/public/event/location?") + new URLSearchParams({
  76. state: state,
  77. city: city,
  78. field_name: field_name
  79. });
  80. fetch(url).then(function (response) {
  81. return response.json();
  82. }).then(function (data) {
  83. return _callback(data);
  84. })["catch"](function (err) {
  85. return console.log(err);
  86. });
  87. }
  88. }, {
  89. key: "enquiry",
  90. value: function enquiry(_ref4, _callback) {
  91. var email = _ref4.email,
  92. name = _ref4.name,
  93. message = _ref4.message;
  94. var url = "".concat(this.prefix).concat(this.url, "/public/enquiry");
  95. fetch(url, {
  96. method: "POST",
  97. headers: {
  98. 'Content-Type': 'application/json;charset=utf-8'
  99. },
  100. body: JSON.stringify({
  101. contact_email: email,
  102. contact_name: name,
  103. message: message
  104. })
  105. }).then(function (response) {
  106. return response.json();
  107. }).then(function (data) {
  108. return _callback(data);
  109. })["catch"](function (err) {
  110. return console.log(err);
  111. });
  112. }
  113. }]);
  114. return API;
  115. }();
  116. /***/ }),
  117. /***/ "./node_modules/jquery/dist/jquery.js":
  118. /*!********************************************!*\
  119. !*** ./node_modules/jquery/dist/jquery.js ***!
  120. \********************************************/
  121. /***/ (function(module, exports) {
  122. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  123. * jQuery JavaScript Library v3.7.1
  124. * https://jquery.com/
  125. *
  126. * Copyright OpenJS Foundation and other contributors
  127. * Released under the MIT license
  128. * https://jquery.org/license
  129. *
  130. * Date: 2023-08-28T13:37Z
  131. */
  132. ( function( global, factory ) {
  133. "use strict";
  134. if ( true && typeof module.exports === "object" ) {
  135. // For CommonJS and CommonJS-like environments where a proper `window`
  136. // is present, execute the factory and get jQuery.
  137. // For environments that do not have a `window` with a `document`
  138. // (such as Node.js), expose a factory as module.exports.
  139. // This accentuates the need for the creation of a real `window`.
  140. // e.g. var jQuery = require("jquery")(window);
  141. // See ticket trac-14549 for more info.
  142. module.exports = global.document ?
  143. factory( global, true ) :
  144. function( w ) {
  145. if ( !w.document ) {
  146. throw new Error( "jQuery requires a window with a document" );
  147. }
  148. return factory( w );
  149. };
  150. } else {
  151. factory( global );
  152. }
  153. // Pass this if window is not defined yet
  154. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  155. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  156. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  157. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  158. // enough that all such attempts are guarded in a try block.
  159. "use strict";
  160. var arr = [];
  161. var getProto = Object.getPrototypeOf;
  162. var slice = arr.slice;
  163. var flat = arr.flat ? function( array ) {
  164. return arr.flat.call( array );
  165. } : function( array ) {
  166. return arr.concat.apply( [], array );
  167. };
  168. var push = arr.push;
  169. var indexOf = arr.indexOf;
  170. var class2type = {};
  171. var toString = class2type.toString;
  172. var hasOwn = class2type.hasOwnProperty;
  173. var fnToString = hasOwn.toString;
  174. var ObjectFunctionString = fnToString.call( Object );
  175. var support = {};
  176. var isFunction = function isFunction( obj ) {
  177. // Support: Chrome <=57, Firefox <=52
  178. // In some browsers, typeof returns "function" for HTML <object> elements
  179. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  180. // We don't want to classify *any* DOM node as a function.
  181. // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
  182. // Plus for old WebKit, typeof returns "function" for HTML collections
  183. // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
  184. return typeof obj === "function" && typeof obj.nodeType !== "number" &&
  185. typeof obj.item !== "function";
  186. };
  187. var isWindow = function isWindow( obj ) {
  188. return obj != null && obj === obj.window;
  189. };
  190. var document = window.document;
  191. var preservedScriptAttributes = {
  192. type: true,
  193. src: true,
  194. nonce: true,
  195. noModule: true
  196. };
  197. function DOMEval( code, node, doc ) {
  198. doc = doc || document;
  199. var i, val,
  200. script = doc.createElement( "script" );
  201. script.text = code;
  202. if ( node ) {
  203. for ( i in preservedScriptAttributes ) {
  204. // Support: Firefox 64+, Edge 18+
  205. // Some browsers don't support the "nonce" property on scripts.
  206. // On the other hand, just using `getAttribute` is not enough as
  207. // the `nonce` attribute is reset to an empty string whenever it
  208. // becomes browsing-context connected.
  209. // See https://github.com/whatwg/html/issues/2369
  210. // See https://html.spec.whatwg.org/#nonce-attributes
  211. // The `node.getAttribute` check was added for the sake of
  212. // `jQuery.globalEval` so that it can fake a nonce-containing node
  213. // via an object.
  214. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  215. if ( val ) {
  216. script.setAttribute( i, val );
  217. }
  218. }
  219. }
  220. doc.head.appendChild( script ).parentNode.removeChild( script );
  221. }
  222. function toType( obj ) {
  223. if ( obj == null ) {
  224. return obj + "";
  225. }
  226. // Support: Android <=2.3 only (functionish RegExp)
  227. return typeof obj === "object" || typeof obj === "function" ?
  228. class2type[ toString.call( obj ) ] || "object" :
  229. typeof obj;
  230. }
  231. /* global Symbol */
  232. // Defining this global in .eslintrc.json would create a danger of using the global
  233. // unguarded in another place, it seems safer to define global only for this module
  234. var version = "3.7.1",
  235. rhtmlSuffix = /HTML$/i,
  236. // Define a local copy of jQuery
  237. jQuery = function( selector, context ) {
  238. // The jQuery object is actually just the init constructor 'enhanced'
  239. // Need init if jQuery is called (just allow error to be thrown if not included)
  240. return new jQuery.fn.init( selector, context );
  241. };
  242. jQuery.fn = jQuery.prototype = {
  243. // The current version of jQuery being used
  244. jquery: version,
  245. constructor: jQuery,
  246. // The default length of a jQuery object is 0
  247. length: 0,
  248. toArray: function() {
  249. return slice.call( this );
  250. },
  251. // Get the Nth element in the matched element set OR
  252. // Get the whole matched element set as a clean array
  253. get: function( num ) {
  254. // Return all the elements in a clean array
  255. if ( num == null ) {
  256. return slice.call( this );
  257. }
  258. // Return just the one element from the set
  259. return num < 0 ? this[ num + this.length ] : this[ num ];
  260. },
  261. // Take an array of elements and push it onto the stack
  262. // (returning the new matched element set)
  263. pushStack: function( elems ) {
  264. // Build a new jQuery matched element set
  265. var ret = jQuery.merge( this.constructor(), elems );
  266. // Add the old object onto the stack (as a reference)
  267. ret.prevObject = this;
  268. // Return the newly-formed element set
  269. return ret;
  270. },
  271. // Execute a callback for every element in the matched set.
  272. each: function( callback ) {
  273. return jQuery.each( this, callback );
  274. },
  275. map: function( callback ) {
  276. return this.pushStack( jQuery.map( this, function( elem, i ) {
  277. return callback.call( elem, i, elem );
  278. } ) );
  279. },
  280. slice: function() {
  281. return this.pushStack( slice.apply( this, arguments ) );
  282. },
  283. first: function() {
  284. return this.eq( 0 );
  285. },
  286. last: function() {
  287. return this.eq( -1 );
  288. },
  289. even: function() {
  290. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  291. return ( i + 1 ) % 2;
  292. } ) );
  293. },
  294. odd: function() {
  295. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  296. return i % 2;
  297. } ) );
  298. },
  299. eq: function( i ) {
  300. var len = this.length,
  301. j = +i + ( i < 0 ? len : 0 );
  302. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  303. },
  304. end: function() {
  305. return this.prevObject || this.constructor();
  306. },
  307. // For internal use only.
  308. // Behaves like an Array's method, not like a jQuery method.
  309. push: push,
  310. sort: arr.sort,
  311. splice: arr.splice
  312. };
  313. jQuery.extend = jQuery.fn.extend = function() {
  314. var options, name, src, copy, copyIsArray, clone,
  315. target = arguments[ 0 ] || {},
  316. i = 1,
  317. length = arguments.length,
  318. deep = false;
  319. // Handle a deep copy situation
  320. if ( typeof target === "boolean" ) {
  321. deep = target;
  322. // Skip the boolean and the target
  323. target = arguments[ i ] || {};
  324. i++;
  325. }
  326. // Handle case when target is a string or something (possible in deep copy)
  327. if ( typeof target !== "object" && !isFunction( target ) ) {
  328. target = {};
  329. }
  330. // Extend jQuery itself if only one argument is passed
  331. if ( i === length ) {
  332. target = this;
  333. i--;
  334. }
  335. for ( ; i < length; i++ ) {
  336. // Only deal with non-null/undefined values
  337. if ( ( options = arguments[ i ] ) != null ) {
  338. // Extend the base object
  339. for ( name in options ) {
  340. copy = options[ name ];
  341. // Prevent Object.prototype pollution
  342. // Prevent never-ending loop
  343. if ( name === "__proto__" || target === copy ) {
  344. continue;
  345. }
  346. // Recurse if we're merging plain objects or arrays
  347. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  348. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  349. src = target[ name ];
  350. // Ensure proper type for the source value
  351. if ( copyIsArray && !Array.isArray( src ) ) {
  352. clone = [];
  353. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  354. clone = {};
  355. } else {
  356. clone = src;
  357. }
  358. copyIsArray = false;
  359. // Never move original objects, clone them
  360. target[ name ] = jQuery.extend( deep, clone, copy );
  361. // Don't bring in undefined values
  362. } else if ( copy !== undefined ) {
  363. target[ name ] = copy;
  364. }
  365. }
  366. }
  367. }
  368. // Return the modified object
  369. return target;
  370. };
  371. jQuery.extend( {
  372. // Unique for each copy of jQuery on the page
  373. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  374. // Assume jQuery is ready without the ready module
  375. isReady: true,
  376. error: function( msg ) {
  377. throw new Error( msg );
  378. },
  379. noop: function() {},
  380. isPlainObject: function( obj ) {
  381. var proto, Ctor;
  382. // Detect obvious negatives
  383. // Use toString instead of jQuery.type to catch host objects
  384. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  385. return false;
  386. }
  387. proto = getProto( obj );
  388. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  389. if ( !proto ) {
  390. return true;
  391. }
  392. // Objects with prototype are plain iff they were constructed by a global Object function
  393. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  394. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  395. },
  396. isEmptyObject: function( obj ) {
  397. var name;
  398. for ( name in obj ) {
  399. return false;
  400. }
  401. return true;
  402. },
  403. // Evaluates a script in a provided context; falls back to the global one
  404. // if not specified.
  405. globalEval: function( code, options, doc ) {
  406. DOMEval( code, { nonce: options && options.nonce }, doc );
  407. },
  408. each: function( obj, callback ) {
  409. var length, i = 0;
  410. if ( isArrayLike( obj ) ) {
  411. length = obj.length;
  412. for ( ; i < length; i++ ) {
  413. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  414. break;
  415. }
  416. }
  417. } else {
  418. for ( i in obj ) {
  419. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  420. break;
  421. }
  422. }
  423. }
  424. return obj;
  425. },
  426. // Retrieve the text value of an array of DOM nodes
  427. text: function( elem ) {
  428. var node,
  429. ret = "",
  430. i = 0,
  431. nodeType = elem.nodeType;
  432. if ( !nodeType ) {
  433. // If no nodeType, this is expected to be an array
  434. while ( ( node = elem[ i++ ] ) ) {
  435. // Do not traverse comment nodes
  436. ret += jQuery.text( node );
  437. }
  438. }
  439. if ( nodeType === 1 || nodeType === 11 ) {
  440. return elem.textContent;
  441. }
  442. if ( nodeType === 9 ) {
  443. return elem.documentElement.textContent;
  444. }
  445. if ( nodeType === 3 || nodeType === 4 ) {
  446. return elem.nodeValue;
  447. }
  448. // Do not include comment or processing instruction nodes
  449. return ret;
  450. },
  451. // results is for internal usage only
  452. makeArray: function( arr, results ) {
  453. var ret = results || [];
  454. if ( arr != null ) {
  455. if ( isArrayLike( Object( arr ) ) ) {
  456. jQuery.merge( ret,
  457. typeof arr === "string" ?
  458. [ arr ] : arr
  459. );
  460. } else {
  461. push.call( ret, arr );
  462. }
  463. }
  464. return ret;
  465. },
  466. inArray: function( elem, arr, i ) {
  467. return arr == null ? -1 : indexOf.call( arr, elem, i );
  468. },
  469. isXMLDoc: function( elem ) {
  470. var namespace = elem && elem.namespaceURI,
  471. docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  472. // Assume HTML when documentElement doesn't yet exist, such as inside
  473. // document fragments.
  474. return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
  475. },
  476. // Support: Android <=4.0 only, PhantomJS 1 only
  477. // push.apply(_, arraylike) throws on ancient WebKit
  478. merge: function( first, second ) {
  479. var len = +second.length,
  480. j = 0,
  481. i = first.length;
  482. for ( ; j < len; j++ ) {
  483. first[ i++ ] = second[ j ];
  484. }
  485. first.length = i;
  486. return first;
  487. },
  488. grep: function( elems, callback, invert ) {
  489. var callbackInverse,
  490. matches = [],
  491. i = 0,
  492. length = elems.length,
  493. callbackExpect = !invert;
  494. // Go through the array, only saving the items
  495. // that pass the validator function
  496. for ( ; i < length; i++ ) {
  497. callbackInverse = !callback( elems[ i ], i );
  498. if ( callbackInverse !== callbackExpect ) {
  499. matches.push( elems[ i ] );
  500. }
  501. }
  502. return matches;
  503. },
  504. // arg is for internal usage only
  505. map: function( elems, callback, arg ) {
  506. var length, value,
  507. i = 0,
  508. ret = [];
  509. // Go through the array, translating each of the items to their new values
  510. if ( isArrayLike( elems ) ) {
  511. length = elems.length;
  512. for ( ; i < length; i++ ) {
  513. value = callback( elems[ i ], i, arg );
  514. if ( value != null ) {
  515. ret.push( value );
  516. }
  517. }
  518. // Go through every key on the object,
  519. } else {
  520. for ( i in elems ) {
  521. value = callback( elems[ i ], i, arg );
  522. if ( value != null ) {
  523. ret.push( value );
  524. }
  525. }
  526. }
  527. // Flatten any nested arrays
  528. return flat( ret );
  529. },
  530. // A global GUID counter for objects
  531. guid: 1,
  532. // jQuery.support is not used in Core but other projects attach their
  533. // properties to it so it needs to exist.
  534. support: support
  535. } );
  536. if ( typeof Symbol === "function" ) {
  537. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  538. }
  539. // Populate the class2type map
  540. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  541. function( _i, name ) {
  542. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  543. } );
  544. function isArrayLike( obj ) {
  545. // Support: real iOS 8.2 only (not reproducible in simulator)
  546. // `in` check used to prevent JIT error (gh-2145)
  547. // hasOwn isn't used here due to false negatives
  548. // regarding Nodelist length in IE
  549. var length = !!obj && "length" in obj && obj.length,
  550. type = toType( obj );
  551. if ( isFunction( obj ) || isWindow( obj ) ) {
  552. return false;
  553. }
  554. return type === "array" || length === 0 ||
  555. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  556. }
  557. function nodeName( elem, name ) {
  558. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  559. }
  560. var pop = arr.pop;
  561. var sort = arr.sort;
  562. var splice = arr.splice;
  563. var whitespace = "[\\x20\\t\\r\\n\\f]";
  564. var rtrimCSS = new RegExp(
  565. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  566. "g"
  567. );
  568. // Note: an element does not contain itself
  569. jQuery.contains = function( a, b ) {
  570. var bup = b && b.parentNode;
  571. return a === bup || !!( bup && bup.nodeType === 1 && (
  572. // Support: IE 9 - 11+
  573. // IE doesn't have `contains` on SVG.
  574. a.contains ?
  575. a.contains( bup ) :
  576. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  577. ) );
  578. };
  579. // CSS string/identifier serialization
  580. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  581. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  582. function fcssescape( ch, asCodePoint ) {
  583. if ( asCodePoint ) {
  584. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  585. if ( ch === "\0" ) {
  586. return "\uFFFD";
  587. }
  588. // Control characters and (dependent upon position) numbers get escaped as code points
  589. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  590. }
  591. // Other potentially-special ASCII characters get backslash-escaped
  592. return "\\" + ch;
  593. }
  594. jQuery.escapeSelector = function( sel ) {
  595. return ( sel + "" ).replace( rcssescape, fcssescape );
  596. };
  597. var preferredDoc = document,
  598. pushNative = push;
  599. ( function() {
  600. var i,
  601. Expr,
  602. outermostContext,
  603. sortInput,
  604. hasDuplicate,
  605. push = pushNative,
  606. // Local document vars
  607. document,
  608. documentElement,
  609. documentIsHTML,
  610. rbuggyQSA,
  611. matches,
  612. // Instance-specific data
  613. expando = jQuery.expando,
  614. dirruns = 0,
  615. done = 0,
  616. classCache = createCache(),
  617. tokenCache = createCache(),
  618. compilerCache = createCache(),
  619. nonnativeSelectorCache = createCache(),
  620. sortOrder = function( a, b ) {
  621. if ( a === b ) {
  622. hasDuplicate = true;
  623. }
  624. return 0;
  625. },
  626. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
  627. "loop|multiple|open|readonly|required|scoped",
  628. // Regular expressions
  629. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  630. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  631. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  632. // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
  633. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  634. // Operator (capture 2)
  635. "*([*^$|!~]?=)" + whitespace +
  636. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  637. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  638. whitespace + "*\\]",
  639. pseudos = ":(" + identifier + ")(?:\\((" +
  640. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  641. // 1. quoted (capture 3; capture 4 or capture 5)
  642. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  643. // 2. simple (capture 6)
  644. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  645. // 3. anything else (capture 2)
  646. ".*" +
  647. ")\\)|)",
  648. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  649. rwhitespace = new RegExp( whitespace + "+", "g" ),
  650. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  651. rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
  652. whitespace + "*" ),
  653. rdescend = new RegExp( whitespace + "|>" ),
  654. rpseudo = new RegExp( pseudos ),
  655. ridentifier = new RegExp( "^" + identifier + "$" ),
  656. matchExpr = {
  657. ID: new RegExp( "^#(" + identifier + ")" ),
  658. CLASS: new RegExp( "^\\.(" + identifier + ")" ),
  659. TAG: new RegExp( "^(" + identifier + "|[*])" ),
  660. ATTR: new RegExp( "^" + attributes ),
  661. PSEUDO: new RegExp( "^" + pseudos ),
  662. CHILD: new RegExp(
  663. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  664. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  665. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  666. bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
  667. // For use in libraries implementing .is()
  668. // We use this for POS matching in `select`
  669. needsContext: new RegExp( "^" + whitespace +
  670. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  671. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  672. },
  673. rinputs = /^(?:input|select|textarea|button)$/i,
  674. rheader = /^h\d$/i,
  675. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  676. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  677. rsibling = /[+~]/,
  678. // CSS escapes
  679. // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  680. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
  681. "?|\\\\([^\\r\\n\\f])", "g" ),
  682. funescape = function( escape, nonHex ) {
  683. var high = "0x" + escape.slice( 1 ) - 0x10000;
  684. if ( nonHex ) {
  685. // Strip the backslash prefix from a non-hex escape sequence
  686. return nonHex;
  687. }
  688. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  689. // Support: IE <=11+
  690. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  691. // surrogate pair
  692. return high < 0 ?
  693. String.fromCharCode( high + 0x10000 ) :
  694. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  695. },
  696. // Used for iframes; see `setDocument`.
  697. // Support: IE 9 - 11+, Edge 12 - 18+
  698. // Removing the function wrapper causes a "Permission Denied"
  699. // error in IE/Edge.
  700. unloadHandler = function() {
  701. setDocument();
  702. },
  703. inDisabledFieldset = addCombinator(
  704. function( elem ) {
  705. return elem.disabled === true && nodeName( elem, "fieldset" );
  706. },
  707. { dir: "parentNode", next: "legend" }
  708. );
  709. // Support: IE <=9 only
  710. // Accessing document.activeElement can throw unexpectedly
  711. // https://bugs.jquery.com/ticket/13393
  712. function safeActiveElement() {
  713. try {
  714. return document.activeElement;
  715. } catch ( err ) { }
  716. }
  717. // Optimize for push.apply( _, NodeList )
  718. try {
  719. push.apply(
  720. ( arr = slice.call( preferredDoc.childNodes ) ),
  721. preferredDoc.childNodes
  722. );
  723. // Support: Android <=4.0
  724. // Detect silently failing push.apply
  725. // eslint-disable-next-line no-unused-expressions
  726. arr[ preferredDoc.childNodes.length ].nodeType;
  727. } catch ( e ) {
  728. push = {
  729. apply: function( target, els ) {
  730. pushNative.apply( target, slice.call( els ) );
  731. },
  732. call: function( target ) {
  733. pushNative.apply( target, slice.call( arguments, 1 ) );
  734. }
  735. };
  736. }
  737. function find( selector, context, results, seed ) {
  738. var m, i, elem, nid, match, groups, newSelector,
  739. newContext = context && context.ownerDocument,
  740. // nodeType defaults to 9, since context defaults to document
  741. nodeType = context ? context.nodeType : 9;
  742. results = results || [];
  743. // Return early from calls with invalid selector or context
  744. if ( typeof selector !== "string" || !selector ||
  745. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  746. return results;
  747. }
  748. // Try to shortcut find operations (as opposed to filters) in HTML documents
  749. if ( !seed ) {
  750. setDocument( context );
  751. context = context || document;
  752. if ( documentIsHTML ) {
  753. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  754. // (excepting DocumentFragment context, where the methods don't exist)
  755. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  756. // ID selector
  757. if ( ( m = match[ 1 ] ) ) {
  758. // Document context
  759. if ( nodeType === 9 ) {
  760. if ( ( elem = context.getElementById( m ) ) ) {
  761. // Support: IE 9 only
  762. // getElementById can match elements by name instead of ID
  763. if ( elem.id === m ) {
  764. push.call( results, elem );
  765. return results;
  766. }
  767. } else {
  768. return results;
  769. }
  770. // Element context
  771. } else {
  772. // Support: IE 9 only
  773. // getElementById can match elements by name instead of ID
  774. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  775. find.contains( context, elem ) &&
  776. elem.id === m ) {
  777. push.call( results, elem );
  778. return results;
  779. }
  780. }
  781. // Type selector
  782. } else if ( match[ 2 ] ) {
  783. push.apply( results, context.getElementsByTagName( selector ) );
  784. return results;
  785. // Class selector
  786. } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
  787. push.apply( results, context.getElementsByClassName( m ) );
  788. return results;
  789. }
  790. }
  791. // Take advantage of querySelectorAll
  792. if ( !nonnativeSelectorCache[ selector + " " ] &&
  793. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
  794. newSelector = selector;
  795. newContext = context;
  796. // qSA considers elements outside a scoping root when evaluating child or
  797. // descendant combinators, which is not what we want.
  798. // In such cases, we work around the behavior by prefixing every selector in the
  799. // list with an ID selector referencing the scope context.
  800. // The technique has to be used as well when a leading combinator is used
  801. // as such selectors are not recognized by querySelectorAll.
  802. // Thanks to Andrew Dupont for this technique.
  803. if ( nodeType === 1 &&
  804. ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
  805. // Expand context for sibling selectors
  806. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  807. context;
  808. // We can use :scope instead of the ID hack if the browser
  809. // supports it & if we're not changing the context.
  810. // Support: IE 11+, Edge 17 - 18+
  811. // IE/Edge sometimes throw a "Permission denied" error when
  812. // strict-comparing two documents; shallow comparisons work.
  813. // eslint-disable-next-line eqeqeq
  814. if ( newContext != context || !support.scope ) {
  815. // Capture the context ID, setting it first if necessary
  816. if ( ( nid = context.getAttribute( "id" ) ) ) {
  817. nid = jQuery.escapeSelector( nid );
  818. } else {
  819. context.setAttribute( "id", ( nid = expando ) );
  820. }
  821. }
  822. // Prefix every selector in the list
  823. groups = tokenize( selector );
  824. i = groups.length;
  825. while ( i-- ) {
  826. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  827. toSelector( groups[ i ] );
  828. }
  829. newSelector = groups.join( "," );
  830. }
  831. try {
  832. push.apply( results,
  833. newContext.querySelectorAll( newSelector )
  834. );
  835. return results;
  836. } catch ( qsaError ) {
  837. nonnativeSelectorCache( selector, true );
  838. } finally {
  839. if ( nid === expando ) {
  840. context.removeAttribute( "id" );
  841. }
  842. }
  843. }
  844. }
  845. }
  846. // All others
  847. return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
  848. }
  849. /**
  850. * Create key-value caches of limited size
  851. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  852. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  853. * deleting the oldest entry
  854. */
  855. function createCache() {
  856. var keys = [];
  857. function cache( key, value ) {
  858. // Use (key + " ") to avoid collision with native prototype properties
  859. // (see https://github.com/jquery/sizzle/issues/157)
  860. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  861. // Only keep the most recent entries
  862. delete cache[ keys.shift() ];
  863. }
  864. return ( cache[ key + " " ] = value );
  865. }
  866. return cache;
  867. }
  868. /**
  869. * Mark a function for special use by jQuery selector module
  870. * @param {Function} fn The function to mark
  871. */
  872. function markFunction( fn ) {
  873. fn[ expando ] = true;
  874. return fn;
  875. }
  876. /**
  877. * Support testing using an element
  878. * @param {Function} fn Passed the created element and returns a boolean result
  879. */
  880. function assert( fn ) {
  881. var el = document.createElement( "fieldset" );
  882. try {
  883. return !!fn( el );
  884. } catch ( e ) {
  885. return false;
  886. } finally {
  887. // Remove from its parent by default
  888. if ( el.parentNode ) {
  889. el.parentNode.removeChild( el );
  890. }
  891. // release memory in IE
  892. el = null;
  893. }
  894. }
  895. /**
  896. * Returns a function to use in pseudos for input types
  897. * @param {String} type
  898. */
  899. function createInputPseudo( type ) {
  900. return function( elem ) {
  901. return nodeName( elem, "input" ) && elem.type === type;
  902. };
  903. }
  904. /**
  905. * Returns a function to use in pseudos for buttons
  906. * @param {String} type
  907. */
  908. function createButtonPseudo( type ) {
  909. return function( elem ) {
  910. return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
  911. elem.type === type;
  912. };
  913. }
  914. /**
  915. * Returns a function to use in pseudos for :enabled/:disabled
  916. * @param {Boolean} disabled true for :disabled; false for :enabled
  917. */
  918. function createDisabledPseudo( disabled ) {
  919. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  920. return function( elem ) {
  921. // Only certain elements can match :enabled or :disabled
  922. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  923. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  924. if ( "form" in elem ) {
  925. // Check for inherited disabledness on relevant non-disabled elements:
  926. // * listed form-associated elements in a disabled fieldset
  927. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  928. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  929. // * option elements in a disabled optgroup
  930. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  931. // All such elements have a "form" property.
  932. if ( elem.parentNode && elem.disabled === false ) {
  933. // Option elements defer to a parent optgroup if present
  934. if ( "label" in elem ) {
  935. if ( "label" in elem.parentNode ) {
  936. return elem.parentNode.disabled === disabled;
  937. } else {
  938. return elem.disabled === disabled;
  939. }
  940. }
  941. // Support: IE 6 - 11+
  942. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  943. return elem.isDisabled === disabled ||
  944. // Where there is no isDisabled, check manually
  945. elem.isDisabled !== !disabled &&
  946. inDisabledFieldset( elem ) === disabled;
  947. }
  948. return elem.disabled === disabled;
  949. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  950. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  951. // even exist on them, let alone have a boolean value.
  952. } else if ( "label" in elem ) {
  953. return elem.disabled === disabled;
  954. }
  955. // Remaining elements are neither :enabled nor :disabled
  956. return false;
  957. };
  958. }
  959. /**
  960. * Returns a function to use in pseudos for positionals
  961. * @param {Function} fn
  962. */
  963. function createPositionalPseudo( fn ) {
  964. return markFunction( function( argument ) {
  965. argument = +argument;
  966. return markFunction( function( seed, matches ) {
  967. var j,
  968. matchIndexes = fn( [], seed.length, argument ),
  969. i = matchIndexes.length;
  970. // Match elements found at the specified indexes
  971. while ( i-- ) {
  972. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  973. seed[ j ] = !( matches[ j ] = seed[ j ] );
  974. }
  975. }
  976. } );
  977. } );
  978. }
  979. /**
  980. * Checks a node for validity as a jQuery selector context
  981. * @param {Element|Object=} context
  982. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  983. */
  984. function testContext( context ) {
  985. return context && typeof context.getElementsByTagName !== "undefined" && context;
  986. }
  987. /**
  988. * Sets document-related variables once based on the current document
  989. * @param {Element|Object} [node] An element or document object to use to set the document
  990. * @returns {Object} Returns the current document
  991. */
  992. function setDocument( node ) {
  993. var subWindow,
  994. doc = node ? node.ownerDocument || node : preferredDoc;
  995. // Return early if doc is invalid or already selected
  996. // Support: IE 11+, Edge 17 - 18+
  997. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  998. // two documents; shallow comparisons work.
  999. // eslint-disable-next-line eqeqeq
  1000. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  1001. return document;
  1002. }
  1003. // Update global variables
  1004. document = doc;
  1005. documentElement = document.documentElement;
  1006. documentIsHTML = !jQuery.isXMLDoc( document );
  1007. // Support: iOS 7 only, IE 9 - 11+
  1008. // Older browsers didn't support unprefixed `matches`.
  1009. matches = documentElement.matches ||
  1010. documentElement.webkitMatchesSelector ||
  1011. documentElement.msMatchesSelector;
  1012. // Support: IE 9 - 11+, Edge 12 - 18+
  1013. // Accessing iframe documents after unload throws "permission denied" errors
  1014. // (see trac-13936).
  1015. // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,
  1016. // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.
  1017. if ( documentElement.msMatchesSelector &&
  1018. // Support: IE 11+, Edge 17 - 18+
  1019. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1020. // two documents; shallow comparisons work.
  1021. // eslint-disable-next-line eqeqeq
  1022. preferredDoc != document &&
  1023. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  1024. // Support: IE 9 - 11+, Edge 12 - 18+
  1025. subWindow.addEventListener( "unload", unloadHandler );
  1026. }
  1027. // Support: IE <10
  1028. // Check if getElementById returns elements by name
  1029. // The broken getElementById methods don't pick up programmatically-set names,
  1030. // so use a roundabout getElementsByName test
  1031. support.getById = assert( function( el ) {
  1032. documentElement.appendChild( el ).id = jQuery.expando;
  1033. return !document.getElementsByName ||
  1034. !document.getElementsByName( jQuery.expando ).length;
  1035. } );
  1036. // Support: IE 9 only
  1037. // Check to see if it's possible to do matchesSelector
  1038. // on a disconnected node.
  1039. support.disconnectedMatch = assert( function( el ) {
  1040. return matches.call( el, "*" );
  1041. } );
  1042. // Support: IE 9 - 11+, Edge 12 - 18+
  1043. // IE/Edge don't support the :scope pseudo-class.
  1044. support.scope = assert( function() {
  1045. return document.querySelectorAll( ":scope" );
  1046. } );
  1047. // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
  1048. // Make sure the `:has()` argument is parsed unforgivingly.
  1049. // We include `*` in the test to detect buggy implementations that are
  1050. // _selectively_ forgiving (specifically when the list includes at least
  1051. // one valid selector).
  1052. // Note that we treat complete lack of support for `:has()` as if it were
  1053. // spec-compliant support, which is fine because use of `:has()` in such
  1054. // environments will fail in the qSA path and fall back to jQuery traversal
  1055. // anyway.
  1056. support.cssHas = assert( function() {
  1057. try {
  1058. document.querySelector( ":has(*,:jqfake)" );
  1059. return false;
  1060. } catch ( e ) {
  1061. return true;
  1062. }
  1063. } );
  1064. // ID filter and find
  1065. if ( support.getById ) {
  1066. Expr.filter.ID = function( id ) {
  1067. var attrId = id.replace( runescape, funescape );
  1068. return function( elem ) {
  1069. return elem.getAttribute( "id" ) === attrId;
  1070. };
  1071. };
  1072. Expr.find.ID = function( id, context ) {
  1073. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1074. var elem = context.getElementById( id );
  1075. return elem ? [ elem ] : [];
  1076. }
  1077. };
  1078. } else {
  1079. Expr.filter.ID = function( id ) {
  1080. var attrId = id.replace( runescape, funescape );
  1081. return function( elem ) {
  1082. var node = typeof elem.getAttributeNode !== "undefined" &&
  1083. elem.getAttributeNode( "id" );
  1084. return node && node.value === attrId;
  1085. };
  1086. };
  1087. // Support: IE 6 - 7 only
  1088. // getElementById is not reliable as a find shortcut
  1089. Expr.find.ID = function( id, context ) {
  1090. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1091. var node, i, elems,
  1092. elem = context.getElementById( id );
  1093. if ( elem ) {
  1094. // Verify the id attribute
  1095. node = elem.getAttributeNode( "id" );
  1096. if ( node && node.value === id ) {
  1097. return [ elem ];
  1098. }
  1099. // Fall back on getElementsByName
  1100. elems = context.getElementsByName( id );
  1101. i = 0;
  1102. while ( ( elem = elems[ i++ ] ) ) {
  1103. node = elem.getAttributeNode( "id" );
  1104. if ( node && node.value === id ) {
  1105. return [ elem ];
  1106. }
  1107. }
  1108. }
  1109. return [];
  1110. }
  1111. };
  1112. }
  1113. // Tag
  1114. Expr.find.TAG = function( tag, context ) {
  1115. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1116. return context.getElementsByTagName( tag );
  1117. // DocumentFragment nodes don't have gEBTN
  1118. } else {
  1119. return context.querySelectorAll( tag );
  1120. }
  1121. };
  1122. // Class
  1123. Expr.find.CLASS = function( className, context ) {
  1124. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1125. return context.getElementsByClassName( className );
  1126. }
  1127. };
  1128. /* QSA/matchesSelector
  1129. ---------------------------------------------------------------------- */
  1130. // QSA and matchesSelector support
  1131. rbuggyQSA = [];
  1132. // Build QSA regex
  1133. // Regex strategy adopted from Diego Perini
  1134. assert( function( el ) {
  1135. var input;
  1136. documentElement.appendChild( el ).innerHTML =
  1137. "<a id='" + expando + "' href='' disabled='disabled'></a>" +
  1138. "<select id='" + expando + "-\r\\' disabled='disabled'>" +
  1139. "<option selected=''></option></select>";
  1140. // Support: iOS <=7 - 8 only
  1141. // Boolean attributes and "value" are not treated correctly in some XML documents
  1142. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1143. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1144. }
  1145. // Support: iOS <=7 - 8 only
  1146. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1147. rbuggyQSA.push( "~=" );
  1148. }
  1149. // Support: iOS 8 only
  1150. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1151. // In-page `selector#id sibling-combinator selector` fails
  1152. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1153. rbuggyQSA.push( ".#.+[+~]" );
  1154. }
  1155. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1156. // In some of the document kinds, these selectors wouldn't work natively.
  1157. // This is probably OK but for backwards compatibility we want to maintain
  1158. // handling them through jQuery traversal in jQuery 3.x.
  1159. if ( !el.querySelectorAll( ":checked" ).length ) {
  1160. rbuggyQSA.push( ":checked" );
  1161. }
  1162. // Support: Windows 8 Native Apps
  1163. // The type and name attributes are restricted during .innerHTML assignment
  1164. input = document.createElement( "input" );
  1165. input.setAttribute( "type", "hidden" );
  1166. el.appendChild( input ).setAttribute( "name", "D" );
  1167. // Support: IE 9 - 11+
  1168. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1169. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1170. // In some of the document kinds, these selectors wouldn't work natively.
  1171. // This is probably OK but for backwards compatibility we want to maintain
  1172. // handling them through jQuery traversal in jQuery 3.x.
  1173. documentElement.appendChild( el ).disabled = true;
  1174. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1175. rbuggyQSA.push( ":enabled", ":disabled" );
  1176. }
  1177. // Support: IE 11+, Edge 15 - 18+
  1178. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1179. // Adding a temporary attribute to the document before the selection works
  1180. // around the issue.
  1181. // Interestingly, IE 10 & older don't seem to have the issue.
  1182. input = document.createElement( "input" );
  1183. input.setAttribute( "name", "" );
  1184. el.appendChild( input );
  1185. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1186. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1187. whitespace + "*(?:''|\"\")" );
  1188. }
  1189. } );
  1190. if ( !support.cssHas ) {
  1191. // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
  1192. // Our regular `try-catch` mechanism fails to detect natively-unsupported
  1193. // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
  1194. // in browsers that parse the `:has()` argument as a forgiving selector list.
  1195. // https://drafts.csswg.org/selectors/#relational now requires the argument
  1196. // to be parsed unforgivingly, but browsers have not yet fully adjusted.
  1197. rbuggyQSA.push( ":has" );
  1198. }
  1199. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1200. /* Sorting
  1201. ---------------------------------------------------------------------- */
  1202. // Document order sorting
  1203. sortOrder = function( a, b ) {
  1204. // Flag for duplicate removal
  1205. if ( a === b ) {
  1206. hasDuplicate = true;
  1207. return 0;
  1208. }
  1209. // Sort on method existence if only one input has compareDocumentPosition
  1210. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1211. if ( compare ) {
  1212. return compare;
  1213. }
  1214. // Calculate position if both inputs belong to the same document
  1215. // Support: IE 11+, Edge 17 - 18+
  1216. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1217. // two documents; shallow comparisons work.
  1218. // eslint-disable-next-line eqeqeq
  1219. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1220. a.compareDocumentPosition( b ) :
  1221. // Otherwise we know they are disconnected
  1222. 1;
  1223. // Disconnected nodes
  1224. if ( compare & 1 ||
  1225. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1226. // Choose the first element that is related to our preferred document
  1227. // Support: IE 11+, Edge 17 - 18+
  1228. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1229. // two documents; shallow comparisons work.
  1230. // eslint-disable-next-line eqeqeq
  1231. if ( a === document || a.ownerDocument == preferredDoc &&
  1232. find.contains( preferredDoc, a ) ) {
  1233. return -1;
  1234. }
  1235. // Support: IE 11+, Edge 17 - 18+
  1236. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1237. // two documents; shallow comparisons work.
  1238. // eslint-disable-next-line eqeqeq
  1239. if ( b === document || b.ownerDocument == preferredDoc &&
  1240. find.contains( preferredDoc, b ) ) {
  1241. return 1;
  1242. }
  1243. // Maintain original order
  1244. return sortInput ?
  1245. ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
  1246. 0;
  1247. }
  1248. return compare & 4 ? -1 : 1;
  1249. };
  1250. return document;
  1251. }
  1252. find.matches = function( expr, elements ) {
  1253. return find( expr, null, null, elements );
  1254. };
  1255. find.matchesSelector = function( elem, expr ) {
  1256. setDocument( elem );
  1257. if ( documentIsHTML &&
  1258. !nonnativeSelectorCache[ expr + " " ] &&
  1259. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1260. try {
  1261. var ret = matches.call( elem, expr );
  1262. // IE 9's matchesSelector returns false on disconnected nodes
  1263. if ( ret || support.disconnectedMatch ||
  1264. // As well, disconnected nodes are said to be in a document
  1265. // fragment in IE 9
  1266. elem.document && elem.document.nodeType !== 11 ) {
  1267. return ret;
  1268. }
  1269. } catch ( e ) {
  1270. nonnativeSelectorCache( expr, true );
  1271. }
  1272. }
  1273. return find( expr, document, null, [ elem ] ).length > 0;
  1274. };
  1275. find.contains = function( context, elem ) {
  1276. // Set document vars if needed
  1277. // Support: IE 11+, Edge 17 - 18+
  1278. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1279. // two documents; shallow comparisons work.
  1280. // eslint-disable-next-line eqeqeq
  1281. if ( ( context.ownerDocument || context ) != document ) {
  1282. setDocument( context );
  1283. }
  1284. return jQuery.contains( context, elem );
  1285. };
  1286. find.attr = function( elem, name ) {
  1287. // Set document vars if needed
  1288. // Support: IE 11+, Edge 17 - 18+
  1289. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1290. // two documents; shallow comparisons work.
  1291. // eslint-disable-next-line eqeqeq
  1292. if ( ( elem.ownerDocument || elem ) != document ) {
  1293. setDocument( elem );
  1294. }
  1295. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1296. // Don't get fooled by Object.prototype properties (see trac-13807)
  1297. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1298. fn( elem, name, !documentIsHTML ) :
  1299. undefined;
  1300. if ( val !== undefined ) {
  1301. return val;
  1302. }
  1303. return elem.getAttribute( name );
  1304. };
  1305. find.error = function( msg ) {
  1306. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1307. };
  1308. /**
  1309. * Document sorting and removing duplicates
  1310. * @param {ArrayLike} results
  1311. */
  1312. jQuery.uniqueSort = function( results ) {
  1313. var elem,
  1314. duplicates = [],
  1315. j = 0,
  1316. i = 0;
  1317. // Unless we *know* we can detect duplicates, assume their presence
  1318. //
  1319. // Support: Android <=4.0+
  1320. // Testing for detecting duplicates is unpredictable so instead assume we can't
  1321. // depend on duplicate detection in all browsers without a stable sort.
  1322. hasDuplicate = !support.sortStable;
  1323. sortInput = !support.sortStable && slice.call( results, 0 );
  1324. sort.call( results, sortOrder );
  1325. if ( hasDuplicate ) {
  1326. while ( ( elem = results[ i++ ] ) ) {
  1327. if ( elem === results[ i ] ) {
  1328. j = duplicates.push( i );
  1329. }
  1330. }
  1331. while ( j-- ) {
  1332. splice.call( results, duplicates[ j ], 1 );
  1333. }
  1334. }
  1335. // Clear input after sorting to release objects
  1336. // See https://github.com/jquery/sizzle/pull/225
  1337. sortInput = null;
  1338. return results;
  1339. };
  1340. jQuery.fn.uniqueSort = function() {
  1341. return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
  1342. };
  1343. Expr = jQuery.expr = {
  1344. // Can be adjusted by the user
  1345. cacheLength: 50,
  1346. createPseudo: markFunction,
  1347. match: matchExpr,
  1348. attrHandle: {},
  1349. find: {},
  1350. relative: {
  1351. ">": { dir: "parentNode", first: true },
  1352. " ": { dir: "parentNode" },
  1353. "+": { dir: "previousSibling", first: true },
  1354. "~": { dir: "previousSibling" }
  1355. },
  1356. preFilter: {
  1357. ATTR: function( match ) {
  1358. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1359. // Move the given value to match[3] whether quoted or unquoted
  1360. match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
  1361. .replace( runescape, funescape );
  1362. if ( match[ 2 ] === "~=" ) {
  1363. match[ 3 ] = " " + match[ 3 ] + " ";
  1364. }
  1365. return match.slice( 0, 4 );
  1366. },
  1367. CHILD: function( match ) {
  1368. /* matches from matchExpr["CHILD"]
  1369. 1 type (only|nth|...)
  1370. 2 what (child|of-type)
  1371. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1372. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1373. 5 sign of xn-component
  1374. 6 x of xn-component
  1375. 7 sign of y-component
  1376. 8 y of y-component
  1377. */
  1378. match[ 1 ] = match[ 1 ].toLowerCase();
  1379. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1380. // nth-* requires argument
  1381. if ( !match[ 3 ] ) {
  1382. find.error( match[ 0 ] );
  1383. }
  1384. // numeric x and y parameters for Expr.filter.CHILD
  1385. // remember that false/true cast respectively to 0/1
  1386. match[ 4 ] = +( match[ 4 ] ?
  1387. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1388. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
  1389. );
  1390. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1391. // other types prohibit arguments
  1392. } else if ( match[ 3 ] ) {
  1393. find.error( match[ 0 ] );
  1394. }
  1395. return match;
  1396. },
  1397. PSEUDO: function( match ) {
  1398. var excess,
  1399. unquoted = !match[ 6 ] && match[ 2 ];
  1400. if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
  1401. return null;
  1402. }
  1403. // Accept quoted arguments as-is
  1404. if ( match[ 3 ] ) {
  1405. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1406. // Strip excess characters from unquoted arguments
  1407. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1408. // Get excess from tokenize (recursively)
  1409. ( excess = tokenize( unquoted, true ) ) &&
  1410. // advance to the next closing parenthesis
  1411. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1412. // excess is a negative index
  1413. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1414. match[ 2 ] = unquoted.slice( 0, excess );
  1415. }
  1416. // Return only captures needed by the pseudo filter method (type and argument)
  1417. return match.slice( 0, 3 );
  1418. }
  1419. },
  1420. filter: {
  1421. TAG: function( nodeNameSelector ) {
  1422. var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1423. return nodeNameSelector === "*" ?
  1424. function() {
  1425. return true;
  1426. } :
  1427. function( elem ) {
  1428. return nodeName( elem, expectedNodeName );
  1429. };
  1430. },
  1431. CLASS: function( className ) {
  1432. var pattern = classCache[ className + " " ];
  1433. return pattern ||
  1434. ( pattern = new RegExp( "(^|" + whitespace + ")" + className +
  1435. "(" + whitespace + "|$)" ) ) &&
  1436. classCache( className, function( elem ) {
  1437. return pattern.test(
  1438. typeof elem.className === "string" && elem.className ||
  1439. typeof elem.getAttribute !== "undefined" &&
  1440. elem.getAttribute( "class" ) ||
  1441. ""
  1442. );
  1443. } );
  1444. },
  1445. ATTR: function( name, operator, check ) {
  1446. return function( elem ) {
  1447. var result = find.attr( elem, name );
  1448. if ( result == null ) {
  1449. return operator === "!=";
  1450. }
  1451. if ( !operator ) {
  1452. return true;
  1453. }
  1454. result += "";
  1455. if ( operator === "=" ) {
  1456. return result === check;
  1457. }
  1458. if ( operator === "!=" ) {
  1459. return result !== check;
  1460. }
  1461. if ( operator === "^=" ) {
  1462. return check && result.indexOf( check ) === 0;
  1463. }
  1464. if ( operator === "*=" ) {
  1465. return check && result.indexOf( check ) > -1;
  1466. }
  1467. if ( operator === "$=" ) {
  1468. return check && result.slice( -check.length ) === check;
  1469. }
  1470. if ( operator === "~=" ) {
  1471. return ( " " + result.replace( rwhitespace, " " ) + " " )
  1472. .indexOf( check ) > -1;
  1473. }
  1474. if ( operator === "|=" ) {
  1475. return result === check || result.slice( 0, check.length + 1 ) === check + "-";
  1476. }
  1477. return false;
  1478. };
  1479. },
  1480. CHILD: function( type, what, _argument, first, last ) {
  1481. var simple = type.slice( 0, 3 ) !== "nth",
  1482. forward = type.slice( -4 ) !== "last",
  1483. ofType = what === "of-type";
  1484. return first === 1 && last === 0 ?
  1485. // Shortcut for :nth-*(n)
  1486. function( elem ) {
  1487. return !!elem.parentNode;
  1488. } :
  1489. function( elem, _context, xml ) {
  1490. var cache, outerCache, node, nodeIndex, start,
  1491. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1492. parent = elem.parentNode,
  1493. name = ofType && elem.nodeName.toLowerCase(),
  1494. useCache = !xml && !ofType,
  1495. diff = false;
  1496. if ( parent ) {
  1497. // :(first|last|only)-(child|of-type)
  1498. if ( simple ) {
  1499. while ( dir ) {
  1500. node = elem;
  1501. while ( ( node = node[ dir ] ) ) {
  1502. if ( ofType ?
  1503. nodeName( node, name ) :
  1504. node.nodeType === 1 ) {
  1505. return false;
  1506. }
  1507. }
  1508. // Reverse direction for :only-* (if we haven't yet done so)
  1509. start = dir = type === "only" && !start && "nextSibling";
  1510. }
  1511. return true;
  1512. }
  1513. start = [ forward ? parent.firstChild : parent.lastChild ];
  1514. // non-xml :nth-child(...) stores cache data on `parent`
  1515. if ( forward && useCache ) {
  1516. // Seek `elem` from a previously-cached index
  1517. outerCache = parent[ expando ] || ( parent[ expando ] = {} );
  1518. cache = outerCache[ type ] || [];
  1519. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1520. diff = nodeIndex && cache[ 2 ];
  1521. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1522. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1523. // Fallback to seeking `elem` from the start
  1524. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1525. // When found, cache indexes on `parent` and break
  1526. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1527. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1528. break;
  1529. }
  1530. }
  1531. } else {
  1532. // Use previously-cached element index if available
  1533. if ( useCache ) {
  1534. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1535. cache = outerCache[ type ] || [];
  1536. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1537. diff = nodeIndex;
  1538. }
  1539. // xml :nth-child(...)
  1540. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1541. if ( diff === false ) {
  1542. // Use the same loop as above to seek `elem` from the start
  1543. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1544. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1545. if ( ( ofType ?
  1546. nodeName( node, name ) :
  1547. node.nodeType === 1 ) &&
  1548. ++diff ) {
  1549. // Cache the index of each encountered element
  1550. if ( useCache ) {
  1551. outerCache = node[ expando ] ||
  1552. ( node[ expando ] = {} );
  1553. outerCache[ type ] = [ dirruns, diff ];
  1554. }
  1555. if ( node === elem ) {
  1556. break;
  1557. }
  1558. }
  1559. }
  1560. }
  1561. }
  1562. // Incorporate the offset, then check against cycle size
  1563. diff -= last;
  1564. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1565. }
  1566. };
  1567. },
  1568. PSEUDO: function( pseudo, argument ) {
  1569. // pseudo-class names are case-insensitive
  1570. // https://www.w3.org/TR/selectors/#pseudo-classes
  1571. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1572. // Remember that setFilters inherits from pseudos
  1573. var args,
  1574. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1575. find.error( "unsupported pseudo: " + pseudo );
  1576. // The user may use createPseudo to indicate that
  1577. // arguments are needed to create the filter function
  1578. // just as jQuery does
  1579. if ( fn[ expando ] ) {
  1580. return fn( argument );
  1581. }
  1582. // But maintain support for old signatures
  1583. if ( fn.length > 1 ) {
  1584. args = [ pseudo, pseudo, "", argument ];
  1585. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1586. markFunction( function( seed, matches ) {
  1587. var idx,
  1588. matched = fn( seed, argument ),
  1589. i = matched.length;
  1590. while ( i-- ) {
  1591. idx = indexOf.call( seed, matched[ i ] );
  1592. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1593. }
  1594. } ) :
  1595. function( elem ) {
  1596. return fn( elem, 0, args );
  1597. };
  1598. }
  1599. return fn;
  1600. }
  1601. },
  1602. pseudos: {
  1603. // Potentially complex pseudos
  1604. not: markFunction( function( selector ) {
  1605. // Trim the selector passed to compile
  1606. // to avoid treating leading and trailing
  1607. // spaces as combinators
  1608. var input = [],
  1609. results = [],
  1610. matcher = compile( selector.replace( rtrimCSS, "$1" ) );
  1611. return matcher[ expando ] ?
  1612. markFunction( function( seed, matches, _context, xml ) {
  1613. var elem,
  1614. unmatched = matcher( seed, null, xml, [] ),
  1615. i = seed.length;
  1616. // Match elements unmatched by `matcher`
  1617. while ( i-- ) {
  1618. if ( ( elem = unmatched[ i ] ) ) {
  1619. seed[ i ] = !( matches[ i ] = elem );
  1620. }
  1621. }
  1622. } ) :
  1623. function( elem, _context, xml ) {
  1624. input[ 0 ] = elem;
  1625. matcher( input, null, xml, results );
  1626. // Don't keep the element
  1627. // (see https://github.com/jquery/sizzle/issues/299)
  1628. input[ 0 ] = null;
  1629. return !results.pop();
  1630. };
  1631. } ),
  1632. has: markFunction( function( selector ) {
  1633. return function( elem ) {
  1634. return find( selector, elem ).length > 0;
  1635. };
  1636. } ),
  1637. contains: markFunction( function( text ) {
  1638. text = text.replace( runescape, funescape );
  1639. return function( elem ) {
  1640. return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
  1641. };
  1642. } ),
  1643. // "Whether an element is represented by a :lang() selector
  1644. // is based solely on the element's language value
  1645. // being equal to the identifier C,
  1646. // or beginning with the identifier C immediately followed by "-".
  1647. // The matching of C against the element's language value is performed case-insensitively.
  1648. // The identifier C does not have to be a valid language name."
  1649. // https://www.w3.org/TR/selectors/#lang-pseudo
  1650. lang: markFunction( function( lang ) {
  1651. // lang value must be a valid identifier
  1652. if ( !ridentifier.test( lang || "" ) ) {
  1653. find.error( "unsupported lang: " + lang );
  1654. }
  1655. lang = lang.replace( runescape, funescape ).toLowerCase();
  1656. return function( elem ) {
  1657. var elemLang;
  1658. do {
  1659. if ( ( elemLang = documentIsHTML ?
  1660. elem.lang :
  1661. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  1662. elemLang = elemLang.toLowerCase();
  1663. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1664. }
  1665. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  1666. return false;
  1667. };
  1668. } ),
  1669. // Miscellaneous
  1670. target: function( elem ) {
  1671. var hash = window.location && window.location.hash;
  1672. return hash && hash.slice( 1 ) === elem.id;
  1673. },
  1674. root: function( elem ) {
  1675. return elem === documentElement;
  1676. },
  1677. focus: function( elem ) {
  1678. return elem === safeActiveElement() &&
  1679. document.hasFocus() &&
  1680. !!( elem.type || elem.href || ~elem.tabIndex );
  1681. },
  1682. // Boolean properties
  1683. enabled: createDisabledPseudo( false ),
  1684. disabled: createDisabledPseudo( true ),
  1685. checked: function( elem ) {
  1686. // In CSS3, :checked should return both checked and selected elements
  1687. // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1688. return ( nodeName( elem, "input" ) && !!elem.checked ) ||
  1689. ( nodeName( elem, "option" ) && !!elem.selected );
  1690. },
  1691. selected: function( elem ) {
  1692. // Support: IE <=11+
  1693. // Accessing the selectedIndex property
  1694. // forces the browser to treat the default option as
  1695. // selected when in an optgroup.
  1696. if ( elem.parentNode ) {
  1697. // eslint-disable-next-line no-unused-expressions
  1698. elem.parentNode.selectedIndex;
  1699. }
  1700. return elem.selected === true;
  1701. },
  1702. // Contents
  1703. empty: function( elem ) {
  1704. // https://www.w3.org/TR/selectors/#empty-pseudo
  1705. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1706. // but not by others (comment: 8; processing instruction: 7; etc.)
  1707. // nodeType < 6 works because attributes (2) do not appear as children
  1708. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1709. if ( elem.nodeType < 6 ) {
  1710. return false;
  1711. }
  1712. }
  1713. return true;
  1714. },
  1715. parent: function( elem ) {
  1716. return !Expr.pseudos.empty( elem );
  1717. },
  1718. // Element/input types
  1719. header: function( elem ) {
  1720. return rheader.test( elem.nodeName );
  1721. },
  1722. input: function( elem ) {
  1723. return rinputs.test( elem.nodeName );
  1724. },
  1725. button: function( elem ) {
  1726. return nodeName( elem, "input" ) && elem.type === "button" ||
  1727. nodeName( elem, "button" );
  1728. },
  1729. text: function( elem ) {
  1730. var attr;
  1731. return nodeName( elem, "input" ) && elem.type === "text" &&
  1732. // Support: IE <10 only
  1733. // New HTML5 attribute values (e.g., "search") appear
  1734. // with elem.type === "text"
  1735. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  1736. attr.toLowerCase() === "text" );
  1737. },
  1738. // Position-in-collection
  1739. first: createPositionalPseudo( function() {
  1740. return [ 0 ];
  1741. } ),
  1742. last: createPositionalPseudo( function( _matchIndexes, length ) {
  1743. return [ length - 1 ];
  1744. } ),
  1745. eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
  1746. return [ argument < 0 ? argument + length : argument ];
  1747. } ),
  1748. even: createPositionalPseudo( function( matchIndexes, length ) {
  1749. var i = 0;
  1750. for ( ; i < length; i += 2 ) {
  1751. matchIndexes.push( i );
  1752. }
  1753. return matchIndexes;
  1754. } ),
  1755. odd: createPositionalPseudo( function( matchIndexes, length ) {
  1756. var i = 1;
  1757. for ( ; i < length; i += 2 ) {
  1758. matchIndexes.push( i );
  1759. }
  1760. return matchIndexes;
  1761. } ),
  1762. lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  1763. var i;
  1764. if ( argument < 0 ) {
  1765. i = argument + length;
  1766. } else if ( argument > length ) {
  1767. i = length;
  1768. } else {
  1769. i = argument;
  1770. }
  1771. for ( ; --i >= 0; ) {
  1772. matchIndexes.push( i );
  1773. }
  1774. return matchIndexes;
  1775. } ),
  1776. gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  1777. var i = argument < 0 ? argument + length : argument;
  1778. for ( ; ++i < length; ) {
  1779. matchIndexes.push( i );
  1780. }
  1781. return matchIndexes;
  1782. } )
  1783. }
  1784. };
  1785. Expr.pseudos.nth = Expr.pseudos.eq;
  1786. // Add button/input type pseudos
  1787. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1788. Expr.pseudos[ i ] = createInputPseudo( i );
  1789. }
  1790. for ( i in { submit: true, reset: true } ) {
  1791. Expr.pseudos[ i ] = createButtonPseudo( i );
  1792. }
  1793. // Easy API for creating new setFilters
  1794. function setFilters() {}
  1795. setFilters.prototype = Expr.filters = Expr.pseudos;
  1796. Expr.setFilters = new setFilters();
  1797. function tokenize( selector, parseOnly ) {
  1798. var matched, match, tokens, type,
  1799. soFar, groups, preFilters,
  1800. cached = tokenCache[ selector + " " ];
  1801. if ( cached ) {
  1802. return parseOnly ? 0 : cached.slice( 0 );
  1803. }
  1804. soFar = selector;
  1805. groups = [];
  1806. preFilters = Expr.preFilter;
  1807. while ( soFar ) {
  1808. // Comma and first run
  1809. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  1810. if ( match ) {
  1811. // Don't consume trailing commas as valid
  1812. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  1813. }
  1814. groups.push( ( tokens = [] ) );
  1815. }
  1816. matched = false;
  1817. // Combinators
  1818. if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
  1819. matched = match.shift();
  1820. tokens.push( {
  1821. value: matched,
  1822. // Cast descendant combinators to space
  1823. type: match[ 0 ].replace( rtrimCSS, " " )
  1824. } );
  1825. soFar = soFar.slice( matched.length );
  1826. }
  1827. // Filters
  1828. for ( type in Expr.filter ) {
  1829. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  1830. ( match = preFilters[ type ]( match ) ) ) ) {
  1831. matched = match.shift();
  1832. tokens.push( {
  1833. value: matched,
  1834. type: type,
  1835. matches: match
  1836. } );
  1837. soFar = soFar.slice( matched.length );
  1838. }
  1839. }
  1840. if ( !matched ) {
  1841. break;
  1842. }
  1843. }
  1844. // Return the length of the invalid excess
  1845. // if we're just parsing
  1846. // Otherwise, throw an error or return tokens
  1847. if ( parseOnly ) {
  1848. return soFar.length;
  1849. }
  1850. return soFar ?
  1851. find.error( selector ) :
  1852. // Cache the tokens
  1853. tokenCache( selector, groups ).slice( 0 );
  1854. }
  1855. function toSelector( tokens ) {
  1856. var i = 0,
  1857. len = tokens.length,
  1858. selector = "";
  1859. for ( ; i < len; i++ ) {
  1860. selector += tokens[ i ].value;
  1861. }
  1862. return selector;
  1863. }
  1864. function addCombinator( matcher, combinator, base ) {
  1865. var dir = combinator.dir,
  1866. skip = combinator.next,
  1867. key = skip || dir,
  1868. checkNonElements = base && key === "parentNode",
  1869. doneName = done++;
  1870. return combinator.first ?
  1871. // Check against closest ancestor/preceding element
  1872. function( elem, context, xml ) {
  1873. while ( ( elem = elem[ dir ] ) ) {
  1874. if ( elem.nodeType === 1 || checkNonElements ) {
  1875. return matcher( elem, context, xml );
  1876. }
  1877. }
  1878. return false;
  1879. } :
  1880. // Check against all ancestor/preceding elements
  1881. function( elem, context, xml ) {
  1882. var oldCache, outerCache,
  1883. newCache = [ dirruns, doneName ];
  1884. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1885. if ( xml ) {
  1886. while ( ( elem = elem[ dir ] ) ) {
  1887. if ( elem.nodeType === 1 || checkNonElements ) {
  1888. if ( matcher( elem, context, xml ) ) {
  1889. return true;
  1890. }
  1891. }
  1892. }
  1893. } else {
  1894. while ( ( elem = elem[ dir ] ) ) {
  1895. if ( elem.nodeType === 1 || checkNonElements ) {
  1896. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1897. if ( skip && nodeName( elem, skip ) ) {
  1898. elem = elem[ dir ] || elem;
  1899. } else if ( ( oldCache = outerCache[ key ] ) &&
  1900. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1901. // Assign to newCache so results back-propagate to previous elements
  1902. return ( newCache[ 2 ] = oldCache[ 2 ] );
  1903. } else {
  1904. // Reuse newcache so results back-propagate to previous elements
  1905. outerCache[ key ] = newCache;
  1906. // A match means we're done; a fail means we have to keep checking
  1907. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  1908. return true;
  1909. }
  1910. }
  1911. }
  1912. }
  1913. }
  1914. return false;
  1915. };
  1916. }
  1917. function elementMatcher( matchers ) {
  1918. return matchers.length > 1 ?
  1919. function( elem, context, xml ) {
  1920. var i = matchers.length;
  1921. while ( i-- ) {
  1922. if ( !matchers[ i ]( elem, context, xml ) ) {
  1923. return false;
  1924. }
  1925. }
  1926. return true;
  1927. } :
  1928. matchers[ 0 ];
  1929. }
  1930. function multipleContexts( selector, contexts, results ) {
  1931. var i = 0,
  1932. len = contexts.length;
  1933. for ( ; i < len; i++ ) {
  1934. find( selector, contexts[ i ], results );
  1935. }
  1936. return results;
  1937. }
  1938. function condense( unmatched, map, filter, context, xml ) {
  1939. var elem,
  1940. newUnmatched = [],
  1941. i = 0,
  1942. len = unmatched.length,
  1943. mapped = map != null;
  1944. for ( ; i < len; i++ ) {
  1945. if ( ( elem = unmatched[ i ] ) ) {
  1946. if ( !filter || filter( elem, context, xml ) ) {
  1947. newUnmatched.push( elem );
  1948. if ( mapped ) {
  1949. map.push( i );
  1950. }
  1951. }
  1952. }
  1953. }
  1954. return newUnmatched;
  1955. }
  1956. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1957. if ( postFilter && !postFilter[ expando ] ) {
  1958. postFilter = setMatcher( postFilter );
  1959. }
  1960. if ( postFinder && !postFinder[ expando ] ) {
  1961. postFinder = setMatcher( postFinder, postSelector );
  1962. }
  1963. return markFunction( function( seed, results, context, xml ) {
  1964. var temp, i, elem, matcherOut,
  1965. preMap = [],
  1966. postMap = [],
  1967. preexisting = results.length,
  1968. // Get initial elements from seed or context
  1969. elems = seed ||
  1970. multipleContexts( selector || "*",
  1971. context.nodeType ? [ context ] : context, [] ),
  1972. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1973. matcherIn = preFilter && ( seed || !selector ) ?
  1974. condense( elems, preMap, preFilter, context, xml ) :
  1975. elems;
  1976. if ( matcher ) {
  1977. // If we have a postFinder, or filtered seed, or non-seed postFilter
  1978. // or preexisting results,
  1979. matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1980. // ...intermediate processing is necessary
  1981. [] :
  1982. // ...otherwise use results directly
  1983. results;
  1984. // Find primary matches
  1985. matcher( matcherIn, matcherOut, context, xml );
  1986. } else {
  1987. matcherOut = matcherIn;
  1988. }
  1989. // Apply postFilter
  1990. if ( postFilter ) {
  1991. temp = condense( matcherOut, postMap );
  1992. postFilter( temp, [], context, xml );
  1993. // Un-match failing elements by moving them back to matcherIn
  1994. i = temp.length;
  1995. while ( i-- ) {
  1996. if ( ( elem = temp[ i ] ) ) {
  1997. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  1998. }
  1999. }
  2000. }
  2001. if ( seed ) {
  2002. if ( postFinder || preFilter ) {
  2003. if ( postFinder ) {
  2004. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2005. temp = [];
  2006. i = matcherOut.length;
  2007. while ( i-- ) {
  2008. if ( ( elem = matcherOut[ i ] ) ) {
  2009. // Restore matcherIn since elem is not yet a final match
  2010. temp.push( ( matcherIn[ i ] = elem ) );
  2011. }
  2012. }
  2013. postFinder( null, ( matcherOut = [] ), temp, xml );
  2014. }
  2015. // Move matched elements from seed to results to keep them synchronized
  2016. i = matcherOut.length;
  2017. while ( i-- ) {
  2018. if ( ( elem = matcherOut[ i ] ) &&
  2019. ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
  2020. seed[ temp ] = !( results[ temp ] = elem );
  2021. }
  2022. }
  2023. }
  2024. // Add elements to results, through postFinder if defined
  2025. } else {
  2026. matcherOut = condense(
  2027. matcherOut === results ?
  2028. matcherOut.splice( preexisting, matcherOut.length ) :
  2029. matcherOut
  2030. );
  2031. if ( postFinder ) {
  2032. postFinder( null, results, matcherOut, xml );
  2033. } else {
  2034. push.apply( results, matcherOut );
  2035. }
  2036. }
  2037. } );
  2038. }
  2039. function matcherFromTokens( tokens ) {
  2040. var checkContext, matcher, j,
  2041. len = tokens.length,
  2042. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  2043. implicitRelative = leadingRelative || Expr.relative[ " " ],
  2044. i = leadingRelative ? 1 : 0,
  2045. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2046. matchContext = addCombinator( function( elem ) {
  2047. return elem === checkContext;
  2048. }, implicitRelative, true ),
  2049. matchAnyContext = addCombinator( function( elem ) {
  2050. return indexOf.call( checkContext, elem ) > -1;
  2051. }, implicitRelative, true ),
  2052. matchers = [ function( elem, context, xml ) {
  2053. // Support: IE 11+, Edge 17 - 18+
  2054. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2055. // two documents; shallow comparisons work.
  2056. // eslint-disable-next-line eqeqeq
  2057. var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
  2058. ( checkContext = context ).nodeType ?
  2059. matchContext( elem, context, xml ) :
  2060. matchAnyContext( elem, context, xml ) );
  2061. // Avoid hanging onto element
  2062. // (see https://github.com/jquery/sizzle/issues/299)
  2063. checkContext = null;
  2064. return ret;
  2065. } ];
  2066. for ( ; i < len; i++ ) {
  2067. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  2068. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  2069. } else {
  2070. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  2071. // Return special upon seeing a positional matcher
  2072. if ( matcher[ expando ] ) {
  2073. // Find the next relative operator (if any) for proper handling
  2074. j = ++i;
  2075. for ( ; j < len; j++ ) {
  2076. if ( Expr.relative[ tokens[ j ].type ] ) {
  2077. break;
  2078. }
  2079. }
  2080. return setMatcher(
  2081. i > 1 && elementMatcher( matchers ),
  2082. i > 1 && toSelector(
  2083. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2084. tokens.slice( 0, i - 1 )
  2085. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  2086. ).replace( rtrimCSS, "$1" ),
  2087. matcher,
  2088. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2089. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  2090. j < len && toSelector( tokens )
  2091. );
  2092. }
  2093. matchers.push( matcher );
  2094. }
  2095. }
  2096. return elementMatcher( matchers );
  2097. }
  2098. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2099. var bySet = setMatchers.length > 0,
  2100. byElement = elementMatchers.length > 0,
  2101. superMatcher = function( seed, context, xml, results, outermost ) {
  2102. var elem, j, matcher,
  2103. matchedCount = 0,
  2104. i = "0",
  2105. unmatched = seed && [],
  2106. setMatched = [],
  2107. contextBackup = outermostContext,
  2108. // We must always have either seed elements or outermost context
  2109. elems = seed || byElement && Expr.find.TAG( "*", outermost ),
  2110. // Use integer dirruns iff this is the outermost matcher
  2111. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  2112. len = elems.length;
  2113. if ( outermost ) {
  2114. // Support: IE 11+, Edge 17 - 18+
  2115. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2116. // two documents; shallow comparisons work.
  2117. // eslint-disable-next-line eqeqeq
  2118. outermostContext = context == document || context || outermost;
  2119. }
  2120. // Add elements passing elementMatchers directly to results
  2121. // Support: iOS <=7 - 9 only
  2122. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
  2123. // elements by id. (see trac-14142)
  2124. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  2125. if ( byElement && elem ) {
  2126. j = 0;
  2127. // Support: IE 11+, Edge 17 - 18+
  2128. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2129. // two documents; shallow comparisons work.
  2130. // eslint-disable-next-line eqeqeq
  2131. if ( !context && elem.ownerDocument != document ) {
  2132. setDocument( elem );
  2133. xml = !documentIsHTML;
  2134. }
  2135. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2136. if ( matcher( elem, context || document, xml ) ) {
  2137. push.call( results, elem );
  2138. break;
  2139. }
  2140. }
  2141. if ( outermost ) {
  2142. dirruns = dirrunsUnique;
  2143. }
  2144. }
  2145. // Track unmatched elements for set filters
  2146. if ( bySet ) {
  2147. // They will have gone through all possible matchers
  2148. if ( ( elem = !matcher && elem ) ) {
  2149. matchedCount--;
  2150. }
  2151. // Lengthen the array for every element, matched or not
  2152. if ( seed ) {
  2153. unmatched.push( elem );
  2154. }
  2155. }
  2156. }
  2157. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2158. // makes the latter nonnegative.
  2159. matchedCount += i;
  2160. // Apply set filters to unmatched elements
  2161. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2162. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2163. // no element matchers and no seed.
  2164. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2165. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2166. // numerically zero.
  2167. if ( bySet && i !== matchedCount ) {
  2168. j = 0;
  2169. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2170. matcher( unmatched, setMatched, context, xml );
  2171. }
  2172. if ( seed ) {
  2173. // Reintegrate element matches to eliminate the need for sorting
  2174. if ( matchedCount > 0 ) {
  2175. while ( i-- ) {
  2176. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2177. setMatched[ i ] = pop.call( results );
  2178. }
  2179. }
  2180. }
  2181. // Discard index placeholder values to get only actual matches
  2182. setMatched = condense( setMatched );
  2183. }
  2184. // Add matches to results
  2185. push.apply( results, setMatched );
  2186. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2187. if ( outermost && !seed && setMatched.length > 0 &&
  2188. ( matchedCount + setMatchers.length ) > 1 ) {
  2189. jQuery.uniqueSort( results );
  2190. }
  2191. }
  2192. // Override manipulation of globals by nested matchers
  2193. if ( outermost ) {
  2194. dirruns = dirrunsUnique;
  2195. outermostContext = contextBackup;
  2196. }
  2197. return unmatched;
  2198. };
  2199. return bySet ?
  2200. markFunction( superMatcher ) :
  2201. superMatcher;
  2202. }
  2203. function compile( selector, match /* Internal Use Only */ ) {
  2204. var i,
  2205. setMatchers = [],
  2206. elementMatchers = [],
  2207. cached = compilerCache[ selector + " " ];
  2208. if ( !cached ) {
  2209. // Generate a function of recursive functions that can be used to check each element
  2210. if ( !match ) {
  2211. match = tokenize( selector );
  2212. }
  2213. i = match.length;
  2214. while ( i-- ) {
  2215. cached = matcherFromTokens( match[ i ] );
  2216. if ( cached[ expando ] ) {
  2217. setMatchers.push( cached );
  2218. } else {
  2219. elementMatchers.push( cached );
  2220. }
  2221. }
  2222. // Cache the compiled function
  2223. cached = compilerCache( selector,
  2224. matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2225. // Save selector and tokenization
  2226. cached.selector = selector;
  2227. }
  2228. return cached;
  2229. }
  2230. /**
  2231. * A low-level selection function that works with jQuery's compiled
  2232. * selector functions
  2233. * @param {String|Function} selector A selector or a pre-compiled
  2234. * selector function built with jQuery selector compile
  2235. * @param {Element} context
  2236. * @param {Array} [results]
  2237. * @param {Array} [seed] A set of elements to match against
  2238. */
  2239. function select( selector, context, results, seed ) {
  2240. var i, tokens, token, type, find,
  2241. compiled = typeof selector === "function" && selector,
  2242. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2243. results = results || [];
  2244. // Try to minimize operations if there is only one selector in the list and no seed
  2245. // (the latter of which guarantees us context)
  2246. if ( match.length === 1 ) {
  2247. // Reduce context if the leading compound selector is an ID
  2248. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2249. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2250. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2251. context = ( Expr.find.ID(
  2252. token.matches[ 0 ].replace( runescape, funescape ),
  2253. context
  2254. ) || [] )[ 0 ];
  2255. if ( !context ) {
  2256. return results;
  2257. // Precompiled matchers will still verify ancestry, so step up a level
  2258. } else if ( compiled ) {
  2259. context = context.parentNode;
  2260. }
  2261. selector = selector.slice( tokens.shift().value.length );
  2262. }
  2263. // Fetch a seed set for right-to-left matching
  2264. i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
  2265. while ( i-- ) {
  2266. token = tokens[ i ];
  2267. // Abort if we hit a combinator
  2268. if ( Expr.relative[ ( type = token.type ) ] ) {
  2269. break;
  2270. }
  2271. if ( ( find = Expr.find[ type ] ) ) {
  2272. // Search, expanding context for leading sibling combinators
  2273. if ( ( seed = find(
  2274. token.matches[ 0 ].replace( runescape, funescape ),
  2275. rsibling.test( tokens[ 0 ].type ) &&
  2276. testContext( context.parentNode ) || context
  2277. ) ) ) {
  2278. // If seed is empty or no tokens remain, we can return early
  2279. tokens.splice( i, 1 );
  2280. selector = seed.length && toSelector( tokens );
  2281. if ( !selector ) {
  2282. push.apply( results, seed );
  2283. return results;
  2284. }
  2285. break;
  2286. }
  2287. }
  2288. }
  2289. }
  2290. // Compile and execute a filtering function if one is not provided
  2291. // Provide `match` to avoid retokenization if we modified the selector above
  2292. ( compiled || compile( selector, match ) )(
  2293. seed,
  2294. context,
  2295. !documentIsHTML,
  2296. results,
  2297. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2298. );
  2299. return results;
  2300. }
  2301. // One-time assignments
  2302. // Support: Android <=4.0 - 4.1+
  2303. // Sort stability
  2304. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2305. // Initialize against the default document
  2306. setDocument();
  2307. // Support: Android <=4.0 - 4.1+
  2308. // Detached nodes confoundingly follow *each other*
  2309. support.sortDetached = assert( function( el ) {
  2310. // Should return 1, but returns 4 (following)
  2311. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2312. } );
  2313. jQuery.find = find;
  2314. // Deprecated
  2315. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2316. jQuery.unique = jQuery.uniqueSort;
  2317. // These have always been private, but they used to be documented as part of
  2318. // Sizzle so let's maintain them for now for backwards compatibility purposes.
  2319. find.compile = compile;
  2320. find.select = select;
  2321. find.setDocument = setDocument;
  2322. find.tokenize = tokenize;
  2323. find.escape = jQuery.escapeSelector;
  2324. find.getText = jQuery.text;
  2325. find.isXML = jQuery.isXMLDoc;
  2326. find.selectors = jQuery.expr;
  2327. find.support = jQuery.support;
  2328. find.uniqueSort = jQuery.uniqueSort;
  2329. /* eslint-enable */
  2330. } )();
  2331. var dir = function( elem, dir, until ) {
  2332. var matched = [],
  2333. truncate = until !== undefined;
  2334. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2335. if ( elem.nodeType === 1 ) {
  2336. if ( truncate && jQuery( elem ).is( until ) ) {
  2337. break;
  2338. }
  2339. matched.push( elem );
  2340. }
  2341. }
  2342. return matched;
  2343. };
  2344. var siblings = function( n, elem ) {
  2345. var matched = [];
  2346. for ( ; n; n = n.nextSibling ) {
  2347. if ( n.nodeType === 1 && n !== elem ) {
  2348. matched.push( n );
  2349. }
  2350. }
  2351. return matched;
  2352. };
  2353. var rneedsContext = jQuery.expr.match.needsContext;
  2354. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2355. // Implement the identical functionality for filter and not
  2356. function winnow( elements, qualifier, not ) {
  2357. if ( isFunction( qualifier ) ) {
  2358. return jQuery.grep( elements, function( elem, i ) {
  2359. return !!qualifier.call( elem, i, elem ) !== not;
  2360. } );
  2361. }
  2362. // Single element
  2363. if ( qualifier.nodeType ) {
  2364. return jQuery.grep( elements, function( elem ) {
  2365. return ( elem === qualifier ) !== not;
  2366. } );
  2367. }
  2368. // Arraylike of elements (jQuery, arguments, Array)
  2369. if ( typeof qualifier !== "string" ) {
  2370. return jQuery.grep( elements, function( elem ) {
  2371. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2372. } );
  2373. }
  2374. // Filtered directly for both simple and complex selectors
  2375. return jQuery.filter( qualifier, elements, not );
  2376. }
  2377. jQuery.filter = function( expr, elems, not ) {
  2378. var elem = elems[ 0 ];
  2379. if ( not ) {
  2380. expr = ":not(" + expr + ")";
  2381. }
  2382. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2383. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2384. }
  2385. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2386. return elem.nodeType === 1;
  2387. } ) );
  2388. };
  2389. jQuery.fn.extend( {
  2390. find: function( selector ) {
  2391. var i, ret,
  2392. len = this.length,
  2393. self = this;
  2394. if ( typeof selector !== "string" ) {
  2395. return this.pushStack( jQuery( selector ).filter( function() {
  2396. for ( i = 0; i < len; i++ ) {
  2397. if ( jQuery.contains( self[ i ], this ) ) {
  2398. return true;
  2399. }
  2400. }
  2401. } ) );
  2402. }
  2403. ret = this.pushStack( [] );
  2404. for ( i = 0; i < len; i++ ) {
  2405. jQuery.find( selector, self[ i ], ret );
  2406. }
  2407. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2408. },
  2409. filter: function( selector ) {
  2410. return this.pushStack( winnow( this, selector || [], false ) );
  2411. },
  2412. not: function( selector ) {
  2413. return this.pushStack( winnow( this, selector || [], true ) );
  2414. },
  2415. is: function( selector ) {
  2416. return !!winnow(
  2417. this,
  2418. // If this is a positional/relative selector, check membership in the returned set
  2419. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2420. typeof selector === "string" && rneedsContext.test( selector ) ?
  2421. jQuery( selector ) :
  2422. selector || [],
  2423. false
  2424. ).length;
  2425. }
  2426. } );
  2427. // Initialize a jQuery object
  2428. // A central reference to the root jQuery(document)
  2429. var rootjQuery,
  2430. // A simple way to check for HTML strings
  2431. // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
  2432. // Strict HTML recognition (trac-11290: must start with <)
  2433. // Shortcut simple #id case for speed
  2434. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2435. init = jQuery.fn.init = function( selector, context, root ) {
  2436. var match, elem;
  2437. // HANDLE: $(""), $(null), $(undefined), $(false)
  2438. if ( !selector ) {
  2439. return this;
  2440. }
  2441. // Method init() accepts an alternate rootjQuery
  2442. // so migrate can support jQuery.sub (gh-2101)
  2443. root = root || rootjQuery;
  2444. // Handle HTML strings
  2445. if ( typeof selector === "string" ) {
  2446. if ( selector[ 0 ] === "<" &&
  2447. selector[ selector.length - 1 ] === ">" &&
  2448. selector.length >= 3 ) {
  2449. // Assume that strings that start and end with <> are HTML and skip the regex check
  2450. match = [ null, selector, null ];
  2451. } else {
  2452. match = rquickExpr.exec( selector );
  2453. }
  2454. // Match html or make sure no context is specified for #id
  2455. if ( match && ( match[ 1 ] || !context ) ) {
  2456. // HANDLE: $(html) -> $(array)
  2457. if ( match[ 1 ] ) {
  2458. context = context instanceof jQuery ? context[ 0 ] : context;
  2459. // Option to run scripts is true for back-compat
  2460. // Intentionally let the error be thrown if parseHTML is not present
  2461. jQuery.merge( this, jQuery.parseHTML(
  2462. match[ 1 ],
  2463. context && context.nodeType ? context.ownerDocument || context : document,
  2464. true
  2465. ) );
  2466. // HANDLE: $(html, props)
  2467. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2468. for ( match in context ) {
  2469. // Properties of context are called as methods if possible
  2470. if ( isFunction( this[ match ] ) ) {
  2471. this[ match ]( context[ match ] );
  2472. // ...and otherwise set as attributes
  2473. } else {
  2474. this.attr( match, context[ match ] );
  2475. }
  2476. }
  2477. }
  2478. return this;
  2479. // HANDLE: $(#id)
  2480. } else {
  2481. elem = document.getElementById( match[ 2 ] );
  2482. if ( elem ) {
  2483. // Inject the element directly into the jQuery object
  2484. this[ 0 ] = elem;
  2485. this.length = 1;
  2486. }
  2487. return this;
  2488. }
  2489. // HANDLE: $(expr, $(...))
  2490. } else if ( !context || context.jquery ) {
  2491. return ( context || root ).find( selector );
  2492. // HANDLE: $(expr, context)
  2493. // (which is just equivalent to: $(context).find(expr)
  2494. } else {
  2495. return this.constructor( context ).find( selector );
  2496. }
  2497. // HANDLE: $(DOMElement)
  2498. } else if ( selector.nodeType ) {
  2499. this[ 0 ] = selector;
  2500. this.length = 1;
  2501. return this;
  2502. // HANDLE: $(function)
  2503. // Shortcut for document ready
  2504. } else if ( isFunction( selector ) ) {
  2505. return root.ready !== undefined ?
  2506. root.ready( selector ) :
  2507. // Execute immediately if ready is not present
  2508. selector( jQuery );
  2509. }
  2510. return jQuery.makeArray( selector, this );
  2511. };
  2512. // Give the init function the jQuery prototype for later instantiation
  2513. init.prototype = jQuery.fn;
  2514. // Initialize central reference
  2515. rootjQuery = jQuery( document );
  2516. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2517. // Methods guaranteed to produce a unique set when starting from a unique set
  2518. guaranteedUnique = {
  2519. children: true,
  2520. contents: true,
  2521. next: true,
  2522. prev: true
  2523. };
  2524. jQuery.fn.extend( {
  2525. has: function( target ) {
  2526. var targets = jQuery( target, this ),
  2527. l = targets.length;
  2528. return this.filter( function() {
  2529. var i = 0;
  2530. for ( ; i < l; i++ ) {
  2531. if ( jQuery.contains( this, targets[ i ] ) ) {
  2532. return true;
  2533. }
  2534. }
  2535. } );
  2536. },
  2537. closest: function( selectors, context ) {
  2538. var cur,
  2539. i = 0,
  2540. l = this.length,
  2541. matched = [],
  2542. targets = typeof selectors !== "string" && jQuery( selectors );
  2543. // Positional selectors never match, since there's no _selection_ context
  2544. if ( !rneedsContext.test( selectors ) ) {
  2545. for ( ; i < l; i++ ) {
  2546. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2547. // Always skip document fragments
  2548. if ( cur.nodeType < 11 && ( targets ?
  2549. targets.index( cur ) > -1 :
  2550. // Don't pass non-elements to jQuery#find
  2551. cur.nodeType === 1 &&
  2552. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2553. matched.push( cur );
  2554. break;
  2555. }
  2556. }
  2557. }
  2558. }
  2559. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2560. },
  2561. // Determine the position of an element within the set
  2562. index: function( elem ) {
  2563. // No argument, return index in parent
  2564. if ( !elem ) {
  2565. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2566. }
  2567. // Index in selector
  2568. if ( typeof elem === "string" ) {
  2569. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2570. }
  2571. // Locate the position of the desired element
  2572. return indexOf.call( this,
  2573. // If it receives a jQuery object, the first element is used
  2574. elem.jquery ? elem[ 0 ] : elem
  2575. );
  2576. },
  2577. add: function( selector, context ) {
  2578. return this.pushStack(
  2579. jQuery.uniqueSort(
  2580. jQuery.merge( this.get(), jQuery( selector, context ) )
  2581. )
  2582. );
  2583. },
  2584. addBack: function( selector ) {
  2585. return this.add( selector == null ?
  2586. this.prevObject : this.prevObject.filter( selector )
  2587. );
  2588. }
  2589. } );
  2590. function sibling( cur, dir ) {
  2591. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2592. return cur;
  2593. }
  2594. jQuery.each( {
  2595. parent: function( elem ) {
  2596. var parent = elem.parentNode;
  2597. return parent && parent.nodeType !== 11 ? parent : null;
  2598. },
  2599. parents: function( elem ) {
  2600. return dir( elem, "parentNode" );
  2601. },
  2602. parentsUntil: function( elem, _i, until ) {
  2603. return dir( elem, "parentNode", until );
  2604. },
  2605. next: function( elem ) {
  2606. return sibling( elem, "nextSibling" );
  2607. },
  2608. prev: function( elem ) {
  2609. return sibling( elem, "previousSibling" );
  2610. },
  2611. nextAll: function( elem ) {
  2612. return dir( elem, "nextSibling" );
  2613. },
  2614. prevAll: function( elem ) {
  2615. return dir( elem, "previousSibling" );
  2616. },
  2617. nextUntil: function( elem, _i, until ) {
  2618. return dir( elem, "nextSibling", until );
  2619. },
  2620. prevUntil: function( elem, _i, until ) {
  2621. return dir( elem, "previousSibling", until );
  2622. },
  2623. siblings: function( elem ) {
  2624. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2625. },
  2626. children: function( elem ) {
  2627. return siblings( elem.firstChild );
  2628. },
  2629. contents: function( elem ) {
  2630. if ( elem.contentDocument != null &&
  2631. // Support: IE 11+
  2632. // <object> elements with no `data` attribute has an object
  2633. // `contentDocument` with a `null` prototype.
  2634. getProto( elem.contentDocument ) ) {
  2635. return elem.contentDocument;
  2636. }
  2637. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  2638. // Treat the template element as a regular one in browsers that
  2639. // don't support it.
  2640. if ( nodeName( elem, "template" ) ) {
  2641. elem = elem.content || elem;
  2642. }
  2643. return jQuery.merge( [], elem.childNodes );
  2644. }
  2645. }, function( name, fn ) {
  2646. jQuery.fn[ name ] = function( until, selector ) {
  2647. var matched = jQuery.map( this, fn, until );
  2648. if ( name.slice( -5 ) !== "Until" ) {
  2649. selector = until;
  2650. }
  2651. if ( selector && typeof selector === "string" ) {
  2652. matched = jQuery.filter( selector, matched );
  2653. }
  2654. if ( this.length > 1 ) {
  2655. // Remove duplicates
  2656. if ( !guaranteedUnique[ name ] ) {
  2657. jQuery.uniqueSort( matched );
  2658. }
  2659. // Reverse order for parents* and prev-derivatives
  2660. if ( rparentsprev.test( name ) ) {
  2661. matched.reverse();
  2662. }
  2663. }
  2664. return this.pushStack( matched );
  2665. };
  2666. } );
  2667. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2668. // Convert String-formatted options into Object-formatted ones
  2669. function createOptions( options ) {
  2670. var object = {};
  2671. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2672. object[ flag ] = true;
  2673. } );
  2674. return object;
  2675. }
  2676. /*
  2677. * Create a callback list using the following parameters:
  2678. *
  2679. * options: an optional list of space-separated options that will change how
  2680. * the callback list behaves or a more traditional option object
  2681. *
  2682. * By default a callback list will act like an event callback list and can be
  2683. * "fired" multiple times.
  2684. *
  2685. * Possible options:
  2686. *
  2687. * once: will ensure the callback list can only be fired once (like a Deferred)
  2688. *
  2689. * memory: will keep track of previous values and will call any callback added
  2690. * after the list has been fired right away with the latest "memorized"
  2691. * values (like a Deferred)
  2692. *
  2693. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2694. *
  2695. * stopOnFalse: interrupt callings when a callback returns false
  2696. *
  2697. */
  2698. jQuery.Callbacks = function( options ) {
  2699. // Convert options from String-formatted to Object-formatted if needed
  2700. // (we check in cache first)
  2701. options = typeof options === "string" ?
  2702. createOptions( options ) :
  2703. jQuery.extend( {}, options );
  2704. var // Flag to know if list is currently firing
  2705. firing,
  2706. // Last fire value for non-forgettable lists
  2707. memory,
  2708. // Flag to know if list was already fired
  2709. fired,
  2710. // Flag to prevent firing
  2711. locked,
  2712. // Actual callback list
  2713. list = [],
  2714. // Queue of execution data for repeatable lists
  2715. queue = [],
  2716. // Index of currently firing callback (modified by add/remove as needed)
  2717. firingIndex = -1,
  2718. // Fire callbacks
  2719. fire = function() {
  2720. // Enforce single-firing
  2721. locked = locked || options.once;
  2722. // Execute callbacks for all pending executions,
  2723. // respecting firingIndex overrides and runtime changes
  2724. fired = firing = true;
  2725. for ( ; queue.length; firingIndex = -1 ) {
  2726. memory = queue.shift();
  2727. while ( ++firingIndex < list.length ) {
  2728. // Run callback and check for early termination
  2729. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2730. options.stopOnFalse ) {
  2731. // Jump to end and forget the data so .add doesn't re-fire
  2732. firingIndex = list.length;
  2733. memory = false;
  2734. }
  2735. }
  2736. }
  2737. // Forget the data if we're done with it
  2738. if ( !options.memory ) {
  2739. memory = false;
  2740. }
  2741. firing = false;
  2742. // Clean up if we're done firing for good
  2743. if ( locked ) {
  2744. // Keep an empty list if we have data for future add calls
  2745. if ( memory ) {
  2746. list = [];
  2747. // Otherwise, this object is spent
  2748. } else {
  2749. list = "";
  2750. }
  2751. }
  2752. },
  2753. // Actual Callbacks object
  2754. self = {
  2755. // Add a callback or a collection of callbacks to the list
  2756. add: function() {
  2757. if ( list ) {
  2758. // If we have memory from a past run, we should fire after adding
  2759. if ( memory && !firing ) {
  2760. firingIndex = list.length - 1;
  2761. queue.push( memory );
  2762. }
  2763. ( function add( args ) {
  2764. jQuery.each( args, function( _, arg ) {
  2765. if ( isFunction( arg ) ) {
  2766. if ( !options.unique || !self.has( arg ) ) {
  2767. list.push( arg );
  2768. }
  2769. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  2770. // Inspect recursively
  2771. add( arg );
  2772. }
  2773. } );
  2774. } )( arguments );
  2775. if ( memory && !firing ) {
  2776. fire();
  2777. }
  2778. }
  2779. return this;
  2780. },
  2781. // Remove a callback from the list
  2782. remove: function() {
  2783. jQuery.each( arguments, function( _, arg ) {
  2784. var index;
  2785. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2786. list.splice( index, 1 );
  2787. // Handle firing indexes
  2788. if ( index <= firingIndex ) {
  2789. firingIndex--;
  2790. }
  2791. }
  2792. } );
  2793. return this;
  2794. },
  2795. // Check if a given callback is in the list.
  2796. // If no argument is given, return whether or not list has callbacks attached.
  2797. has: function( fn ) {
  2798. return fn ?
  2799. jQuery.inArray( fn, list ) > -1 :
  2800. list.length > 0;
  2801. },
  2802. // Remove all callbacks from the list
  2803. empty: function() {
  2804. if ( list ) {
  2805. list = [];
  2806. }
  2807. return this;
  2808. },
  2809. // Disable .fire and .add
  2810. // Abort any current/pending executions
  2811. // Clear all callbacks and values
  2812. disable: function() {
  2813. locked = queue = [];
  2814. list = memory = "";
  2815. return this;
  2816. },
  2817. disabled: function() {
  2818. return !list;
  2819. },
  2820. // Disable .fire
  2821. // Also disable .add unless we have memory (since it would have no effect)
  2822. // Abort any pending executions
  2823. lock: function() {
  2824. locked = queue = [];
  2825. if ( !memory && !firing ) {
  2826. list = memory = "";
  2827. }
  2828. return this;
  2829. },
  2830. locked: function() {
  2831. return !!locked;
  2832. },
  2833. // Call all callbacks with the given context and arguments
  2834. fireWith: function( context, args ) {
  2835. if ( !locked ) {
  2836. args = args || [];
  2837. args = [ context, args.slice ? args.slice() : args ];
  2838. queue.push( args );
  2839. if ( !firing ) {
  2840. fire();
  2841. }
  2842. }
  2843. return this;
  2844. },
  2845. // Call all the callbacks with the given arguments
  2846. fire: function() {
  2847. self.fireWith( this, arguments );
  2848. return this;
  2849. },
  2850. // To know if the callbacks have already been called at least once
  2851. fired: function() {
  2852. return !!fired;
  2853. }
  2854. };
  2855. return self;
  2856. };
  2857. function Identity( v ) {
  2858. return v;
  2859. }
  2860. function Thrower( ex ) {
  2861. throw ex;
  2862. }
  2863. function adoptValue( value, resolve, reject, noValue ) {
  2864. var method;
  2865. try {
  2866. // Check for promise aspect first to privilege synchronous behavior
  2867. if ( value && isFunction( ( method = value.promise ) ) ) {
  2868. method.call( value ).done( resolve ).fail( reject );
  2869. // Other thenables
  2870. } else if ( value && isFunction( ( method = value.then ) ) ) {
  2871. method.call( value, resolve, reject );
  2872. // Other non-thenables
  2873. } else {
  2874. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  2875. // * false: [ value ].slice( 0 ) => resolve( value )
  2876. // * true: [ value ].slice( 1 ) => resolve()
  2877. resolve.apply( undefined, [ value ].slice( noValue ) );
  2878. }
  2879. // For Promises/A+, convert exceptions into rejections
  2880. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  2881. // Deferred#then to conditionally suppress rejection.
  2882. } catch ( value ) {
  2883. // Support: Android 4.0 only
  2884. // Strict mode functions invoked without .call/.apply get global-object context
  2885. reject.apply( undefined, [ value ] );
  2886. }
  2887. }
  2888. jQuery.extend( {
  2889. Deferred: function( func ) {
  2890. var tuples = [
  2891. // action, add listener, callbacks,
  2892. // ... .then handlers, argument index, [final state]
  2893. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  2894. jQuery.Callbacks( "memory" ), 2 ],
  2895. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  2896. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  2897. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  2898. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  2899. ],
  2900. state = "pending",
  2901. promise = {
  2902. state: function() {
  2903. return state;
  2904. },
  2905. always: function() {
  2906. deferred.done( arguments ).fail( arguments );
  2907. return this;
  2908. },
  2909. "catch": function( fn ) {
  2910. return promise.then( null, fn );
  2911. },
  2912. // Keep pipe for back-compat
  2913. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  2914. var fns = arguments;
  2915. return jQuery.Deferred( function( newDefer ) {
  2916. jQuery.each( tuples, function( _i, tuple ) {
  2917. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  2918. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  2919. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  2920. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  2921. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  2922. deferred[ tuple[ 1 ] ]( function() {
  2923. var returned = fn && fn.apply( this, arguments );
  2924. if ( returned && isFunction( returned.promise ) ) {
  2925. returned.promise()
  2926. .progress( newDefer.notify )
  2927. .done( newDefer.resolve )
  2928. .fail( newDefer.reject );
  2929. } else {
  2930. newDefer[ tuple[ 0 ] + "With" ](
  2931. this,
  2932. fn ? [ returned ] : arguments
  2933. );
  2934. }
  2935. } );
  2936. } );
  2937. fns = null;
  2938. } ).promise();
  2939. },
  2940. then: function( onFulfilled, onRejected, onProgress ) {
  2941. var maxDepth = 0;
  2942. function resolve( depth, deferred, handler, special ) {
  2943. return function() {
  2944. var that = this,
  2945. args = arguments,
  2946. mightThrow = function() {
  2947. var returned, then;
  2948. // Support: Promises/A+ section 2.3.3.3.3
  2949. // https://promisesaplus.com/#point-59
  2950. // Ignore double-resolution attempts
  2951. if ( depth < maxDepth ) {
  2952. return;
  2953. }
  2954. returned = handler.apply( that, args );
  2955. // Support: Promises/A+ section 2.3.1
  2956. // https://promisesaplus.com/#point-48
  2957. if ( returned === deferred.promise() ) {
  2958. throw new TypeError( "Thenable self-resolution" );
  2959. }
  2960. // Support: Promises/A+ sections 2.3.3.1, 3.5
  2961. // https://promisesaplus.com/#point-54
  2962. // https://promisesaplus.com/#point-75
  2963. // Retrieve `then` only once
  2964. then = returned &&
  2965. // Support: Promises/A+ section 2.3.4
  2966. // https://promisesaplus.com/#point-64
  2967. // Only check objects and functions for thenability
  2968. ( typeof returned === "object" ||
  2969. typeof returned === "function" ) &&
  2970. returned.then;
  2971. // Handle a returned thenable
  2972. if ( isFunction( then ) ) {
  2973. // Special processors (notify) just wait for resolution
  2974. if ( special ) {
  2975. then.call(
  2976. returned,
  2977. resolve( maxDepth, deferred, Identity, special ),
  2978. resolve( maxDepth, deferred, Thrower, special )
  2979. );
  2980. // Normal processors (resolve) also hook into progress
  2981. } else {
  2982. // ...and disregard older resolution values
  2983. maxDepth++;
  2984. then.call(
  2985. returned,
  2986. resolve( maxDepth, deferred, Identity, special ),
  2987. resolve( maxDepth, deferred, Thrower, special ),
  2988. resolve( maxDepth, deferred, Identity,
  2989. deferred.notifyWith )
  2990. );
  2991. }
  2992. // Handle all other returned values
  2993. } else {
  2994. // Only substitute handlers pass on context
  2995. // and multiple values (non-spec behavior)
  2996. if ( handler !== Identity ) {
  2997. that = undefined;
  2998. args = [ returned ];
  2999. }
  3000. // Process the value(s)
  3001. // Default process is resolve
  3002. ( special || deferred.resolveWith )( that, args );
  3003. }
  3004. },
  3005. // Only normal processors (resolve) catch and reject exceptions
  3006. process = special ?
  3007. mightThrow :
  3008. function() {
  3009. try {
  3010. mightThrow();
  3011. } catch ( e ) {
  3012. if ( jQuery.Deferred.exceptionHook ) {
  3013. jQuery.Deferred.exceptionHook( e,
  3014. process.error );
  3015. }
  3016. // Support: Promises/A+ section 2.3.3.3.4.1
  3017. // https://promisesaplus.com/#point-61
  3018. // Ignore post-resolution exceptions
  3019. if ( depth + 1 >= maxDepth ) {
  3020. // Only substitute handlers pass on context
  3021. // and multiple values (non-spec behavior)
  3022. if ( handler !== Thrower ) {
  3023. that = undefined;
  3024. args = [ e ];
  3025. }
  3026. deferred.rejectWith( that, args );
  3027. }
  3028. }
  3029. };
  3030. // Support: Promises/A+ section 2.3.3.3.1
  3031. // https://promisesaplus.com/#point-57
  3032. // Re-resolve promises immediately to dodge false rejection from
  3033. // subsequent errors
  3034. if ( depth ) {
  3035. process();
  3036. } else {
  3037. // Call an optional hook to record the error, in case of exception
  3038. // since it's otherwise lost when execution goes async
  3039. if ( jQuery.Deferred.getErrorHook ) {
  3040. process.error = jQuery.Deferred.getErrorHook();
  3041. // The deprecated alias of the above. While the name suggests
  3042. // returning the stack, not an error instance, jQuery just passes
  3043. // it directly to `console.warn` so both will work; an instance
  3044. // just better cooperates with source maps.
  3045. } else if ( jQuery.Deferred.getStackHook ) {
  3046. process.error = jQuery.Deferred.getStackHook();
  3047. }
  3048. window.setTimeout( process );
  3049. }
  3050. };
  3051. }
  3052. return jQuery.Deferred( function( newDefer ) {
  3053. // progress_handlers.add( ... )
  3054. tuples[ 0 ][ 3 ].add(
  3055. resolve(
  3056. 0,
  3057. newDefer,
  3058. isFunction( onProgress ) ?
  3059. onProgress :
  3060. Identity,
  3061. newDefer.notifyWith
  3062. )
  3063. );
  3064. // fulfilled_handlers.add( ... )
  3065. tuples[ 1 ][ 3 ].add(
  3066. resolve(
  3067. 0,
  3068. newDefer,
  3069. isFunction( onFulfilled ) ?
  3070. onFulfilled :
  3071. Identity
  3072. )
  3073. );
  3074. // rejected_handlers.add( ... )
  3075. tuples[ 2 ][ 3 ].add(
  3076. resolve(
  3077. 0,
  3078. newDefer,
  3079. isFunction( onRejected ) ?
  3080. onRejected :
  3081. Thrower
  3082. )
  3083. );
  3084. } ).promise();
  3085. },
  3086. // Get a promise for this deferred
  3087. // If obj is provided, the promise aspect is added to the object
  3088. promise: function( obj ) {
  3089. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3090. }
  3091. },
  3092. deferred = {};
  3093. // Add list-specific methods
  3094. jQuery.each( tuples, function( i, tuple ) {
  3095. var list = tuple[ 2 ],
  3096. stateString = tuple[ 5 ];
  3097. // promise.progress = list.add
  3098. // promise.done = list.add
  3099. // promise.fail = list.add
  3100. promise[ tuple[ 1 ] ] = list.add;
  3101. // Handle state
  3102. if ( stateString ) {
  3103. list.add(
  3104. function() {
  3105. // state = "resolved" (i.e., fulfilled)
  3106. // state = "rejected"
  3107. state = stateString;
  3108. },
  3109. // rejected_callbacks.disable
  3110. // fulfilled_callbacks.disable
  3111. tuples[ 3 - i ][ 2 ].disable,
  3112. // rejected_handlers.disable
  3113. // fulfilled_handlers.disable
  3114. tuples[ 3 - i ][ 3 ].disable,
  3115. // progress_callbacks.lock
  3116. tuples[ 0 ][ 2 ].lock,
  3117. // progress_handlers.lock
  3118. tuples[ 0 ][ 3 ].lock
  3119. );
  3120. }
  3121. // progress_handlers.fire
  3122. // fulfilled_handlers.fire
  3123. // rejected_handlers.fire
  3124. list.add( tuple[ 3 ].fire );
  3125. // deferred.notify = function() { deferred.notifyWith(...) }
  3126. // deferred.resolve = function() { deferred.resolveWith(...) }
  3127. // deferred.reject = function() { deferred.rejectWith(...) }
  3128. deferred[ tuple[ 0 ] ] = function() {
  3129. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3130. return this;
  3131. };
  3132. // deferred.notifyWith = list.fireWith
  3133. // deferred.resolveWith = list.fireWith
  3134. // deferred.rejectWith = list.fireWith
  3135. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3136. } );
  3137. // Make the deferred a promise
  3138. promise.promise( deferred );
  3139. // Call given func if any
  3140. if ( func ) {
  3141. func.call( deferred, deferred );
  3142. }
  3143. // All done!
  3144. return deferred;
  3145. },
  3146. // Deferred helper
  3147. when: function( singleValue ) {
  3148. var
  3149. // count of uncompleted subordinates
  3150. remaining = arguments.length,
  3151. // count of unprocessed arguments
  3152. i = remaining,
  3153. // subordinate fulfillment data
  3154. resolveContexts = Array( i ),
  3155. resolveValues = slice.call( arguments ),
  3156. // the primary Deferred
  3157. primary = jQuery.Deferred(),
  3158. // subordinate callback factory
  3159. updateFunc = function( i ) {
  3160. return function( value ) {
  3161. resolveContexts[ i ] = this;
  3162. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3163. if ( !( --remaining ) ) {
  3164. primary.resolveWith( resolveContexts, resolveValues );
  3165. }
  3166. };
  3167. };
  3168. // Single- and empty arguments are adopted like Promise.resolve
  3169. if ( remaining <= 1 ) {
  3170. adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
  3171. !remaining );
  3172. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3173. if ( primary.state() === "pending" ||
  3174. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3175. return primary.then();
  3176. }
  3177. }
  3178. // Multiple arguments are aggregated like Promise.all array elements
  3179. while ( i-- ) {
  3180. adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
  3181. }
  3182. return primary.promise();
  3183. }
  3184. } );
  3185. // These usually indicate a programmer mistake during development,
  3186. // warn about them ASAP rather than swallowing them by default.
  3187. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3188. // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
  3189. // captured before the async barrier to get the original error cause
  3190. // which may otherwise be hidden.
  3191. jQuery.Deferred.exceptionHook = function( error, asyncError ) {
  3192. // Support: IE 8 - 9 only
  3193. // Console exists when dev tools are open, which can happen at any time
  3194. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3195. window.console.warn( "jQuery.Deferred exception: " + error.message,
  3196. error.stack, asyncError );
  3197. }
  3198. };
  3199. jQuery.readyException = function( error ) {
  3200. window.setTimeout( function() {
  3201. throw error;
  3202. } );
  3203. };
  3204. // The deferred used on DOM ready
  3205. var readyList = jQuery.Deferred();
  3206. jQuery.fn.ready = function( fn ) {
  3207. readyList
  3208. .then( fn )
  3209. // Wrap jQuery.readyException in a function so that the lookup
  3210. // happens at the time of error handling instead of callback
  3211. // registration.
  3212. .catch( function( error ) {
  3213. jQuery.readyException( error );
  3214. } );
  3215. return this;
  3216. };
  3217. jQuery.extend( {
  3218. // Is the DOM ready to be used? Set to true once it occurs.
  3219. isReady: false,
  3220. // A counter to track how many items to wait for before
  3221. // the ready event fires. See trac-6781
  3222. readyWait: 1,
  3223. // Handle when the DOM is ready
  3224. ready: function( wait ) {
  3225. // Abort if there are pending holds or we're already ready
  3226. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3227. return;
  3228. }
  3229. // Remember that the DOM is ready
  3230. jQuery.isReady = true;
  3231. // If a normal DOM Ready event fired, decrement, and wait if need be
  3232. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3233. return;
  3234. }
  3235. // If there are functions bound, to execute
  3236. readyList.resolveWith( document, [ jQuery ] );
  3237. }
  3238. } );
  3239. jQuery.ready.then = readyList.then;
  3240. // The ready event handler and self cleanup method
  3241. function completed() {
  3242. document.removeEventListener( "DOMContentLoaded", completed );
  3243. window.removeEventListener( "load", completed );
  3244. jQuery.ready();
  3245. }
  3246. // Catch cases where $(document).ready() is called
  3247. // after the browser event has already occurred.
  3248. // Support: IE <=9 - 10 only
  3249. // Older IE sometimes signals "interactive" too soon
  3250. if ( document.readyState === "complete" ||
  3251. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3252. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3253. window.setTimeout( jQuery.ready );
  3254. } else {
  3255. // Use the handy event callback
  3256. document.addEventListener( "DOMContentLoaded", completed );
  3257. // A fallback to window.onload, that will always work
  3258. window.addEventListener( "load", completed );
  3259. }
  3260. // Multifunctional method to get and set values of a collection
  3261. // The value/s can optionally be executed if it's a function
  3262. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3263. var i = 0,
  3264. len = elems.length,
  3265. bulk = key == null;
  3266. // Sets many values
  3267. if ( toType( key ) === "object" ) {
  3268. chainable = true;
  3269. for ( i in key ) {
  3270. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3271. }
  3272. // Sets one value
  3273. } else if ( value !== undefined ) {
  3274. chainable = true;
  3275. if ( !isFunction( value ) ) {
  3276. raw = true;
  3277. }
  3278. if ( bulk ) {
  3279. // Bulk operations run against the entire set
  3280. if ( raw ) {
  3281. fn.call( elems, value );
  3282. fn = null;
  3283. // ...except when executing function values
  3284. } else {
  3285. bulk = fn;
  3286. fn = function( elem, _key, value ) {
  3287. return bulk.call( jQuery( elem ), value );
  3288. };
  3289. }
  3290. }
  3291. if ( fn ) {
  3292. for ( ; i < len; i++ ) {
  3293. fn(
  3294. elems[ i ], key, raw ?
  3295. value :
  3296. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3297. );
  3298. }
  3299. }
  3300. }
  3301. if ( chainable ) {
  3302. return elems;
  3303. }
  3304. // Gets
  3305. if ( bulk ) {
  3306. return fn.call( elems );
  3307. }
  3308. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3309. };
  3310. // Matches dashed string for camelizing
  3311. var rmsPrefix = /^-ms-/,
  3312. rdashAlpha = /-([a-z])/g;
  3313. // Used by camelCase as callback to replace()
  3314. function fcamelCase( _all, letter ) {
  3315. return letter.toUpperCase();
  3316. }
  3317. // Convert dashed to camelCase; used by the css and data modules
  3318. // Support: IE <=9 - 11, Edge 12 - 15
  3319. // Microsoft forgot to hump their vendor prefix (trac-9572)
  3320. function camelCase( string ) {
  3321. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3322. }
  3323. var acceptData = function( owner ) {
  3324. // Accepts only:
  3325. // - Node
  3326. // - Node.ELEMENT_NODE
  3327. // - Node.DOCUMENT_NODE
  3328. // - Object
  3329. // - Any
  3330. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3331. };
  3332. function Data() {
  3333. this.expando = jQuery.expando + Data.uid++;
  3334. }
  3335. Data.uid = 1;
  3336. Data.prototype = {
  3337. cache: function( owner ) {
  3338. // Check if the owner object already has a cache
  3339. var value = owner[ this.expando ];
  3340. // If not, create one
  3341. if ( !value ) {
  3342. value = {};
  3343. // We can accept data for non-element nodes in modern browsers,
  3344. // but we should not, see trac-8335.
  3345. // Always return an empty object.
  3346. if ( acceptData( owner ) ) {
  3347. // If it is a node unlikely to be stringify-ed or looped over
  3348. // use plain assignment
  3349. if ( owner.nodeType ) {
  3350. owner[ this.expando ] = value;
  3351. // Otherwise secure it in a non-enumerable property
  3352. // configurable must be true to allow the property to be
  3353. // deleted when data is removed
  3354. } else {
  3355. Object.defineProperty( owner, this.expando, {
  3356. value: value,
  3357. configurable: true
  3358. } );
  3359. }
  3360. }
  3361. }
  3362. return value;
  3363. },
  3364. set: function( owner, data, value ) {
  3365. var prop,
  3366. cache = this.cache( owner );
  3367. // Handle: [ owner, key, value ] args
  3368. // Always use camelCase key (gh-2257)
  3369. if ( typeof data === "string" ) {
  3370. cache[ camelCase( data ) ] = value;
  3371. // Handle: [ owner, { properties } ] args
  3372. } else {
  3373. // Copy the properties one-by-one to the cache object
  3374. for ( prop in data ) {
  3375. cache[ camelCase( prop ) ] = data[ prop ];
  3376. }
  3377. }
  3378. return cache;
  3379. },
  3380. get: function( owner, key ) {
  3381. return key === undefined ?
  3382. this.cache( owner ) :
  3383. // Always use camelCase key (gh-2257)
  3384. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  3385. },
  3386. access: function( owner, key, value ) {
  3387. // In cases where either:
  3388. //
  3389. // 1. No key was specified
  3390. // 2. A string key was specified, but no value provided
  3391. //
  3392. // Take the "read" path and allow the get method to determine
  3393. // which value to return, respectively either:
  3394. //
  3395. // 1. The entire cache object
  3396. // 2. The data stored at the key
  3397. //
  3398. if ( key === undefined ||
  3399. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3400. return this.get( owner, key );
  3401. }
  3402. // When the key is not a string, or both a key and value
  3403. // are specified, set or extend (existing objects) with either:
  3404. //
  3405. // 1. An object of properties
  3406. // 2. A key and value
  3407. //
  3408. this.set( owner, key, value );
  3409. // Since the "set" path can have two possible entry points
  3410. // return the expected data based on which path was taken[*]
  3411. return value !== undefined ? value : key;
  3412. },
  3413. remove: function( owner, key ) {
  3414. var i,
  3415. cache = owner[ this.expando ];
  3416. if ( cache === undefined ) {
  3417. return;
  3418. }
  3419. if ( key !== undefined ) {
  3420. // Support array or space separated string of keys
  3421. if ( Array.isArray( key ) ) {
  3422. // If key is an array of keys...
  3423. // We always set camelCase keys, so remove that.
  3424. key = key.map( camelCase );
  3425. } else {
  3426. key = camelCase( key );
  3427. // If a key with the spaces exists, use it.
  3428. // Otherwise, create an array by matching non-whitespace
  3429. key = key in cache ?
  3430. [ key ] :
  3431. ( key.match( rnothtmlwhite ) || [] );
  3432. }
  3433. i = key.length;
  3434. while ( i-- ) {
  3435. delete cache[ key[ i ] ];
  3436. }
  3437. }
  3438. // Remove the expando if there's no more data
  3439. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3440. // Support: Chrome <=35 - 45
  3441. // Webkit & Blink performance suffers when deleting properties
  3442. // from DOM nodes, so set to undefined instead
  3443. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3444. if ( owner.nodeType ) {
  3445. owner[ this.expando ] = undefined;
  3446. } else {
  3447. delete owner[ this.expando ];
  3448. }
  3449. }
  3450. },
  3451. hasData: function( owner ) {
  3452. var cache = owner[ this.expando ];
  3453. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3454. }
  3455. };
  3456. var dataPriv = new Data();
  3457. var dataUser = new Data();
  3458. // Implementation Summary
  3459. //
  3460. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3461. // 2. Improve the module's maintainability by reducing the storage
  3462. // paths to a single mechanism.
  3463. // 3. Use the same single mechanism to support "private" and "user" data.
  3464. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3465. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3466. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3467. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3468. rmultiDash = /[A-Z]/g;
  3469. function getData( data ) {
  3470. if ( data === "true" ) {
  3471. return true;
  3472. }
  3473. if ( data === "false" ) {
  3474. return false;
  3475. }
  3476. if ( data === "null" ) {
  3477. return null;
  3478. }
  3479. // Only convert to a number if it doesn't change the string
  3480. if ( data === +data + "" ) {
  3481. return +data;
  3482. }
  3483. if ( rbrace.test( data ) ) {
  3484. return JSON.parse( data );
  3485. }
  3486. return data;
  3487. }
  3488. function dataAttr( elem, key, data ) {
  3489. var name;
  3490. // If nothing was found internally, try to fetch any
  3491. // data from the HTML5 data-* attribute
  3492. if ( data === undefined && elem.nodeType === 1 ) {
  3493. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3494. data = elem.getAttribute( name );
  3495. if ( typeof data === "string" ) {
  3496. try {
  3497. data = getData( data );
  3498. } catch ( e ) {}
  3499. // Make sure we set the data so it isn't changed later
  3500. dataUser.set( elem, key, data );
  3501. } else {
  3502. data = undefined;
  3503. }
  3504. }
  3505. return data;
  3506. }
  3507. jQuery.extend( {
  3508. hasData: function( elem ) {
  3509. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3510. },
  3511. data: function( elem, name, data ) {
  3512. return dataUser.access( elem, name, data );
  3513. },
  3514. removeData: function( elem, name ) {
  3515. dataUser.remove( elem, name );
  3516. },
  3517. // TODO: Now that all calls to _data and _removeData have been replaced
  3518. // with direct calls to dataPriv methods, these can be deprecated.
  3519. _data: function( elem, name, data ) {
  3520. return dataPriv.access( elem, name, data );
  3521. },
  3522. _removeData: function( elem, name ) {
  3523. dataPriv.remove( elem, name );
  3524. }
  3525. } );
  3526. jQuery.fn.extend( {
  3527. data: function( key, value ) {
  3528. var i, name, data,
  3529. elem = this[ 0 ],
  3530. attrs = elem && elem.attributes;
  3531. // Gets all values
  3532. if ( key === undefined ) {
  3533. if ( this.length ) {
  3534. data = dataUser.get( elem );
  3535. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3536. i = attrs.length;
  3537. while ( i-- ) {
  3538. // Support: IE 11 only
  3539. // The attrs elements can be null (trac-14894)
  3540. if ( attrs[ i ] ) {
  3541. name = attrs[ i ].name;
  3542. if ( name.indexOf( "data-" ) === 0 ) {
  3543. name = camelCase( name.slice( 5 ) );
  3544. dataAttr( elem, name, data[ name ] );
  3545. }
  3546. }
  3547. }
  3548. dataPriv.set( elem, "hasDataAttrs", true );
  3549. }
  3550. }
  3551. return data;
  3552. }
  3553. // Sets multiple values
  3554. if ( typeof key === "object" ) {
  3555. return this.each( function() {
  3556. dataUser.set( this, key );
  3557. } );
  3558. }
  3559. return access( this, function( value ) {
  3560. var data;
  3561. // The calling jQuery object (element matches) is not empty
  3562. // (and therefore has an element appears at this[ 0 ]) and the
  3563. // `value` parameter was not undefined. An empty jQuery object
  3564. // will result in `undefined` for elem = this[ 0 ] which will
  3565. // throw an exception if an attempt to read a data cache is made.
  3566. if ( elem && value === undefined ) {
  3567. // Attempt to get data from the cache
  3568. // The key will always be camelCased in Data
  3569. data = dataUser.get( elem, key );
  3570. if ( data !== undefined ) {
  3571. return data;
  3572. }
  3573. // Attempt to "discover" the data in
  3574. // HTML5 custom data-* attrs
  3575. data = dataAttr( elem, key );
  3576. if ( data !== undefined ) {
  3577. return data;
  3578. }
  3579. // We tried really hard, but the data doesn't exist.
  3580. return;
  3581. }
  3582. // Set the data...
  3583. this.each( function() {
  3584. // We always store the camelCased key
  3585. dataUser.set( this, key, value );
  3586. } );
  3587. }, null, value, arguments.length > 1, null, true );
  3588. },
  3589. removeData: function( key ) {
  3590. return this.each( function() {
  3591. dataUser.remove( this, key );
  3592. } );
  3593. }
  3594. } );
  3595. jQuery.extend( {
  3596. queue: function( elem, type, data ) {
  3597. var queue;
  3598. if ( elem ) {
  3599. type = ( type || "fx" ) + "queue";
  3600. queue = dataPriv.get( elem, type );
  3601. // Speed up dequeue by getting out quickly if this is just a lookup
  3602. if ( data ) {
  3603. if ( !queue || Array.isArray( data ) ) {
  3604. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3605. } else {
  3606. queue.push( data );
  3607. }
  3608. }
  3609. return queue || [];
  3610. }
  3611. },
  3612. dequeue: function( elem, type ) {
  3613. type = type || "fx";
  3614. var queue = jQuery.queue( elem, type ),
  3615. startLength = queue.length,
  3616. fn = queue.shift(),
  3617. hooks = jQuery._queueHooks( elem, type ),
  3618. next = function() {
  3619. jQuery.dequeue( elem, type );
  3620. };
  3621. // If the fx queue is dequeued, always remove the progress sentinel
  3622. if ( fn === "inprogress" ) {
  3623. fn = queue.shift();
  3624. startLength--;
  3625. }
  3626. if ( fn ) {
  3627. // Add a progress sentinel to prevent the fx queue from being
  3628. // automatically dequeued
  3629. if ( type === "fx" ) {
  3630. queue.unshift( "inprogress" );
  3631. }
  3632. // Clear up the last queue stop function
  3633. delete hooks.stop;
  3634. fn.call( elem, next, hooks );
  3635. }
  3636. if ( !startLength && hooks ) {
  3637. hooks.empty.fire();
  3638. }
  3639. },
  3640. // Not public - generate a queueHooks object, or return the current one
  3641. _queueHooks: function( elem, type ) {
  3642. var key = type + "queueHooks";
  3643. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3644. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3645. dataPriv.remove( elem, [ type + "queue", key ] );
  3646. } )
  3647. } );
  3648. }
  3649. } );
  3650. jQuery.fn.extend( {
  3651. queue: function( type, data ) {
  3652. var setter = 2;
  3653. if ( typeof type !== "string" ) {
  3654. data = type;
  3655. type = "fx";
  3656. setter--;
  3657. }
  3658. if ( arguments.length < setter ) {
  3659. return jQuery.queue( this[ 0 ], type );
  3660. }
  3661. return data === undefined ?
  3662. this :
  3663. this.each( function() {
  3664. var queue = jQuery.queue( this, type, data );
  3665. // Ensure a hooks for this queue
  3666. jQuery._queueHooks( this, type );
  3667. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3668. jQuery.dequeue( this, type );
  3669. }
  3670. } );
  3671. },
  3672. dequeue: function( type ) {
  3673. return this.each( function() {
  3674. jQuery.dequeue( this, type );
  3675. } );
  3676. },
  3677. clearQueue: function( type ) {
  3678. return this.queue( type || "fx", [] );
  3679. },
  3680. // Get a promise resolved when queues of a certain type
  3681. // are emptied (fx is the type by default)
  3682. promise: function( type, obj ) {
  3683. var tmp,
  3684. count = 1,
  3685. defer = jQuery.Deferred(),
  3686. elements = this,
  3687. i = this.length,
  3688. resolve = function() {
  3689. if ( !( --count ) ) {
  3690. defer.resolveWith( elements, [ elements ] );
  3691. }
  3692. };
  3693. if ( typeof type !== "string" ) {
  3694. obj = type;
  3695. type = undefined;
  3696. }
  3697. type = type || "fx";
  3698. while ( i-- ) {
  3699. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3700. if ( tmp && tmp.empty ) {
  3701. count++;
  3702. tmp.empty.add( resolve );
  3703. }
  3704. }
  3705. resolve();
  3706. return defer.promise( obj );
  3707. }
  3708. } );
  3709. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3710. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3711. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3712. var documentElement = document.documentElement;
  3713. var isAttached = function( elem ) {
  3714. return jQuery.contains( elem.ownerDocument, elem );
  3715. },
  3716. composed = { composed: true };
  3717. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  3718. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  3719. // Support: iOS 10.0-10.2 only
  3720. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  3721. // leading to errors. We need to check for `getRootNode`.
  3722. if ( documentElement.getRootNode ) {
  3723. isAttached = function( elem ) {
  3724. return jQuery.contains( elem.ownerDocument, elem ) ||
  3725. elem.getRootNode( composed ) === elem.ownerDocument;
  3726. };
  3727. }
  3728. var isHiddenWithinTree = function( elem, el ) {
  3729. // isHiddenWithinTree might be called from jQuery#filter function;
  3730. // in that case, element will be second argument
  3731. elem = el || elem;
  3732. // Inline style trumps all
  3733. return elem.style.display === "none" ||
  3734. elem.style.display === "" &&
  3735. // Otherwise, check computed style
  3736. // Support: Firefox <=43 - 45
  3737. // Disconnected elements can have computed display: none, so first confirm that elem is
  3738. // in the document.
  3739. isAttached( elem ) &&
  3740. jQuery.css( elem, "display" ) === "none";
  3741. };
  3742. function adjustCSS( elem, prop, valueParts, tween ) {
  3743. var adjusted, scale,
  3744. maxIterations = 20,
  3745. currentValue = tween ?
  3746. function() {
  3747. return tween.cur();
  3748. } :
  3749. function() {
  3750. return jQuery.css( elem, prop, "" );
  3751. },
  3752. initial = currentValue(),
  3753. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3754. // Starting value computation is required for potential unit mismatches
  3755. initialInUnit = elem.nodeType &&
  3756. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3757. rcssNum.exec( jQuery.css( elem, prop ) );
  3758. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3759. // Support: Firefox <=54
  3760. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  3761. initial = initial / 2;
  3762. // Trust units reported by jQuery.css
  3763. unit = unit || initialInUnit[ 3 ];
  3764. // Iteratively approximate from a nonzero starting point
  3765. initialInUnit = +initial || 1;
  3766. while ( maxIterations-- ) {
  3767. // Evaluate and update our best guess (doubling guesses that zero out).
  3768. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  3769. jQuery.style( elem, prop, initialInUnit + unit );
  3770. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  3771. maxIterations = 0;
  3772. }
  3773. initialInUnit = initialInUnit / scale;
  3774. }
  3775. initialInUnit = initialInUnit * 2;
  3776. jQuery.style( elem, prop, initialInUnit + unit );
  3777. // Make sure we update the tween properties later on
  3778. valueParts = valueParts || [];
  3779. }
  3780. if ( valueParts ) {
  3781. initialInUnit = +initialInUnit || +initial || 0;
  3782. // Apply relative offset (+=/-=) if specified
  3783. adjusted = valueParts[ 1 ] ?
  3784. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3785. +valueParts[ 2 ];
  3786. if ( tween ) {
  3787. tween.unit = unit;
  3788. tween.start = initialInUnit;
  3789. tween.end = adjusted;
  3790. }
  3791. }
  3792. return adjusted;
  3793. }
  3794. var defaultDisplayMap = {};
  3795. function getDefaultDisplay( elem ) {
  3796. var temp,
  3797. doc = elem.ownerDocument,
  3798. nodeName = elem.nodeName,
  3799. display = defaultDisplayMap[ nodeName ];
  3800. if ( display ) {
  3801. return display;
  3802. }
  3803. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3804. display = jQuery.css( temp, "display" );
  3805. temp.parentNode.removeChild( temp );
  3806. if ( display === "none" ) {
  3807. display = "block";
  3808. }
  3809. defaultDisplayMap[ nodeName ] = display;
  3810. return display;
  3811. }
  3812. function showHide( elements, show ) {
  3813. var display, elem,
  3814. values = [],
  3815. index = 0,
  3816. length = elements.length;
  3817. // Determine new display value for elements that need to change
  3818. for ( ; index < length; index++ ) {
  3819. elem = elements[ index ];
  3820. if ( !elem.style ) {
  3821. continue;
  3822. }
  3823. display = elem.style.display;
  3824. if ( show ) {
  3825. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3826. // check is required in this first loop unless we have a nonempty display value (either
  3827. // inline or about-to-be-restored)
  3828. if ( display === "none" ) {
  3829. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3830. if ( !values[ index ] ) {
  3831. elem.style.display = "";
  3832. }
  3833. }
  3834. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3835. values[ index ] = getDefaultDisplay( elem );
  3836. }
  3837. } else {
  3838. if ( display !== "none" ) {
  3839. values[ index ] = "none";
  3840. // Remember what we're overwriting
  3841. dataPriv.set( elem, "display", display );
  3842. }
  3843. }
  3844. }
  3845. // Set the display of the elements in a second loop to avoid constant reflow
  3846. for ( index = 0; index < length; index++ ) {
  3847. if ( values[ index ] != null ) {
  3848. elements[ index ].style.display = values[ index ];
  3849. }
  3850. }
  3851. return elements;
  3852. }
  3853. jQuery.fn.extend( {
  3854. show: function() {
  3855. return showHide( this, true );
  3856. },
  3857. hide: function() {
  3858. return showHide( this );
  3859. },
  3860. toggle: function( state ) {
  3861. if ( typeof state === "boolean" ) {
  3862. return state ? this.show() : this.hide();
  3863. }
  3864. return this.each( function() {
  3865. if ( isHiddenWithinTree( this ) ) {
  3866. jQuery( this ).show();
  3867. } else {
  3868. jQuery( this ).hide();
  3869. }
  3870. } );
  3871. }
  3872. } );
  3873. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3874. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  3875. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  3876. ( function() {
  3877. var fragment = document.createDocumentFragment(),
  3878. div = fragment.appendChild( document.createElement( "div" ) ),
  3879. input = document.createElement( "input" );
  3880. // Support: Android 4.0 - 4.3 only
  3881. // Check state lost if the name is set (trac-11217)
  3882. // Support: Windows Web Apps (WWA)
  3883. // `name` and `type` must use .setAttribute for WWA (trac-14901)
  3884. input.setAttribute( "type", "radio" );
  3885. input.setAttribute( "checked", "checked" );
  3886. input.setAttribute( "name", "t" );
  3887. div.appendChild( input );
  3888. // Support: Android <=4.1 only
  3889. // Older WebKit doesn't clone checked state correctly in fragments
  3890. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3891. // Support: IE <=11 only
  3892. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3893. div.innerHTML = "<textarea>x</textarea>";
  3894. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3895. // Support: IE <=9 only
  3896. // IE <=9 replaces <option> tags with their contents when inserted outside of
  3897. // the select element.
  3898. div.innerHTML = "<option></option>";
  3899. support.option = !!div.lastChild;
  3900. } )();
  3901. // We have to close these tags to support XHTML (trac-13200)
  3902. var wrapMap = {
  3903. // XHTML parsers do not magically insert elements in the
  3904. // same way that tag soup parsers do. So we cannot shorten
  3905. // this by omitting <tbody> or other required elements.
  3906. thead: [ 1, "<table>", "</table>" ],
  3907. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  3908. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  3909. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  3910. _default: [ 0, "", "" ]
  3911. };
  3912. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  3913. wrapMap.th = wrapMap.td;
  3914. // Support: IE <=9 only
  3915. if ( !support.option ) {
  3916. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  3917. }
  3918. function getAll( context, tag ) {
  3919. // Support: IE <=9 - 11 only
  3920. // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
  3921. var ret;
  3922. if ( typeof context.getElementsByTagName !== "undefined" ) {
  3923. ret = context.getElementsByTagName( tag || "*" );
  3924. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  3925. ret = context.querySelectorAll( tag || "*" );
  3926. } else {
  3927. ret = [];
  3928. }
  3929. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  3930. return jQuery.merge( [ context ], ret );
  3931. }
  3932. return ret;
  3933. }
  3934. // Mark scripts as having already been evaluated
  3935. function setGlobalEval( elems, refElements ) {
  3936. var i = 0,
  3937. l = elems.length;
  3938. for ( ; i < l; i++ ) {
  3939. dataPriv.set(
  3940. elems[ i ],
  3941. "globalEval",
  3942. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  3943. );
  3944. }
  3945. }
  3946. var rhtml = /<|&#?\w+;/;
  3947. function buildFragment( elems, context, scripts, selection, ignored ) {
  3948. var elem, tmp, tag, wrap, attached, j,
  3949. fragment = context.createDocumentFragment(),
  3950. nodes = [],
  3951. i = 0,
  3952. l = elems.length;
  3953. for ( ; i < l; i++ ) {
  3954. elem = elems[ i ];
  3955. if ( elem || elem === 0 ) {
  3956. // Add nodes directly
  3957. if ( toType( elem ) === "object" ) {
  3958. // Support: Android <=4.0 only, PhantomJS 1 only
  3959. // push.apply(_, arraylike) throws on ancient WebKit
  3960. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  3961. // Convert non-html into a text node
  3962. } else if ( !rhtml.test( elem ) ) {
  3963. nodes.push( context.createTextNode( elem ) );
  3964. // Convert html into DOM nodes
  3965. } else {
  3966. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  3967. // Deserialize a standard representation
  3968. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  3969. wrap = wrapMap[ tag ] || wrapMap._default;
  3970. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  3971. // Descend through wrappers to the right content
  3972. j = wrap[ 0 ];
  3973. while ( j-- ) {
  3974. tmp = tmp.lastChild;
  3975. }
  3976. // Support: Android <=4.0 only, PhantomJS 1 only
  3977. // push.apply(_, arraylike) throws on ancient WebKit
  3978. jQuery.merge( nodes, tmp.childNodes );
  3979. // Remember the top-level container
  3980. tmp = fragment.firstChild;
  3981. // Ensure the created nodes are orphaned (trac-12392)
  3982. tmp.textContent = "";
  3983. }
  3984. }
  3985. }
  3986. // Remove wrapper from fragment
  3987. fragment.textContent = "";
  3988. i = 0;
  3989. while ( ( elem = nodes[ i++ ] ) ) {
  3990. // Skip elements already in the context collection (trac-4087)
  3991. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  3992. if ( ignored ) {
  3993. ignored.push( elem );
  3994. }
  3995. continue;
  3996. }
  3997. attached = isAttached( elem );
  3998. // Append to fragment
  3999. tmp = getAll( fragment.appendChild( elem ), "script" );
  4000. // Preserve script evaluation history
  4001. if ( attached ) {
  4002. setGlobalEval( tmp );
  4003. }
  4004. // Capture executables
  4005. if ( scripts ) {
  4006. j = 0;
  4007. while ( ( elem = tmp[ j++ ] ) ) {
  4008. if ( rscriptType.test( elem.type || "" ) ) {
  4009. scripts.push( elem );
  4010. }
  4011. }
  4012. }
  4013. }
  4014. return fragment;
  4015. }
  4016. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4017. function returnTrue() {
  4018. return true;
  4019. }
  4020. function returnFalse() {
  4021. return false;
  4022. }
  4023. function on( elem, types, selector, data, fn, one ) {
  4024. var origFn, type;
  4025. // Types can be a map of types/handlers
  4026. if ( typeof types === "object" ) {
  4027. // ( types-Object, selector, data )
  4028. if ( typeof selector !== "string" ) {
  4029. // ( types-Object, data )
  4030. data = data || selector;
  4031. selector = undefined;
  4032. }
  4033. for ( type in types ) {
  4034. on( elem, type, selector, data, types[ type ], one );
  4035. }
  4036. return elem;
  4037. }
  4038. if ( data == null && fn == null ) {
  4039. // ( types, fn )
  4040. fn = selector;
  4041. data = selector = undefined;
  4042. } else if ( fn == null ) {
  4043. if ( typeof selector === "string" ) {
  4044. // ( types, selector, fn )
  4045. fn = data;
  4046. data = undefined;
  4047. } else {
  4048. // ( types, data, fn )
  4049. fn = data;
  4050. data = selector;
  4051. selector = undefined;
  4052. }
  4053. }
  4054. if ( fn === false ) {
  4055. fn = returnFalse;
  4056. } else if ( !fn ) {
  4057. return elem;
  4058. }
  4059. if ( one === 1 ) {
  4060. origFn = fn;
  4061. fn = function( event ) {
  4062. // Can use an empty set, since event contains the info
  4063. jQuery().off( event );
  4064. return origFn.apply( this, arguments );
  4065. };
  4066. // Use same guid so caller can remove using origFn
  4067. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4068. }
  4069. return elem.each( function() {
  4070. jQuery.event.add( this, types, fn, data, selector );
  4071. } );
  4072. }
  4073. /*
  4074. * Helper functions for managing events -- not part of the public interface.
  4075. * Props to Dean Edwards' addEvent library for many of the ideas.
  4076. */
  4077. jQuery.event = {
  4078. global: {},
  4079. add: function( elem, types, handler, data, selector ) {
  4080. var handleObjIn, eventHandle, tmp,
  4081. events, t, handleObj,
  4082. special, handlers, type, namespaces, origType,
  4083. elemData = dataPriv.get( elem );
  4084. // Only attach events to objects that accept data
  4085. if ( !acceptData( elem ) ) {
  4086. return;
  4087. }
  4088. // Caller can pass in an object of custom data in lieu of the handler
  4089. if ( handler.handler ) {
  4090. handleObjIn = handler;
  4091. handler = handleObjIn.handler;
  4092. selector = handleObjIn.selector;
  4093. }
  4094. // Ensure that invalid selectors throw exceptions at attach time
  4095. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  4096. if ( selector ) {
  4097. jQuery.find.matchesSelector( documentElement, selector );
  4098. }
  4099. // Make sure that the handler has a unique ID, used to find/remove it later
  4100. if ( !handler.guid ) {
  4101. handler.guid = jQuery.guid++;
  4102. }
  4103. // Init the element's event structure and main handler, if this is the first
  4104. if ( !( events = elemData.events ) ) {
  4105. events = elemData.events = Object.create( null );
  4106. }
  4107. if ( !( eventHandle = elemData.handle ) ) {
  4108. eventHandle = elemData.handle = function( e ) {
  4109. // Discard the second event of a jQuery.event.trigger() and
  4110. // when an event is called after a page has unloaded
  4111. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  4112. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  4113. };
  4114. }
  4115. // Handle multiple events separated by a space
  4116. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4117. t = types.length;
  4118. while ( t-- ) {
  4119. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4120. type = origType = tmp[ 1 ];
  4121. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4122. // There *must* be a type, no attaching namespace-only handlers
  4123. if ( !type ) {
  4124. continue;
  4125. }
  4126. // If event changes its type, use the special event handlers for the changed type
  4127. special = jQuery.event.special[ type ] || {};
  4128. // If selector defined, determine special event api type, otherwise given type
  4129. type = ( selector ? special.delegateType : special.bindType ) || type;
  4130. // Update special based on newly reset type
  4131. special = jQuery.event.special[ type ] || {};
  4132. // handleObj is passed to all event handlers
  4133. handleObj = jQuery.extend( {
  4134. type: type,
  4135. origType: origType,
  4136. data: data,
  4137. handler: handler,
  4138. guid: handler.guid,
  4139. selector: selector,
  4140. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4141. namespace: namespaces.join( "." )
  4142. }, handleObjIn );
  4143. // Init the event handler queue if we're the first
  4144. if ( !( handlers = events[ type ] ) ) {
  4145. handlers = events[ type ] = [];
  4146. handlers.delegateCount = 0;
  4147. // Only use addEventListener if the special events handler returns false
  4148. if ( !special.setup ||
  4149. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4150. if ( elem.addEventListener ) {
  4151. elem.addEventListener( type, eventHandle );
  4152. }
  4153. }
  4154. }
  4155. if ( special.add ) {
  4156. special.add.call( elem, handleObj );
  4157. if ( !handleObj.handler.guid ) {
  4158. handleObj.handler.guid = handler.guid;
  4159. }
  4160. }
  4161. // Add to the element's handler list, delegates in front
  4162. if ( selector ) {
  4163. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4164. } else {
  4165. handlers.push( handleObj );
  4166. }
  4167. // Keep track of which events have ever been used, for event optimization
  4168. jQuery.event.global[ type ] = true;
  4169. }
  4170. },
  4171. // Detach an event or set of events from an element
  4172. remove: function( elem, types, handler, selector, mappedTypes ) {
  4173. var j, origCount, tmp,
  4174. events, t, handleObj,
  4175. special, handlers, type, namespaces, origType,
  4176. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4177. if ( !elemData || !( events = elemData.events ) ) {
  4178. return;
  4179. }
  4180. // Once for each type.namespace in types; type may be omitted
  4181. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4182. t = types.length;
  4183. while ( t-- ) {
  4184. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4185. type = origType = tmp[ 1 ];
  4186. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4187. // Unbind all events (on this namespace, if provided) for the element
  4188. if ( !type ) {
  4189. for ( type in events ) {
  4190. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4191. }
  4192. continue;
  4193. }
  4194. special = jQuery.event.special[ type ] || {};
  4195. type = ( selector ? special.delegateType : special.bindType ) || type;
  4196. handlers = events[ type ] || [];
  4197. tmp = tmp[ 2 ] &&
  4198. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4199. // Remove matching events
  4200. origCount = j = handlers.length;
  4201. while ( j-- ) {
  4202. handleObj = handlers[ j ];
  4203. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4204. ( !handler || handler.guid === handleObj.guid ) &&
  4205. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4206. ( !selector || selector === handleObj.selector ||
  4207. selector === "**" && handleObj.selector ) ) {
  4208. handlers.splice( j, 1 );
  4209. if ( handleObj.selector ) {
  4210. handlers.delegateCount--;
  4211. }
  4212. if ( special.remove ) {
  4213. special.remove.call( elem, handleObj );
  4214. }
  4215. }
  4216. }
  4217. // Remove generic event handler if we removed something and no more handlers exist
  4218. // (avoids potential for endless recursion during removal of special event handlers)
  4219. if ( origCount && !handlers.length ) {
  4220. if ( !special.teardown ||
  4221. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4222. jQuery.removeEvent( elem, type, elemData.handle );
  4223. }
  4224. delete events[ type ];
  4225. }
  4226. }
  4227. // Remove data and the expando if it's no longer used
  4228. if ( jQuery.isEmptyObject( events ) ) {
  4229. dataPriv.remove( elem, "handle events" );
  4230. }
  4231. },
  4232. dispatch: function( nativeEvent ) {
  4233. var i, j, ret, matched, handleObj, handlerQueue,
  4234. args = new Array( arguments.length ),
  4235. // Make a writable jQuery.Event from the native event object
  4236. event = jQuery.event.fix( nativeEvent ),
  4237. handlers = (
  4238. dataPriv.get( this, "events" ) || Object.create( null )
  4239. )[ event.type ] || [],
  4240. special = jQuery.event.special[ event.type ] || {};
  4241. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4242. args[ 0 ] = event;
  4243. for ( i = 1; i < arguments.length; i++ ) {
  4244. args[ i ] = arguments[ i ];
  4245. }
  4246. event.delegateTarget = this;
  4247. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4248. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4249. return;
  4250. }
  4251. // Determine handlers
  4252. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4253. // Run delegates first; they may want to stop propagation beneath us
  4254. i = 0;
  4255. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4256. event.currentTarget = matched.elem;
  4257. j = 0;
  4258. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4259. !event.isImmediatePropagationStopped() ) {
  4260. // If the event is namespaced, then each handler is only invoked if it is
  4261. // specially universal or its namespaces are a superset of the event's.
  4262. if ( !event.rnamespace || handleObj.namespace === false ||
  4263. event.rnamespace.test( handleObj.namespace ) ) {
  4264. event.handleObj = handleObj;
  4265. event.data = handleObj.data;
  4266. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4267. handleObj.handler ).apply( matched.elem, args );
  4268. if ( ret !== undefined ) {
  4269. if ( ( event.result = ret ) === false ) {
  4270. event.preventDefault();
  4271. event.stopPropagation();
  4272. }
  4273. }
  4274. }
  4275. }
  4276. }
  4277. // Call the postDispatch hook for the mapped type
  4278. if ( special.postDispatch ) {
  4279. special.postDispatch.call( this, event );
  4280. }
  4281. return event.result;
  4282. },
  4283. handlers: function( event, handlers ) {
  4284. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4285. handlerQueue = [],
  4286. delegateCount = handlers.delegateCount,
  4287. cur = event.target;
  4288. // Find delegate handlers
  4289. if ( delegateCount &&
  4290. // Support: IE <=9
  4291. // Black-hole SVG <use> instance trees (trac-13180)
  4292. cur.nodeType &&
  4293. // Support: Firefox <=42
  4294. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4295. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4296. // Support: IE 11 only
  4297. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4298. !( event.type === "click" && event.button >= 1 ) ) {
  4299. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4300. // Don't check non-elements (trac-13208)
  4301. // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
  4302. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4303. matchedHandlers = [];
  4304. matchedSelectors = {};
  4305. for ( i = 0; i < delegateCount; i++ ) {
  4306. handleObj = handlers[ i ];
  4307. // Don't conflict with Object.prototype properties (trac-13203)
  4308. sel = handleObj.selector + " ";
  4309. if ( matchedSelectors[ sel ] === undefined ) {
  4310. matchedSelectors[ sel ] = handleObj.needsContext ?
  4311. jQuery( sel, this ).index( cur ) > -1 :
  4312. jQuery.find( sel, this, null, [ cur ] ).length;
  4313. }
  4314. if ( matchedSelectors[ sel ] ) {
  4315. matchedHandlers.push( handleObj );
  4316. }
  4317. }
  4318. if ( matchedHandlers.length ) {
  4319. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4320. }
  4321. }
  4322. }
  4323. }
  4324. // Add the remaining (directly-bound) handlers
  4325. cur = this;
  4326. if ( delegateCount < handlers.length ) {
  4327. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4328. }
  4329. return handlerQueue;
  4330. },
  4331. addProp: function( name, hook ) {
  4332. Object.defineProperty( jQuery.Event.prototype, name, {
  4333. enumerable: true,
  4334. configurable: true,
  4335. get: isFunction( hook ) ?
  4336. function() {
  4337. if ( this.originalEvent ) {
  4338. return hook( this.originalEvent );
  4339. }
  4340. } :
  4341. function() {
  4342. if ( this.originalEvent ) {
  4343. return this.originalEvent[ name ];
  4344. }
  4345. },
  4346. set: function( value ) {
  4347. Object.defineProperty( this, name, {
  4348. enumerable: true,
  4349. configurable: true,
  4350. writable: true,
  4351. value: value
  4352. } );
  4353. }
  4354. } );
  4355. },
  4356. fix: function( originalEvent ) {
  4357. return originalEvent[ jQuery.expando ] ?
  4358. originalEvent :
  4359. new jQuery.Event( originalEvent );
  4360. },
  4361. special: {
  4362. load: {
  4363. // Prevent triggered image.load events from bubbling to window.load
  4364. noBubble: true
  4365. },
  4366. click: {
  4367. // Utilize native event to ensure correct state for checkable inputs
  4368. setup: function( data ) {
  4369. // For mutual compressibility with _default, replace `this` access with a local var.
  4370. // `|| data` is dead code meant only to preserve the variable through minification.
  4371. var el = this || data;
  4372. // Claim the first handler
  4373. if ( rcheckableType.test( el.type ) &&
  4374. el.click && nodeName( el, "input" ) ) {
  4375. // dataPriv.set( el, "click", ... )
  4376. leverageNative( el, "click", true );
  4377. }
  4378. // Return false to allow normal processing in the caller
  4379. return false;
  4380. },
  4381. trigger: function( data ) {
  4382. // For mutual compressibility with _default, replace `this` access with a local var.
  4383. // `|| data` is dead code meant only to preserve the variable through minification.
  4384. var el = this || data;
  4385. // Force setup before triggering a click
  4386. if ( rcheckableType.test( el.type ) &&
  4387. el.click && nodeName( el, "input" ) ) {
  4388. leverageNative( el, "click" );
  4389. }
  4390. // Return non-false to allow normal event-path propagation
  4391. return true;
  4392. },
  4393. // For cross-browser consistency, suppress native .click() on links
  4394. // Also prevent it if we're currently inside a leveraged native-event stack
  4395. _default: function( event ) {
  4396. var target = event.target;
  4397. return rcheckableType.test( target.type ) &&
  4398. target.click && nodeName( target, "input" ) &&
  4399. dataPriv.get( target, "click" ) ||
  4400. nodeName( target, "a" );
  4401. }
  4402. },
  4403. beforeunload: {
  4404. postDispatch: function( event ) {
  4405. // Support: Firefox 20+
  4406. // Firefox doesn't alert if the returnValue field is not set.
  4407. if ( event.result !== undefined && event.originalEvent ) {
  4408. event.originalEvent.returnValue = event.result;
  4409. }
  4410. }
  4411. }
  4412. }
  4413. };
  4414. // Ensure the presence of an event listener that handles manually-triggered
  4415. // synthetic events by interrupting progress until reinvoked in response to
  4416. // *native* events that it fires directly, ensuring that state changes have
  4417. // already occurred before other listeners are invoked.
  4418. function leverageNative( el, type, isSetup ) {
  4419. // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
  4420. if ( !isSetup ) {
  4421. if ( dataPriv.get( el, type ) === undefined ) {
  4422. jQuery.event.add( el, type, returnTrue );
  4423. }
  4424. return;
  4425. }
  4426. // Register the controller as a special universal handler for all event namespaces
  4427. dataPriv.set( el, type, false );
  4428. jQuery.event.add( el, type, {
  4429. namespace: false,
  4430. handler: function( event ) {
  4431. var result,
  4432. saved = dataPriv.get( this, type );
  4433. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  4434. // Interrupt processing of the outer synthetic .trigger()ed event
  4435. if ( !saved ) {
  4436. // Store arguments for use when handling the inner native event
  4437. // There will always be at least one argument (an event object), so this array
  4438. // will not be confused with a leftover capture object.
  4439. saved = slice.call( arguments );
  4440. dataPriv.set( this, type, saved );
  4441. // Trigger the native event and capture its result
  4442. this[ type ]();
  4443. result = dataPriv.get( this, type );
  4444. dataPriv.set( this, type, false );
  4445. if ( saved !== result ) {
  4446. // Cancel the outer synthetic event
  4447. event.stopImmediatePropagation();
  4448. event.preventDefault();
  4449. return result;
  4450. }
  4451. // If this is an inner synthetic event for an event with a bubbling surrogate
  4452. // (focus or blur), assume that the surrogate already propagated from triggering
  4453. // the native event and prevent that from happening again here.
  4454. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  4455. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  4456. // less bad than duplication.
  4457. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  4458. event.stopPropagation();
  4459. }
  4460. // If this is a native event triggered above, everything is now in order
  4461. // Fire an inner synthetic event with the original arguments
  4462. } else if ( saved ) {
  4463. // ...and capture the result
  4464. dataPriv.set( this, type, jQuery.event.trigger(
  4465. saved[ 0 ],
  4466. saved.slice( 1 ),
  4467. this
  4468. ) );
  4469. // Abort handling of the native event by all jQuery handlers while allowing
  4470. // native handlers on the same element to run. On target, this is achieved
  4471. // by stopping immediate propagation just on the jQuery event. However,
  4472. // the native event is re-wrapped by a jQuery one on each level of the
  4473. // propagation so the only way to stop it for jQuery is to stop it for
  4474. // everyone via native `stopPropagation()`. This is not a problem for
  4475. // focus/blur which don't bubble, but it does also stop click on checkboxes
  4476. // and radios. We accept this limitation.
  4477. event.stopPropagation();
  4478. event.isImmediatePropagationStopped = returnTrue;
  4479. }
  4480. }
  4481. } );
  4482. }
  4483. jQuery.removeEvent = function( elem, type, handle ) {
  4484. // This "if" is needed for plain objects
  4485. if ( elem.removeEventListener ) {
  4486. elem.removeEventListener( type, handle );
  4487. }
  4488. };
  4489. jQuery.Event = function( src, props ) {
  4490. // Allow instantiation without the 'new' keyword
  4491. if ( !( this instanceof jQuery.Event ) ) {
  4492. return new jQuery.Event( src, props );
  4493. }
  4494. // Event object
  4495. if ( src && src.type ) {
  4496. this.originalEvent = src;
  4497. this.type = src.type;
  4498. // Events bubbling up the document may have been marked as prevented
  4499. // by a handler lower down the tree; reflect the correct value.
  4500. this.isDefaultPrevented = src.defaultPrevented ||
  4501. src.defaultPrevented === undefined &&
  4502. // Support: Android <=2.3 only
  4503. src.returnValue === false ?
  4504. returnTrue :
  4505. returnFalse;
  4506. // Create target properties
  4507. // Support: Safari <=6 - 7 only
  4508. // Target should not be a text node (trac-504, trac-13143)
  4509. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4510. src.target.parentNode :
  4511. src.target;
  4512. this.currentTarget = src.currentTarget;
  4513. this.relatedTarget = src.relatedTarget;
  4514. // Event type
  4515. } else {
  4516. this.type = src;
  4517. }
  4518. // Put explicitly provided properties onto the event object
  4519. if ( props ) {
  4520. jQuery.extend( this, props );
  4521. }
  4522. // Create a timestamp if incoming event doesn't have one
  4523. this.timeStamp = src && src.timeStamp || Date.now();
  4524. // Mark it as fixed
  4525. this[ jQuery.expando ] = true;
  4526. };
  4527. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4528. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4529. jQuery.Event.prototype = {
  4530. constructor: jQuery.Event,
  4531. isDefaultPrevented: returnFalse,
  4532. isPropagationStopped: returnFalse,
  4533. isImmediatePropagationStopped: returnFalse,
  4534. isSimulated: false,
  4535. preventDefault: function() {
  4536. var e = this.originalEvent;
  4537. this.isDefaultPrevented = returnTrue;
  4538. if ( e && !this.isSimulated ) {
  4539. e.preventDefault();
  4540. }
  4541. },
  4542. stopPropagation: function() {
  4543. var e = this.originalEvent;
  4544. this.isPropagationStopped = returnTrue;
  4545. if ( e && !this.isSimulated ) {
  4546. e.stopPropagation();
  4547. }
  4548. },
  4549. stopImmediatePropagation: function() {
  4550. var e = this.originalEvent;
  4551. this.isImmediatePropagationStopped = returnTrue;
  4552. if ( e && !this.isSimulated ) {
  4553. e.stopImmediatePropagation();
  4554. }
  4555. this.stopPropagation();
  4556. }
  4557. };
  4558. // Includes all common event props including KeyEvent and MouseEvent specific props
  4559. jQuery.each( {
  4560. altKey: true,
  4561. bubbles: true,
  4562. cancelable: true,
  4563. changedTouches: true,
  4564. ctrlKey: true,
  4565. detail: true,
  4566. eventPhase: true,
  4567. metaKey: true,
  4568. pageX: true,
  4569. pageY: true,
  4570. shiftKey: true,
  4571. view: true,
  4572. "char": true,
  4573. code: true,
  4574. charCode: true,
  4575. key: true,
  4576. keyCode: true,
  4577. button: true,
  4578. buttons: true,
  4579. clientX: true,
  4580. clientY: true,
  4581. offsetX: true,
  4582. offsetY: true,
  4583. pointerId: true,
  4584. pointerType: true,
  4585. screenX: true,
  4586. screenY: true,
  4587. targetTouches: true,
  4588. toElement: true,
  4589. touches: true,
  4590. which: true
  4591. }, jQuery.event.addProp );
  4592. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  4593. function focusMappedHandler( nativeEvent ) {
  4594. if ( document.documentMode ) {
  4595. // Support: IE 11+
  4596. // Attach a single focusin/focusout handler on the document while someone wants
  4597. // focus/blur. This is because the former are synchronous in IE while the latter
  4598. // are async. In other browsers, all those handlers are invoked synchronously.
  4599. // `handle` from private data would already wrap the event, but we need
  4600. // to change the `type` here.
  4601. var handle = dataPriv.get( this, "handle" ),
  4602. event = jQuery.event.fix( nativeEvent );
  4603. event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  4604. event.isSimulated = true;
  4605. // First, handle focusin/focusout
  4606. handle( nativeEvent );
  4607. // ...then, handle focus/blur
  4608. //
  4609. // focus/blur don't bubble while focusin/focusout do; simulate the former by only
  4610. // invoking the handler at the lower level.
  4611. if ( event.target === event.currentTarget ) {
  4612. // The setup part calls `leverageNative`, which, in turn, calls
  4613. // `jQuery.event.add`, so event handle will already have been set
  4614. // by this point.
  4615. handle( event );
  4616. }
  4617. } else {
  4618. // For non-IE browsers, attach a single capturing handler on the document
  4619. // while someone wants focusin/focusout.
  4620. jQuery.event.simulate( delegateType, nativeEvent.target,
  4621. jQuery.event.fix( nativeEvent ) );
  4622. }
  4623. }
  4624. jQuery.event.special[ type ] = {
  4625. // Utilize native event if possible so blur/focus sequence is correct
  4626. setup: function() {
  4627. var attaches;
  4628. // Claim the first handler
  4629. // dataPriv.set( this, "focus", ... )
  4630. // dataPriv.set( this, "blur", ... )
  4631. leverageNative( this, type, true );
  4632. if ( document.documentMode ) {
  4633. // Support: IE 9 - 11+
  4634. // We use the same native handler for focusin & focus (and focusout & blur)
  4635. // so we need to coordinate setup & teardown parts between those events.
  4636. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  4637. attaches = dataPriv.get( this, delegateType );
  4638. if ( !attaches ) {
  4639. this.addEventListener( delegateType, focusMappedHandler );
  4640. }
  4641. dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
  4642. } else {
  4643. // Return false to allow normal processing in the caller
  4644. return false;
  4645. }
  4646. },
  4647. trigger: function() {
  4648. // Force setup before trigger
  4649. leverageNative( this, type );
  4650. // Return non-false to allow normal event-path propagation
  4651. return true;
  4652. },
  4653. teardown: function() {
  4654. var attaches;
  4655. if ( document.documentMode ) {
  4656. attaches = dataPriv.get( this, delegateType ) - 1;
  4657. if ( !attaches ) {
  4658. this.removeEventListener( delegateType, focusMappedHandler );
  4659. dataPriv.remove( this, delegateType );
  4660. } else {
  4661. dataPriv.set( this, delegateType, attaches );
  4662. }
  4663. } else {
  4664. // Return false to indicate standard teardown should be applied
  4665. return false;
  4666. }
  4667. },
  4668. // Suppress native focus or blur if we're currently inside
  4669. // a leveraged native-event stack
  4670. _default: function( event ) {
  4671. return dataPriv.get( event.target, type );
  4672. },
  4673. delegateType: delegateType
  4674. };
  4675. // Support: Firefox <=44
  4676. // Firefox doesn't have focus(in | out) events
  4677. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  4678. //
  4679. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  4680. // focus(in | out) events fire after focus & blur events,
  4681. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  4682. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  4683. //
  4684. // Support: IE 9 - 11+
  4685. // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
  4686. // attach a single handler for both events in IE.
  4687. jQuery.event.special[ delegateType ] = {
  4688. setup: function() {
  4689. // Handle: regular nodes (via `this.ownerDocument`), window
  4690. // (via `this.document`) & document (via `this`).
  4691. var doc = this.ownerDocument || this.document || this,
  4692. dataHolder = document.documentMode ? this : doc,
  4693. attaches = dataPriv.get( dataHolder, delegateType );
  4694. // Support: IE 9 - 11+
  4695. // We use the same native handler for focusin & focus (and focusout & blur)
  4696. // so we need to coordinate setup & teardown parts between those events.
  4697. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  4698. if ( !attaches ) {
  4699. if ( document.documentMode ) {
  4700. this.addEventListener( delegateType, focusMappedHandler );
  4701. } else {
  4702. doc.addEventListener( type, focusMappedHandler, true );
  4703. }
  4704. }
  4705. dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
  4706. },
  4707. teardown: function() {
  4708. var doc = this.ownerDocument || this.document || this,
  4709. dataHolder = document.documentMode ? this : doc,
  4710. attaches = dataPriv.get( dataHolder, delegateType ) - 1;
  4711. if ( !attaches ) {
  4712. if ( document.documentMode ) {
  4713. this.removeEventListener( delegateType, focusMappedHandler );
  4714. } else {
  4715. doc.removeEventListener( type, focusMappedHandler, true );
  4716. }
  4717. dataPriv.remove( dataHolder, delegateType );
  4718. } else {
  4719. dataPriv.set( dataHolder, delegateType, attaches );
  4720. }
  4721. }
  4722. };
  4723. } );
  4724. // Create mouseenter/leave events using mouseover/out and event-time checks
  4725. // so that event delegation works in jQuery.
  4726. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4727. //
  4728. // Support: Safari 7 only
  4729. // Safari sends mouseenter too often; see:
  4730. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4731. // for the description of the bug (it existed in older Chrome versions as well).
  4732. jQuery.each( {
  4733. mouseenter: "mouseover",
  4734. mouseleave: "mouseout",
  4735. pointerenter: "pointerover",
  4736. pointerleave: "pointerout"
  4737. }, function( orig, fix ) {
  4738. jQuery.event.special[ orig ] = {
  4739. delegateType: fix,
  4740. bindType: fix,
  4741. handle: function( event ) {
  4742. var ret,
  4743. target = this,
  4744. related = event.relatedTarget,
  4745. handleObj = event.handleObj;
  4746. // For mouseenter/leave call the handler if related is outside the target.
  4747. // NB: No relatedTarget if the mouse left/entered the browser window
  4748. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4749. event.type = handleObj.origType;
  4750. ret = handleObj.handler.apply( this, arguments );
  4751. event.type = fix;
  4752. }
  4753. return ret;
  4754. }
  4755. };
  4756. } );
  4757. jQuery.fn.extend( {
  4758. on: function( types, selector, data, fn ) {
  4759. return on( this, types, selector, data, fn );
  4760. },
  4761. one: function( types, selector, data, fn ) {
  4762. return on( this, types, selector, data, fn, 1 );
  4763. },
  4764. off: function( types, selector, fn ) {
  4765. var handleObj, type;
  4766. if ( types && types.preventDefault && types.handleObj ) {
  4767. // ( event ) dispatched jQuery.Event
  4768. handleObj = types.handleObj;
  4769. jQuery( types.delegateTarget ).off(
  4770. handleObj.namespace ?
  4771. handleObj.origType + "." + handleObj.namespace :
  4772. handleObj.origType,
  4773. handleObj.selector,
  4774. handleObj.handler
  4775. );
  4776. return this;
  4777. }
  4778. if ( typeof types === "object" ) {
  4779. // ( types-object [, selector] )
  4780. for ( type in types ) {
  4781. this.off( type, selector, types[ type ] );
  4782. }
  4783. return this;
  4784. }
  4785. if ( selector === false || typeof selector === "function" ) {
  4786. // ( types [, fn] )
  4787. fn = selector;
  4788. selector = undefined;
  4789. }
  4790. if ( fn === false ) {
  4791. fn = returnFalse;
  4792. }
  4793. return this.each( function() {
  4794. jQuery.event.remove( this, types, fn, selector );
  4795. } );
  4796. }
  4797. } );
  4798. var
  4799. // Support: IE <=10 - 11, Edge 12 - 13 only
  4800. // In IE/Edge using regex groups here causes severe slowdowns.
  4801. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4802. rnoInnerhtml = /<script|<style|<link/i,
  4803. // checked="checked" or checked
  4804. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4805. rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  4806. // Prefer a tbody over its parent table for containing new rows
  4807. function manipulationTarget( elem, content ) {
  4808. if ( nodeName( elem, "table" ) &&
  4809. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4810. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  4811. }
  4812. return elem;
  4813. }
  4814. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4815. function disableScript( elem ) {
  4816. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4817. return elem;
  4818. }
  4819. function restoreScript( elem ) {
  4820. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  4821. elem.type = elem.type.slice( 5 );
  4822. } else {
  4823. elem.removeAttribute( "type" );
  4824. }
  4825. return elem;
  4826. }
  4827. function cloneCopyEvent( src, dest ) {
  4828. var i, l, type, pdataOld, udataOld, udataCur, events;
  4829. if ( dest.nodeType !== 1 ) {
  4830. return;
  4831. }
  4832. // 1. Copy private data: events, handlers, etc.
  4833. if ( dataPriv.hasData( src ) ) {
  4834. pdataOld = dataPriv.get( src );
  4835. events = pdataOld.events;
  4836. if ( events ) {
  4837. dataPriv.remove( dest, "handle events" );
  4838. for ( type in events ) {
  4839. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4840. jQuery.event.add( dest, type, events[ type ][ i ] );
  4841. }
  4842. }
  4843. }
  4844. }
  4845. // 2. Copy user data
  4846. if ( dataUser.hasData( src ) ) {
  4847. udataOld = dataUser.access( src );
  4848. udataCur = jQuery.extend( {}, udataOld );
  4849. dataUser.set( dest, udataCur );
  4850. }
  4851. }
  4852. // Fix IE bugs, see support tests
  4853. function fixInput( src, dest ) {
  4854. var nodeName = dest.nodeName.toLowerCase();
  4855. // Fails to persist the checked state of a cloned checkbox or radio button.
  4856. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4857. dest.checked = src.checked;
  4858. // Fails to return the selected option to the default selected state when cloning options
  4859. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4860. dest.defaultValue = src.defaultValue;
  4861. }
  4862. }
  4863. function domManip( collection, args, callback, ignored ) {
  4864. // Flatten any nested arrays
  4865. args = flat( args );
  4866. var fragment, first, scripts, hasScripts, node, doc,
  4867. i = 0,
  4868. l = collection.length,
  4869. iNoClone = l - 1,
  4870. value = args[ 0 ],
  4871. valueIsFunction = isFunction( value );
  4872. // We can't cloneNode fragments that contain checked, in WebKit
  4873. if ( valueIsFunction ||
  4874. ( l > 1 && typeof value === "string" &&
  4875. !support.checkClone && rchecked.test( value ) ) ) {
  4876. return collection.each( function( index ) {
  4877. var self = collection.eq( index );
  4878. if ( valueIsFunction ) {
  4879. args[ 0 ] = value.call( this, index, self.html() );
  4880. }
  4881. domManip( self, args, callback, ignored );
  4882. } );
  4883. }
  4884. if ( l ) {
  4885. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4886. first = fragment.firstChild;
  4887. if ( fragment.childNodes.length === 1 ) {
  4888. fragment = first;
  4889. }
  4890. // Require either new content or an interest in ignored elements to invoke the callback
  4891. if ( first || ignored ) {
  4892. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4893. hasScripts = scripts.length;
  4894. // Use the original fragment for the last item
  4895. // instead of the first because it can end up
  4896. // being emptied incorrectly in certain situations (trac-8070).
  4897. for ( ; i < l; i++ ) {
  4898. node = fragment;
  4899. if ( i !== iNoClone ) {
  4900. node = jQuery.clone( node, true, true );
  4901. // Keep references to cloned scripts for later restoration
  4902. if ( hasScripts ) {
  4903. // Support: Android <=4.0 only, PhantomJS 1 only
  4904. // push.apply(_, arraylike) throws on ancient WebKit
  4905. jQuery.merge( scripts, getAll( node, "script" ) );
  4906. }
  4907. }
  4908. callback.call( collection[ i ], node, i );
  4909. }
  4910. if ( hasScripts ) {
  4911. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4912. // Re-enable scripts
  4913. jQuery.map( scripts, restoreScript );
  4914. // Evaluate executable scripts on first document insertion
  4915. for ( i = 0; i < hasScripts; i++ ) {
  4916. node = scripts[ i ];
  4917. if ( rscriptType.test( node.type || "" ) &&
  4918. !dataPriv.access( node, "globalEval" ) &&
  4919. jQuery.contains( doc, node ) ) {
  4920. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  4921. // Optional AJAX dependency, but won't run scripts if not present
  4922. if ( jQuery._evalUrl && !node.noModule ) {
  4923. jQuery._evalUrl( node.src, {
  4924. nonce: node.nonce || node.getAttribute( "nonce" )
  4925. }, doc );
  4926. }
  4927. } else {
  4928. // Unwrap a CDATA section containing script contents. This shouldn't be
  4929. // needed as in XML documents they're already not visible when
  4930. // inspecting element contents and in HTML documents they have no
  4931. // meaning but we're preserving that logic for backwards compatibility.
  4932. // This will be removed completely in 4.0. See gh-4904.
  4933. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  4934. }
  4935. }
  4936. }
  4937. }
  4938. }
  4939. }
  4940. return collection;
  4941. }
  4942. function remove( elem, selector, keepData ) {
  4943. var node,
  4944. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4945. i = 0;
  4946. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4947. if ( !keepData && node.nodeType === 1 ) {
  4948. jQuery.cleanData( getAll( node ) );
  4949. }
  4950. if ( node.parentNode ) {
  4951. if ( keepData && isAttached( node ) ) {
  4952. setGlobalEval( getAll( node, "script" ) );
  4953. }
  4954. node.parentNode.removeChild( node );
  4955. }
  4956. }
  4957. return elem;
  4958. }
  4959. jQuery.extend( {
  4960. htmlPrefilter: function( html ) {
  4961. return html;
  4962. },
  4963. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4964. var i, l, srcElements, destElements,
  4965. clone = elem.cloneNode( true ),
  4966. inPage = isAttached( elem );
  4967. // Fix IE cloning issues
  4968. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4969. !jQuery.isXMLDoc( elem ) ) {
  4970. // We eschew jQuery#find here for performance reasons:
  4971. // https://jsperf.com/getall-vs-sizzle/2
  4972. destElements = getAll( clone );
  4973. srcElements = getAll( elem );
  4974. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4975. fixInput( srcElements[ i ], destElements[ i ] );
  4976. }
  4977. }
  4978. // Copy the events from the original to the clone
  4979. if ( dataAndEvents ) {
  4980. if ( deepDataAndEvents ) {
  4981. srcElements = srcElements || getAll( elem );
  4982. destElements = destElements || getAll( clone );
  4983. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4984. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4985. }
  4986. } else {
  4987. cloneCopyEvent( elem, clone );
  4988. }
  4989. }
  4990. // Preserve script evaluation history
  4991. destElements = getAll( clone, "script" );
  4992. if ( destElements.length > 0 ) {
  4993. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4994. }
  4995. // Return the cloned set
  4996. return clone;
  4997. },
  4998. cleanData: function( elems ) {
  4999. var data, elem, type,
  5000. special = jQuery.event.special,
  5001. i = 0;
  5002. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  5003. if ( acceptData( elem ) ) {
  5004. if ( ( data = elem[ dataPriv.expando ] ) ) {
  5005. if ( data.events ) {
  5006. for ( type in data.events ) {
  5007. if ( special[ type ] ) {
  5008. jQuery.event.remove( elem, type );
  5009. // This is a shortcut to avoid jQuery.event.remove's overhead
  5010. } else {
  5011. jQuery.removeEvent( elem, type, data.handle );
  5012. }
  5013. }
  5014. }
  5015. // Support: Chrome <=35 - 45+
  5016. // Assign undefined instead of using delete, see Data#remove
  5017. elem[ dataPriv.expando ] = undefined;
  5018. }
  5019. if ( elem[ dataUser.expando ] ) {
  5020. // Support: Chrome <=35 - 45+
  5021. // Assign undefined instead of using delete, see Data#remove
  5022. elem[ dataUser.expando ] = undefined;
  5023. }
  5024. }
  5025. }
  5026. }
  5027. } );
  5028. jQuery.fn.extend( {
  5029. detach: function( selector ) {
  5030. return remove( this, selector, true );
  5031. },
  5032. remove: function( selector ) {
  5033. return remove( this, selector );
  5034. },
  5035. text: function( value ) {
  5036. return access( this, function( value ) {
  5037. return value === undefined ?
  5038. jQuery.text( this ) :
  5039. this.empty().each( function() {
  5040. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5041. this.textContent = value;
  5042. }
  5043. } );
  5044. }, null, value, arguments.length );
  5045. },
  5046. append: function() {
  5047. return domManip( this, arguments, function( elem ) {
  5048. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5049. var target = manipulationTarget( this, elem );
  5050. target.appendChild( elem );
  5051. }
  5052. } );
  5053. },
  5054. prepend: function() {
  5055. return domManip( this, arguments, function( elem ) {
  5056. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  5057. var target = manipulationTarget( this, elem );
  5058. target.insertBefore( elem, target.firstChild );
  5059. }
  5060. } );
  5061. },
  5062. before: function() {
  5063. return domManip( this, arguments, function( elem ) {
  5064. if ( this.parentNode ) {
  5065. this.parentNode.insertBefore( elem, this );
  5066. }
  5067. } );
  5068. },
  5069. after: function() {
  5070. return domManip( this, arguments, function( elem ) {
  5071. if ( this.parentNode ) {
  5072. this.parentNode.insertBefore( elem, this.nextSibling );
  5073. }
  5074. } );
  5075. },
  5076. empty: function() {
  5077. var elem,
  5078. i = 0;
  5079. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  5080. if ( elem.nodeType === 1 ) {
  5081. // Prevent memory leaks
  5082. jQuery.cleanData( getAll( elem, false ) );
  5083. // Remove any remaining nodes
  5084. elem.textContent = "";
  5085. }
  5086. }
  5087. return this;
  5088. },
  5089. clone: function( dataAndEvents, deepDataAndEvents ) {
  5090. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  5091. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  5092. return this.map( function() {
  5093. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  5094. } );
  5095. },
  5096. html: function( value ) {
  5097. return access( this, function( value ) {
  5098. var elem = this[ 0 ] || {},
  5099. i = 0,
  5100. l = this.length;
  5101. if ( value === undefined && elem.nodeType === 1 ) {
  5102. return elem.innerHTML;
  5103. }
  5104. // See if we can take a shortcut and just use innerHTML
  5105. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  5106. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  5107. value = jQuery.htmlPrefilter( value );
  5108. try {
  5109. for ( ; i < l; i++ ) {
  5110. elem = this[ i ] || {};
  5111. // Remove element nodes and prevent memory leaks
  5112. if ( elem.nodeType === 1 ) {
  5113. jQuery.cleanData( getAll( elem, false ) );
  5114. elem.innerHTML = value;
  5115. }
  5116. }
  5117. elem = 0;
  5118. // If using innerHTML throws an exception, use the fallback method
  5119. } catch ( e ) {}
  5120. }
  5121. if ( elem ) {
  5122. this.empty().append( value );
  5123. }
  5124. }, null, value, arguments.length );
  5125. },
  5126. replaceWith: function() {
  5127. var ignored = [];
  5128. // Make the changes, replacing each non-ignored context element with the new content
  5129. return domManip( this, arguments, function( elem ) {
  5130. var parent = this.parentNode;
  5131. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5132. jQuery.cleanData( getAll( this ) );
  5133. if ( parent ) {
  5134. parent.replaceChild( elem, this );
  5135. }
  5136. }
  5137. // Force callback invocation
  5138. }, ignored );
  5139. }
  5140. } );
  5141. jQuery.each( {
  5142. appendTo: "append",
  5143. prependTo: "prepend",
  5144. insertBefore: "before",
  5145. insertAfter: "after",
  5146. replaceAll: "replaceWith"
  5147. }, function( name, original ) {
  5148. jQuery.fn[ name ] = function( selector ) {
  5149. var elems,
  5150. ret = [],
  5151. insert = jQuery( selector ),
  5152. last = insert.length - 1,
  5153. i = 0;
  5154. for ( ; i <= last; i++ ) {
  5155. elems = i === last ? this : this.clone( true );
  5156. jQuery( insert[ i ] )[ original ]( elems );
  5157. // Support: Android <=4.0 only, PhantomJS 1 only
  5158. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5159. push.apply( ret, elems.get() );
  5160. }
  5161. return this.pushStack( ret );
  5162. };
  5163. } );
  5164. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5165. var rcustomProp = /^--/;
  5166. var getStyles = function( elem ) {
  5167. // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
  5168. // IE throws on elements created in popups
  5169. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5170. var view = elem.ownerDocument.defaultView;
  5171. if ( !view || !view.opener ) {
  5172. view = window;
  5173. }
  5174. return view.getComputedStyle( elem );
  5175. };
  5176. var swap = function( elem, options, callback ) {
  5177. var ret, name,
  5178. old = {};
  5179. // Remember the old values, and insert the new ones
  5180. for ( name in options ) {
  5181. old[ name ] = elem.style[ name ];
  5182. elem.style[ name ] = options[ name ];
  5183. }
  5184. ret = callback.call( elem );
  5185. // Revert the old values
  5186. for ( name in options ) {
  5187. elem.style[ name ] = old[ name ];
  5188. }
  5189. return ret;
  5190. };
  5191. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  5192. ( function() {
  5193. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5194. // so they're executed at the same time to save the second computation.
  5195. function computeStyleTests() {
  5196. // This is a singleton, we need to execute it only once
  5197. if ( !div ) {
  5198. return;
  5199. }
  5200. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  5201. "margin-top:1px;padding:0;border:0";
  5202. div.style.cssText =
  5203. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  5204. "margin:auto;border:1px;padding:1px;" +
  5205. "width:60%;top:1%";
  5206. documentElement.appendChild( container ).appendChild( div );
  5207. var divStyle = window.getComputedStyle( div );
  5208. pixelPositionVal = divStyle.top !== "1%";
  5209. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5210. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  5211. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  5212. // Some styles come back with percentage values, even though they shouldn't
  5213. div.style.right = "60%";
  5214. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  5215. // Support: IE 9 - 11 only
  5216. // Detect misreporting of content dimensions for box-sizing:border-box elements
  5217. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  5218. // Support: IE 9 only
  5219. // Detect overflow:scroll screwiness (gh-3699)
  5220. // Support: Chrome <=64
  5221. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  5222. div.style.position = "absolute";
  5223. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  5224. documentElement.removeChild( container );
  5225. // Nullify the div so it wouldn't be stored in the memory and
  5226. // it will also be a sign that checks already performed
  5227. div = null;
  5228. }
  5229. function roundPixelMeasures( measure ) {
  5230. return Math.round( parseFloat( measure ) );
  5231. }
  5232. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  5233. reliableTrDimensionsVal, reliableMarginLeftVal,
  5234. container = document.createElement( "div" ),
  5235. div = document.createElement( "div" );
  5236. // Finish early in limited (non-browser) environments
  5237. if ( !div.style ) {
  5238. return;
  5239. }
  5240. // Support: IE <=9 - 11 only
  5241. // Style of cloned element affects source element cloned (trac-8908)
  5242. div.style.backgroundClip = "content-box";
  5243. div.cloneNode( true ).style.backgroundClip = "";
  5244. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5245. jQuery.extend( support, {
  5246. boxSizingReliable: function() {
  5247. computeStyleTests();
  5248. return boxSizingReliableVal;
  5249. },
  5250. pixelBoxStyles: function() {
  5251. computeStyleTests();
  5252. return pixelBoxStylesVal;
  5253. },
  5254. pixelPosition: function() {
  5255. computeStyleTests();
  5256. return pixelPositionVal;
  5257. },
  5258. reliableMarginLeft: function() {
  5259. computeStyleTests();
  5260. return reliableMarginLeftVal;
  5261. },
  5262. scrollboxSize: function() {
  5263. computeStyleTests();
  5264. return scrollboxSizeVal;
  5265. },
  5266. // Support: IE 9 - 11+, Edge 15 - 18+
  5267. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5268. // set in CSS while `offset*` properties report correct values.
  5269. // Behavior in IE 9 is more subtle than in newer versions & it passes
  5270. // some versions of this test; make sure not to make it pass there!
  5271. //
  5272. // Support: Firefox 70+
  5273. // Only Firefox includes border widths
  5274. // in computed dimensions. (gh-4529)
  5275. reliableTrDimensions: function() {
  5276. var table, tr, trChild, trStyle;
  5277. if ( reliableTrDimensionsVal == null ) {
  5278. table = document.createElement( "table" );
  5279. tr = document.createElement( "tr" );
  5280. trChild = document.createElement( "div" );
  5281. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  5282. tr.style.cssText = "box-sizing:content-box;border:1px solid";
  5283. // Support: Chrome 86+
  5284. // Height set through cssText does not get applied.
  5285. // Computed height then comes back as 0.
  5286. tr.style.height = "1px";
  5287. trChild.style.height = "9px";
  5288. // Support: Android 8 Chrome 86+
  5289. // In our bodyBackground.html iframe,
  5290. // display for all div elements is set to "inline",
  5291. // which causes a problem only in Android 8 Chrome 86.
  5292. // Ensuring the div is `display: block`
  5293. // gets around this issue.
  5294. trChild.style.display = "block";
  5295. documentElement
  5296. .appendChild( table )
  5297. .appendChild( tr )
  5298. .appendChild( trChild );
  5299. trStyle = window.getComputedStyle( tr );
  5300. reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
  5301. parseInt( trStyle.borderTopWidth, 10 ) +
  5302. parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
  5303. documentElement.removeChild( table );
  5304. }
  5305. return reliableTrDimensionsVal;
  5306. }
  5307. } );
  5308. } )();
  5309. function curCSS( elem, name, computed ) {
  5310. var width, minWidth, maxWidth, ret,
  5311. isCustomProp = rcustomProp.test( name ),
  5312. // Support: Firefox 51+
  5313. // Retrieving style before computed somehow
  5314. // fixes an issue with getting wrong values
  5315. // on detached elements
  5316. style = elem.style;
  5317. computed = computed || getStyles( elem );
  5318. // getPropertyValue is needed for:
  5319. // .css('filter') (IE 9 only, trac-12537)
  5320. // .css('--customProperty) (gh-3144)
  5321. if ( computed ) {
  5322. // Support: IE <=9 - 11+
  5323. // IE only supports `"float"` in `getPropertyValue`; in computed styles
  5324. // it's only available as `"cssFloat"`. We no longer modify properties
  5325. // sent to `.css()` apart from camelCasing, so we need to check both.
  5326. // Normally, this would create difference in behavior: if
  5327. // `getPropertyValue` returns an empty string, the value returned
  5328. // by `.css()` would be `undefined`. This is usually the case for
  5329. // disconnected elements. However, in IE even disconnected elements
  5330. // with no styles return `"none"` for `getPropertyValue( "float" )`
  5331. ret = computed.getPropertyValue( name ) || computed[ name ];
  5332. if ( isCustomProp && ret ) {
  5333. // Support: Firefox 105+, Chrome <=105+
  5334. // Spec requires trimming whitespace for custom properties (gh-4926).
  5335. // Firefox only trims leading whitespace. Chrome just collapses
  5336. // both leading & trailing whitespace to a single space.
  5337. //
  5338. // Fall back to `undefined` if empty string returned.
  5339. // This collapses a missing definition with property defined
  5340. // and set to an empty string but there's no standard API
  5341. // allowing us to differentiate them without a performance penalty
  5342. // and returning `undefined` aligns with older jQuery.
  5343. //
  5344. // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
  5345. // as whitespace while CSS does not, but this is not a problem
  5346. // because CSS preprocessing replaces them with U+000A LINE FEED
  5347. // (which *is* CSS whitespace)
  5348. // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
  5349. ret = ret.replace( rtrimCSS, "$1" ) || undefined;
  5350. }
  5351. if ( ret === "" && !isAttached( elem ) ) {
  5352. ret = jQuery.style( elem, name );
  5353. }
  5354. // A tribute to the "awesome hack by Dean Edwards"
  5355. // Android Browser returns percentage for some values,
  5356. // but width seems to be reliably pixels.
  5357. // This is against the CSSOM draft spec:
  5358. // https://drafts.csswg.org/cssom/#resolved-values
  5359. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  5360. // Remember the original values
  5361. width = style.width;
  5362. minWidth = style.minWidth;
  5363. maxWidth = style.maxWidth;
  5364. // Put in the new values to get a computed value out
  5365. style.minWidth = style.maxWidth = style.width = ret;
  5366. ret = computed.width;
  5367. // Revert the changed values
  5368. style.width = width;
  5369. style.minWidth = minWidth;
  5370. style.maxWidth = maxWidth;
  5371. }
  5372. }
  5373. return ret !== undefined ?
  5374. // Support: IE <=9 - 11 only
  5375. // IE returns zIndex value as an integer.
  5376. ret + "" :
  5377. ret;
  5378. }
  5379. function addGetHookIf( conditionFn, hookFn ) {
  5380. // Define the hook, we'll check on the first run if it's really needed.
  5381. return {
  5382. get: function() {
  5383. if ( conditionFn() ) {
  5384. // Hook not needed (or it's not possible to use it due
  5385. // to missing dependency), remove it.
  5386. delete this.get;
  5387. return;
  5388. }
  5389. // Hook needed; redefine it so that the support test is not executed again.
  5390. return ( this.get = hookFn ).apply( this, arguments );
  5391. }
  5392. };
  5393. }
  5394. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5395. emptyStyle = document.createElement( "div" ).style,
  5396. vendorProps = {};
  5397. // Return a vendor-prefixed property or undefined
  5398. function vendorPropName( name ) {
  5399. // Check for vendor prefixed names
  5400. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5401. i = cssPrefixes.length;
  5402. while ( i-- ) {
  5403. name = cssPrefixes[ i ] + capName;
  5404. if ( name in emptyStyle ) {
  5405. return name;
  5406. }
  5407. }
  5408. }
  5409. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  5410. function finalPropName( name ) {
  5411. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  5412. if ( final ) {
  5413. return final;
  5414. }
  5415. if ( name in emptyStyle ) {
  5416. return name;
  5417. }
  5418. return vendorProps[ name ] = vendorPropName( name ) || name;
  5419. }
  5420. var
  5421. // Swappable if display is none or starts with table
  5422. // except "table", "table-cell", or "table-caption"
  5423. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5424. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5425. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5426. cssNormalTransform = {
  5427. letterSpacing: "0",
  5428. fontWeight: "400"
  5429. };
  5430. function setPositiveNumber( _elem, value, subtract ) {
  5431. // Any relative (+/-) values have already been
  5432. // normalized at this point
  5433. var matches = rcssNum.exec( value );
  5434. return matches ?
  5435. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5436. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5437. value;
  5438. }
  5439. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  5440. var i = dimension === "width" ? 1 : 0,
  5441. extra = 0,
  5442. delta = 0,
  5443. marginDelta = 0;
  5444. // Adjustment may not be necessary
  5445. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  5446. return 0;
  5447. }
  5448. for ( ; i < 4; i += 2 ) {
  5449. // Both box models exclude margin
  5450. // Count margin delta separately to only add it after scroll gutter adjustment.
  5451. // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
  5452. if ( box === "margin" ) {
  5453. marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  5454. }
  5455. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  5456. if ( !isBorderBox ) {
  5457. // Add padding
  5458. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5459. // For "border" or "margin", add border
  5460. if ( box !== "padding" ) {
  5461. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5462. // But still keep track of it otherwise
  5463. } else {
  5464. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5465. }
  5466. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  5467. // "padding" or "margin"
  5468. } else {
  5469. // For "content", subtract padding
  5470. if ( box === "content" ) {
  5471. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5472. }
  5473. // For "content" or "padding", subtract border
  5474. if ( box !== "margin" ) {
  5475. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5476. }
  5477. }
  5478. }
  5479. // Account for positive content-box scroll gutter when requested by providing computedVal
  5480. if ( !isBorderBox && computedVal >= 0 ) {
  5481. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  5482. // Assuming integer scroll gutter, subtract the rest and round down
  5483. delta += Math.max( 0, Math.ceil(
  5484. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5485. computedVal -
  5486. delta -
  5487. extra -
  5488. 0.5
  5489. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  5490. // Use an explicit zero to avoid NaN (gh-3964)
  5491. ) ) || 0;
  5492. }
  5493. return delta + marginDelta;
  5494. }
  5495. function getWidthOrHeight( elem, dimension, extra ) {
  5496. // Start with computed style
  5497. var styles = getStyles( elem ),
  5498. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  5499. // Fake content-box until we know it's needed to know the true value.
  5500. boxSizingNeeded = !support.boxSizingReliable() || extra,
  5501. isBorderBox = boxSizingNeeded &&
  5502. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5503. valueIsBorderBox = isBorderBox,
  5504. val = curCSS( elem, dimension, styles ),
  5505. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  5506. // Support: Firefox <=54
  5507. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  5508. if ( rnumnonpx.test( val ) ) {
  5509. if ( !extra ) {
  5510. return val;
  5511. }
  5512. val = "auto";
  5513. }
  5514. // Support: IE 9 - 11 only
  5515. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  5516. // In those cases, the computed value can be trusted to be border-box.
  5517. if ( ( !support.boxSizingReliable() && isBorderBox ||
  5518. // Support: IE 10 - 11+, Edge 15 - 18+
  5519. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5520. // set in CSS while `offset*` properties report correct values.
  5521. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  5522. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  5523. // Fall back to offsetWidth/offsetHeight when value is "auto"
  5524. // This happens for inline elements with no explicit setting (gh-3571)
  5525. val === "auto" ||
  5526. // Support: Android <=4.1 - 4.3 only
  5527. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  5528. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  5529. // Make sure the element is visible & connected
  5530. elem.getClientRects().length ) {
  5531. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5532. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  5533. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  5534. // retrieved value as a content box dimension.
  5535. valueIsBorderBox = offsetProp in elem;
  5536. if ( valueIsBorderBox ) {
  5537. val = elem[ offsetProp ];
  5538. }
  5539. }
  5540. // Normalize "" and auto
  5541. val = parseFloat( val ) || 0;
  5542. // Adjust for the element's box model
  5543. return ( val +
  5544. boxModelAdjustment(
  5545. elem,
  5546. dimension,
  5547. extra || ( isBorderBox ? "border" : "content" ),
  5548. valueIsBorderBox,
  5549. styles,
  5550. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  5551. val
  5552. )
  5553. ) + "px";
  5554. }
  5555. jQuery.extend( {
  5556. // Add in style property hooks for overriding the default
  5557. // behavior of getting and setting a style property
  5558. cssHooks: {
  5559. opacity: {
  5560. get: function( elem, computed ) {
  5561. if ( computed ) {
  5562. // We should always get a number back from opacity
  5563. var ret = curCSS( elem, "opacity" );
  5564. return ret === "" ? "1" : ret;
  5565. }
  5566. }
  5567. }
  5568. },
  5569. // Don't automatically add "px" to these possibly-unitless properties
  5570. cssNumber: {
  5571. animationIterationCount: true,
  5572. aspectRatio: true,
  5573. borderImageSlice: true,
  5574. columnCount: true,
  5575. flexGrow: true,
  5576. flexShrink: true,
  5577. fontWeight: true,
  5578. gridArea: true,
  5579. gridColumn: true,
  5580. gridColumnEnd: true,
  5581. gridColumnStart: true,
  5582. gridRow: true,
  5583. gridRowEnd: true,
  5584. gridRowStart: true,
  5585. lineHeight: true,
  5586. opacity: true,
  5587. order: true,
  5588. orphans: true,
  5589. scale: true,
  5590. widows: true,
  5591. zIndex: true,
  5592. zoom: true,
  5593. // SVG-related
  5594. fillOpacity: true,
  5595. floodOpacity: true,
  5596. stopOpacity: true,
  5597. strokeMiterlimit: true,
  5598. strokeOpacity: true
  5599. },
  5600. // Add in properties whose names you wish to fix before
  5601. // setting or getting the value
  5602. cssProps: {},
  5603. // Get and set the style property on a DOM Node
  5604. style: function( elem, name, value, extra ) {
  5605. // Don't set styles on text and comment nodes
  5606. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5607. return;
  5608. }
  5609. // Make sure that we're working with the right name
  5610. var ret, type, hooks,
  5611. origName = camelCase( name ),
  5612. isCustomProp = rcustomProp.test( name ),
  5613. style = elem.style;
  5614. // Make sure that we're working with the right name. We don't
  5615. // want to query the value if it is a CSS custom property
  5616. // since they are user-defined.
  5617. if ( !isCustomProp ) {
  5618. name = finalPropName( origName );
  5619. }
  5620. // Gets hook for the prefixed version, then unprefixed version
  5621. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5622. // Check if we're setting a value
  5623. if ( value !== undefined ) {
  5624. type = typeof value;
  5625. // Convert "+=" or "-=" to relative numbers (trac-7345)
  5626. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5627. value = adjustCSS( elem, name, ret );
  5628. // Fixes bug trac-9237
  5629. type = "number";
  5630. }
  5631. // Make sure that null and NaN values aren't set (trac-7116)
  5632. if ( value == null || value !== value ) {
  5633. return;
  5634. }
  5635. // If a number was passed in, add the unit (except for certain CSS properties)
  5636. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  5637. // "px" to a few hardcoded values.
  5638. if ( type === "number" && !isCustomProp ) {
  5639. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5640. }
  5641. // background-* props affect original clone's values
  5642. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5643. style[ name ] = "inherit";
  5644. }
  5645. // If a hook was provided, use that value, otherwise just set the specified value
  5646. if ( !hooks || !( "set" in hooks ) ||
  5647. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5648. if ( isCustomProp ) {
  5649. style.setProperty( name, value );
  5650. } else {
  5651. style[ name ] = value;
  5652. }
  5653. }
  5654. } else {
  5655. // If a hook was provided get the non-computed value from there
  5656. if ( hooks && "get" in hooks &&
  5657. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5658. return ret;
  5659. }
  5660. // Otherwise just get the value from the style object
  5661. return style[ name ];
  5662. }
  5663. },
  5664. css: function( elem, name, extra, styles ) {
  5665. var val, num, hooks,
  5666. origName = camelCase( name ),
  5667. isCustomProp = rcustomProp.test( name );
  5668. // Make sure that we're working with the right name. We don't
  5669. // want to modify the value if it is a CSS custom property
  5670. // since they are user-defined.
  5671. if ( !isCustomProp ) {
  5672. name = finalPropName( origName );
  5673. }
  5674. // Try prefixed name followed by the unprefixed name
  5675. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5676. // If a hook was provided get the computed value from there
  5677. if ( hooks && "get" in hooks ) {
  5678. val = hooks.get( elem, true, extra );
  5679. }
  5680. // Otherwise, if a way to get the computed value exists, use that
  5681. if ( val === undefined ) {
  5682. val = curCSS( elem, name, styles );
  5683. }
  5684. // Convert "normal" to computed value
  5685. if ( val === "normal" && name in cssNormalTransform ) {
  5686. val = cssNormalTransform[ name ];
  5687. }
  5688. // Make numeric if forced or a qualifier was provided and val looks numeric
  5689. if ( extra === "" || extra ) {
  5690. num = parseFloat( val );
  5691. return extra === true || isFinite( num ) ? num || 0 : val;
  5692. }
  5693. return val;
  5694. }
  5695. } );
  5696. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  5697. jQuery.cssHooks[ dimension ] = {
  5698. get: function( elem, computed, extra ) {
  5699. if ( computed ) {
  5700. // Certain elements can have dimension info if we invisibly show them
  5701. // but it must have a current display style that would benefit
  5702. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5703. // Support: Safari 8+
  5704. // Table columns in Safari have non-zero offsetWidth & zero
  5705. // getBoundingClientRect().width unless display is changed.
  5706. // Support: IE <=11 only
  5707. // Running getBoundingClientRect on a disconnected node
  5708. // in IE throws an error.
  5709. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5710. swap( elem, cssShow, function() {
  5711. return getWidthOrHeight( elem, dimension, extra );
  5712. } ) :
  5713. getWidthOrHeight( elem, dimension, extra );
  5714. }
  5715. },
  5716. set: function( elem, value, extra ) {
  5717. var matches,
  5718. styles = getStyles( elem ),
  5719. // Only read styles.position if the test has a chance to fail
  5720. // to avoid forcing a reflow.
  5721. scrollboxSizeBuggy = !support.scrollboxSize() &&
  5722. styles.position === "absolute",
  5723. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  5724. boxSizingNeeded = scrollboxSizeBuggy || extra,
  5725. isBorderBox = boxSizingNeeded &&
  5726. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5727. subtract = extra ?
  5728. boxModelAdjustment(
  5729. elem,
  5730. dimension,
  5731. extra,
  5732. isBorderBox,
  5733. styles
  5734. ) :
  5735. 0;
  5736. // Account for unreliable border-box dimensions by comparing offset* to computed and
  5737. // faking a content-box to get border and padding (gh-3699)
  5738. if ( isBorderBox && scrollboxSizeBuggy ) {
  5739. subtract -= Math.ceil(
  5740. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5741. parseFloat( styles[ dimension ] ) -
  5742. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  5743. 0.5
  5744. );
  5745. }
  5746. // Convert to pixels if value adjustment is needed
  5747. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5748. ( matches[ 3 ] || "px" ) !== "px" ) {
  5749. elem.style[ dimension ] = value;
  5750. value = jQuery.css( elem, dimension );
  5751. }
  5752. return setPositiveNumber( elem, value, subtract );
  5753. }
  5754. };
  5755. } );
  5756. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5757. function( elem, computed ) {
  5758. if ( computed ) {
  5759. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5760. elem.getBoundingClientRect().left -
  5761. swap( elem, { marginLeft: 0 }, function() {
  5762. return elem.getBoundingClientRect().left;
  5763. } )
  5764. ) + "px";
  5765. }
  5766. }
  5767. );
  5768. // These hooks are used by animate to expand properties
  5769. jQuery.each( {
  5770. margin: "",
  5771. padding: "",
  5772. border: "Width"
  5773. }, function( prefix, suffix ) {
  5774. jQuery.cssHooks[ prefix + suffix ] = {
  5775. expand: function( value ) {
  5776. var i = 0,
  5777. expanded = {},
  5778. // Assumes a single number if not a string
  5779. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5780. for ( ; i < 4; i++ ) {
  5781. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5782. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5783. }
  5784. return expanded;
  5785. }
  5786. };
  5787. if ( prefix !== "margin" ) {
  5788. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5789. }
  5790. } );
  5791. jQuery.fn.extend( {
  5792. css: function( name, value ) {
  5793. return access( this, function( elem, name, value ) {
  5794. var styles, len,
  5795. map = {},
  5796. i = 0;
  5797. if ( Array.isArray( name ) ) {
  5798. styles = getStyles( elem );
  5799. len = name.length;
  5800. for ( ; i < len; i++ ) {
  5801. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5802. }
  5803. return map;
  5804. }
  5805. return value !== undefined ?
  5806. jQuery.style( elem, name, value ) :
  5807. jQuery.css( elem, name );
  5808. }, name, value, arguments.length > 1 );
  5809. }
  5810. } );
  5811. function Tween( elem, options, prop, end, easing ) {
  5812. return new Tween.prototype.init( elem, options, prop, end, easing );
  5813. }
  5814. jQuery.Tween = Tween;
  5815. Tween.prototype = {
  5816. constructor: Tween,
  5817. init: function( elem, options, prop, end, easing, unit ) {
  5818. this.elem = elem;
  5819. this.prop = prop;
  5820. this.easing = easing || jQuery.easing._default;
  5821. this.options = options;
  5822. this.start = this.now = this.cur();
  5823. this.end = end;
  5824. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5825. },
  5826. cur: function() {
  5827. var hooks = Tween.propHooks[ this.prop ];
  5828. return hooks && hooks.get ?
  5829. hooks.get( this ) :
  5830. Tween.propHooks._default.get( this );
  5831. },
  5832. run: function( percent ) {
  5833. var eased,
  5834. hooks = Tween.propHooks[ this.prop ];
  5835. if ( this.options.duration ) {
  5836. this.pos = eased = jQuery.easing[ this.easing ](
  5837. percent, this.options.duration * percent, 0, 1, this.options.duration
  5838. );
  5839. } else {
  5840. this.pos = eased = percent;
  5841. }
  5842. this.now = ( this.end - this.start ) * eased + this.start;
  5843. if ( this.options.step ) {
  5844. this.options.step.call( this.elem, this.now, this );
  5845. }
  5846. if ( hooks && hooks.set ) {
  5847. hooks.set( this );
  5848. } else {
  5849. Tween.propHooks._default.set( this );
  5850. }
  5851. return this;
  5852. }
  5853. };
  5854. Tween.prototype.init.prototype = Tween.prototype;
  5855. Tween.propHooks = {
  5856. _default: {
  5857. get: function( tween ) {
  5858. var result;
  5859. // Use a property on the element directly when it is not a DOM element,
  5860. // or when there is no matching style property that exists.
  5861. if ( tween.elem.nodeType !== 1 ||
  5862. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5863. return tween.elem[ tween.prop ];
  5864. }
  5865. // Passing an empty string as a 3rd parameter to .css will automatically
  5866. // attempt a parseFloat and fallback to a string if the parse fails.
  5867. // Simple values such as "10px" are parsed to Float;
  5868. // complex values such as "rotate(1rad)" are returned as-is.
  5869. result = jQuery.css( tween.elem, tween.prop, "" );
  5870. // Empty strings, null, undefined and "auto" are converted to 0.
  5871. return !result || result === "auto" ? 0 : result;
  5872. },
  5873. set: function( tween ) {
  5874. // Use step hook for back compat.
  5875. // Use cssHook if its there.
  5876. // Use .style if available and use plain properties where available.
  5877. if ( jQuery.fx.step[ tween.prop ] ) {
  5878. jQuery.fx.step[ tween.prop ]( tween );
  5879. } else if ( tween.elem.nodeType === 1 && (
  5880. jQuery.cssHooks[ tween.prop ] ||
  5881. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  5882. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5883. } else {
  5884. tween.elem[ tween.prop ] = tween.now;
  5885. }
  5886. }
  5887. }
  5888. };
  5889. // Support: IE <=9 only
  5890. // Panic based approach to setting things on disconnected nodes
  5891. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5892. set: function( tween ) {
  5893. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5894. tween.elem[ tween.prop ] = tween.now;
  5895. }
  5896. }
  5897. };
  5898. jQuery.easing = {
  5899. linear: function( p ) {
  5900. return p;
  5901. },
  5902. swing: function( p ) {
  5903. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5904. },
  5905. _default: "swing"
  5906. };
  5907. jQuery.fx = Tween.prototype.init;
  5908. // Back compat <1.8 extension point
  5909. jQuery.fx.step = {};
  5910. var
  5911. fxNow, inProgress,
  5912. rfxtypes = /^(?:toggle|show|hide)$/,
  5913. rrun = /queueHooks$/;
  5914. function schedule() {
  5915. if ( inProgress ) {
  5916. if ( document.hidden === false && window.requestAnimationFrame ) {
  5917. window.requestAnimationFrame( schedule );
  5918. } else {
  5919. window.setTimeout( schedule, jQuery.fx.interval );
  5920. }
  5921. jQuery.fx.tick();
  5922. }
  5923. }
  5924. // Animations created synchronously will run synchronously
  5925. function createFxNow() {
  5926. window.setTimeout( function() {
  5927. fxNow = undefined;
  5928. } );
  5929. return ( fxNow = Date.now() );
  5930. }
  5931. // Generate parameters to create a standard animation
  5932. function genFx( type, includeWidth ) {
  5933. var which,
  5934. i = 0,
  5935. attrs = { height: type };
  5936. // If we include width, step value is 1 to do all cssExpand values,
  5937. // otherwise step value is 2 to skip over Left and Right
  5938. includeWidth = includeWidth ? 1 : 0;
  5939. for ( ; i < 4; i += 2 - includeWidth ) {
  5940. which = cssExpand[ i ];
  5941. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5942. }
  5943. if ( includeWidth ) {
  5944. attrs.opacity = attrs.width = type;
  5945. }
  5946. return attrs;
  5947. }
  5948. function createTween( value, prop, animation ) {
  5949. var tween,
  5950. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5951. index = 0,
  5952. length = collection.length;
  5953. for ( ; index < length; index++ ) {
  5954. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5955. // We're done with this property
  5956. return tween;
  5957. }
  5958. }
  5959. }
  5960. function defaultPrefilter( elem, props, opts ) {
  5961. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5962. isBox = "width" in props || "height" in props,
  5963. anim = this,
  5964. orig = {},
  5965. style = elem.style,
  5966. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5967. dataShow = dataPriv.get( elem, "fxshow" );
  5968. // Queue-skipping animations hijack the fx hooks
  5969. if ( !opts.queue ) {
  5970. hooks = jQuery._queueHooks( elem, "fx" );
  5971. if ( hooks.unqueued == null ) {
  5972. hooks.unqueued = 0;
  5973. oldfire = hooks.empty.fire;
  5974. hooks.empty.fire = function() {
  5975. if ( !hooks.unqueued ) {
  5976. oldfire();
  5977. }
  5978. };
  5979. }
  5980. hooks.unqueued++;
  5981. anim.always( function() {
  5982. // Ensure the complete handler is called before this completes
  5983. anim.always( function() {
  5984. hooks.unqueued--;
  5985. if ( !jQuery.queue( elem, "fx" ).length ) {
  5986. hooks.empty.fire();
  5987. }
  5988. } );
  5989. } );
  5990. }
  5991. // Detect show/hide animations
  5992. for ( prop in props ) {
  5993. value = props[ prop ];
  5994. if ( rfxtypes.test( value ) ) {
  5995. delete props[ prop ];
  5996. toggle = toggle || value === "toggle";
  5997. if ( value === ( hidden ? "hide" : "show" ) ) {
  5998. // Pretend to be hidden if this is a "show" and
  5999. // there is still data from a stopped show/hide
  6000. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  6001. hidden = true;
  6002. // Ignore all other no-op show/hide data
  6003. } else {
  6004. continue;
  6005. }
  6006. }
  6007. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  6008. }
  6009. }
  6010. // Bail out if this is a no-op like .hide().hide()
  6011. propTween = !jQuery.isEmptyObject( props );
  6012. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  6013. return;
  6014. }
  6015. // Restrict "overflow" and "display" styles during box animations
  6016. if ( isBox && elem.nodeType === 1 ) {
  6017. // Support: IE <=9 - 11, Edge 12 - 15
  6018. // Record all 3 overflow attributes because IE does not infer the shorthand
  6019. // from identically-valued overflowX and overflowY and Edge just mirrors
  6020. // the overflowX value there.
  6021. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  6022. // Identify a display type, preferring old show/hide data over the CSS cascade
  6023. restoreDisplay = dataShow && dataShow.display;
  6024. if ( restoreDisplay == null ) {
  6025. restoreDisplay = dataPriv.get( elem, "display" );
  6026. }
  6027. display = jQuery.css( elem, "display" );
  6028. if ( display === "none" ) {
  6029. if ( restoreDisplay ) {
  6030. display = restoreDisplay;
  6031. } else {
  6032. // Get nonempty value(s) by temporarily forcing visibility
  6033. showHide( [ elem ], true );
  6034. restoreDisplay = elem.style.display || restoreDisplay;
  6035. display = jQuery.css( elem, "display" );
  6036. showHide( [ elem ] );
  6037. }
  6038. }
  6039. // Animate inline elements as inline-block
  6040. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  6041. if ( jQuery.css( elem, "float" ) === "none" ) {
  6042. // Restore the original display value at the end of pure show/hide animations
  6043. if ( !propTween ) {
  6044. anim.done( function() {
  6045. style.display = restoreDisplay;
  6046. } );
  6047. if ( restoreDisplay == null ) {
  6048. display = style.display;
  6049. restoreDisplay = display === "none" ? "" : display;
  6050. }
  6051. }
  6052. style.display = "inline-block";
  6053. }
  6054. }
  6055. }
  6056. if ( opts.overflow ) {
  6057. style.overflow = "hidden";
  6058. anim.always( function() {
  6059. style.overflow = opts.overflow[ 0 ];
  6060. style.overflowX = opts.overflow[ 1 ];
  6061. style.overflowY = opts.overflow[ 2 ];
  6062. } );
  6063. }
  6064. // Implement show/hide animations
  6065. propTween = false;
  6066. for ( prop in orig ) {
  6067. // General show/hide setup for this element animation
  6068. if ( !propTween ) {
  6069. if ( dataShow ) {
  6070. if ( "hidden" in dataShow ) {
  6071. hidden = dataShow.hidden;
  6072. }
  6073. } else {
  6074. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  6075. }
  6076. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  6077. if ( toggle ) {
  6078. dataShow.hidden = !hidden;
  6079. }
  6080. // Show elements before animating them
  6081. if ( hidden ) {
  6082. showHide( [ elem ], true );
  6083. }
  6084. /* eslint-disable no-loop-func */
  6085. anim.done( function() {
  6086. /* eslint-enable no-loop-func */
  6087. // The final step of a "hide" animation is actually hiding the element
  6088. if ( !hidden ) {
  6089. showHide( [ elem ] );
  6090. }
  6091. dataPriv.remove( elem, "fxshow" );
  6092. for ( prop in orig ) {
  6093. jQuery.style( elem, prop, orig[ prop ] );
  6094. }
  6095. } );
  6096. }
  6097. // Per-property setup
  6098. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  6099. if ( !( prop in dataShow ) ) {
  6100. dataShow[ prop ] = propTween.start;
  6101. if ( hidden ) {
  6102. propTween.end = propTween.start;
  6103. propTween.start = 0;
  6104. }
  6105. }
  6106. }
  6107. }
  6108. function propFilter( props, specialEasing ) {
  6109. var index, name, easing, value, hooks;
  6110. // camelCase, specialEasing and expand cssHook pass
  6111. for ( index in props ) {
  6112. name = camelCase( index );
  6113. easing = specialEasing[ name ];
  6114. value = props[ index ];
  6115. if ( Array.isArray( value ) ) {
  6116. easing = value[ 1 ];
  6117. value = props[ index ] = value[ 0 ];
  6118. }
  6119. if ( index !== name ) {
  6120. props[ name ] = value;
  6121. delete props[ index ];
  6122. }
  6123. hooks = jQuery.cssHooks[ name ];
  6124. if ( hooks && "expand" in hooks ) {
  6125. value = hooks.expand( value );
  6126. delete props[ name ];
  6127. // Not quite $.extend, this won't overwrite existing keys.
  6128. // Reusing 'index' because we have the correct "name"
  6129. for ( index in value ) {
  6130. if ( !( index in props ) ) {
  6131. props[ index ] = value[ index ];
  6132. specialEasing[ index ] = easing;
  6133. }
  6134. }
  6135. } else {
  6136. specialEasing[ name ] = easing;
  6137. }
  6138. }
  6139. }
  6140. function Animation( elem, properties, options ) {
  6141. var result,
  6142. stopped,
  6143. index = 0,
  6144. length = Animation.prefilters.length,
  6145. deferred = jQuery.Deferred().always( function() {
  6146. // Don't match elem in the :animated selector
  6147. delete tick.elem;
  6148. } ),
  6149. tick = function() {
  6150. if ( stopped ) {
  6151. return false;
  6152. }
  6153. var currentTime = fxNow || createFxNow(),
  6154. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6155. // Support: Android 2.3 only
  6156. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
  6157. temp = remaining / animation.duration || 0,
  6158. percent = 1 - temp,
  6159. index = 0,
  6160. length = animation.tweens.length;
  6161. for ( ; index < length; index++ ) {
  6162. animation.tweens[ index ].run( percent );
  6163. }
  6164. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  6165. // If there's more to do, yield
  6166. if ( percent < 1 && length ) {
  6167. return remaining;
  6168. }
  6169. // If this was an empty animation, synthesize a final progress notification
  6170. if ( !length ) {
  6171. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6172. }
  6173. // Resolve the animation and report its conclusion
  6174. deferred.resolveWith( elem, [ animation ] );
  6175. return false;
  6176. },
  6177. animation = deferred.promise( {
  6178. elem: elem,
  6179. props: jQuery.extend( {}, properties ),
  6180. opts: jQuery.extend( true, {
  6181. specialEasing: {},
  6182. easing: jQuery.easing._default
  6183. }, options ),
  6184. originalProperties: properties,
  6185. originalOptions: options,
  6186. startTime: fxNow || createFxNow(),
  6187. duration: options.duration,
  6188. tweens: [],
  6189. createTween: function( prop, end ) {
  6190. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6191. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6192. animation.tweens.push( tween );
  6193. return tween;
  6194. },
  6195. stop: function( gotoEnd ) {
  6196. var index = 0,
  6197. // If we are going to the end, we want to run all the tweens
  6198. // otherwise we skip this part
  6199. length = gotoEnd ? animation.tweens.length : 0;
  6200. if ( stopped ) {
  6201. return this;
  6202. }
  6203. stopped = true;
  6204. for ( ; index < length; index++ ) {
  6205. animation.tweens[ index ].run( 1 );
  6206. }
  6207. // Resolve when we played the last frame; otherwise, reject
  6208. if ( gotoEnd ) {
  6209. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6210. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6211. } else {
  6212. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6213. }
  6214. return this;
  6215. }
  6216. } ),
  6217. props = animation.props;
  6218. propFilter( props, animation.opts.specialEasing );
  6219. for ( ; index < length; index++ ) {
  6220. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  6221. if ( result ) {
  6222. if ( isFunction( result.stop ) ) {
  6223. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  6224. result.stop.bind( result );
  6225. }
  6226. return result;
  6227. }
  6228. }
  6229. jQuery.map( props, createTween, animation );
  6230. if ( isFunction( animation.opts.start ) ) {
  6231. animation.opts.start.call( elem, animation );
  6232. }
  6233. // Attach callbacks from options
  6234. animation
  6235. .progress( animation.opts.progress )
  6236. .done( animation.opts.done, animation.opts.complete )
  6237. .fail( animation.opts.fail )
  6238. .always( animation.opts.always );
  6239. jQuery.fx.timer(
  6240. jQuery.extend( tick, {
  6241. elem: elem,
  6242. anim: animation,
  6243. queue: animation.opts.queue
  6244. } )
  6245. );
  6246. return animation;
  6247. }
  6248. jQuery.Animation = jQuery.extend( Animation, {
  6249. tweeners: {
  6250. "*": [ function( prop, value ) {
  6251. var tween = this.createTween( prop, value );
  6252. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  6253. return tween;
  6254. } ]
  6255. },
  6256. tweener: function( props, callback ) {
  6257. if ( isFunction( props ) ) {
  6258. callback = props;
  6259. props = [ "*" ];
  6260. } else {
  6261. props = props.match( rnothtmlwhite );
  6262. }
  6263. var prop,
  6264. index = 0,
  6265. length = props.length;
  6266. for ( ; index < length; index++ ) {
  6267. prop = props[ index ];
  6268. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  6269. Animation.tweeners[ prop ].unshift( callback );
  6270. }
  6271. },
  6272. prefilters: [ defaultPrefilter ],
  6273. prefilter: function( callback, prepend ) {
  6274. if ( prepend ) {
  6275. Animation.prefilters.unshift( callback );
  6276. } else {
  6277. Animation.prefilters.push( callback );
  6278. }
  6279. }
  6280. } );
  6281. jQuery.speed = function( speed, easing, fn ) {
  6282. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6283. complete: fn || !fn && easing ||
  6284. isFunction( speed ) && speed,
  6285. duration: speed,
  6286. easing: fn && easing || easing && !isFunction( easing ) && easing
  6287. };
  6288. // Go to the end state if fx are off
  6289. if ( jQuery.fx.off ) {
  6290. opt.duration = 0;
  6291. } else {
  6292. if ( typeof opt.duration !== "number" ) {
  6293. if ( opt.duration in jQuery.fx.speeds ) {
  6294. opt.duration = jQuery.fx.speeds[ opt.duration ];
  6295. } else {
  6296. opt.duration = jQuery.fx.speeds._default;
  6297. }
  6298. }
  6299. }
  6300. // Normalize opt.queue - true/undefined/null -> "fx"
  6301. if ( opt.queue == null || opt.queue === true ) {
  6302. opt.queue = "fx";
  6303. }
  6304. // Queueing
  6305. opt.old = opt.complete;
  6306. opt.complete = function() {
  6307. if ( isFunction( opt.old ) ) {
  6308. opt.old.call( this );
  6309. }
  6310. if ( opt.queue ) {
  6311. jQuery.dequeue( this, opt.queue );
  6312. }
  6313. };
  6314. return opt;
  6315. };
  6316. jQuery.fn.extend( {
  6317. fadeTo: function( speed, to, easing, callback ) {
  6318. // Show any hidden elements after setting opacity to 0
  6319. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6320. // Animate to the value specified
  6321. .end().animate( { opacity: to }, speed, easing, callback );
  6322. },
  6323. animate: function( prop, speed, easing, callback ) {
  6324. var empty = jQuery.isEmptyObject( prop ),
  6325. optall = jQuery.speed( speed, easing, callback ),
  6326. doAnimation = function() {
  6327. // Operate on a copy of prop so per-property easing won't be lost
  6328. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6329. // Empty animations, or finishing resolves immediately
  6330. if ( empty || dataPriv.get( this, "finish" ) ) {
  6331. anim.stop( true );
  6332. }
  6333. };
  6334. doAnimation.finish = doAnimation;
  6335. return empty || optall.queue === false ?
  6336. this.each( doAnimation ) :
  6337. this.queue( optall.queue, doAnimation );
  6338. },
  6339. stop: function( type, clearQueue, gotoEnd ) {
  6340. var stopQueue = function( hooks ) {
  6341. var stop = hooks.stop;
  6342. delete hooks.stop;
  6343. stop( gotoEnd );
  6344. };
  6345. if ( typeof type !== "string" ) {
  6346. gotoEnd = clearQueue;
  6347. clearQueue = type;
  6348. type = undefined;
  6349. }
  6350. if ( clearQueue ) {
  6351. this.queue( type || "fx", [] );
  6352. }
  6353. return this.each( function() {
  6354. var dequeue = true,
  6355. index = type != null && type + "queueHooks",
  6356. timers = jQuery.timers,
  6357. data = dataPriv.get( this );
  6358. if ( index ) {
  6359. if ( data[ index ] && data[ index ].stop ) {
  6360. stopQueue( data[ index ] );
  6361. }
  6362. } else {
  6363. for ( index in data ) {
  6364. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6365. stopQueue( data[ index ] );
  6366. }
  6367. }
  6368. }
  6369. for ( index = timers.length; index--; ) {
  6370. if ( timers[ index ].elem === this &&
  6371. ( type == null || timers[ index ].queue === type ) ) {
  6372. timers[ index ].anim.stop( gotoEnd );
  6373. dequeue = false;
  6374. timers.splice( index, 1 );
  6375. }
  6376. }
  6377. // Start the next in the queue if the last step wasn't forced.
  6378. // Timers currently will call their complete callbacks, which
  6379. // will dequeue but only if they were gotoEnd.
  6380. if ( dequeue || !gotoEnd ) {
  6381. jQuery.dequeue( this, type );
  6382. }
  6383. } );
  6384. },
  6385. finish: function( type ) {
  6386. if ( type !== false ) {
  6387. type = type || "fx";
  6388. }
  6389. return this.each( function() {
  6390. var index,
  6391. data = dataPriv.get( this ),
  6392. queue = data[ type + "queue" ],
  6393. hooks = data[ type + "queueHooks" ],
  6394. timers = jQuery.timers,
  6395. length = queue ? queue.length : 0;
  6396. // Enable finishing flag on private data
  6397. data.finish = true;
  6398. // Empty the queue first
  6399. jQuery.queue( this, type, [] );
  6400. if ( hooks && hooks.stop ) {
  6401. hooks.stop.call( this, true );
  6402. }
  6403. // Look for any active animations, and finish them
  6404. for ( index = timers.length; index--; ) {
  6405. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6406. timers[ index ].anim.stop( true );
  6407. timers.splice( index, 1 );
  6408. }
  6409. }
  6410. // Look for any animations in the old queue and finish them
  6411. for ( index = 0; index < length; index++ ) {
  6412. if ( queue[ index ] && queue[ index ].finish ) {
  6413. queue[ index ].finish.call( this );
  6414. }
  6415. }
  6416. // Turn off finishing flag
  6417. delete data.finish;
  6418. } );
  6419. }
  6420. } );
  6421. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  6422. var cssFn = jQuery.fn[ name ];
  6423. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6424. return speed == null || typeof speed === "boolean" ?
  6425. cssFn.apply( this, arguments ) :
  6426. this.animate( genFx( name, true ), speed, easing, callback );
  6427. };
  6428. } );
  6429. // Generate shortcuts for custom animations
  6430. jQuery.each( {
  6431. slideDown: genFx( "show" ),
  6432. slideUp: genFx( "hide" ),
  6433. slideToggle: genFx( "toggle" ),
  6434. fadeIn: { opacity: "show" },
  6435. fadeOut: { opacity: "hide" },
  6436. fadeToggle: { opacity: "toggle" }
  6437. }, function( name, props ) {
  6438. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6439. return this.animate( props, speed, easing, callback );
  6440. };
  6441. } );
  6442. jQuery.timers = [];
  6443. jQuery.fx.tick = function() {
  6444. var timer,
  6445. i = 0,
  6446. timers = jQuery.timers;
  6447. fxNow = Date.now();
  6448. for ( ; i < timers.length; i++ ) {
  6449. timer = timers[ i ];
  6450. // Run the timer and safely remove it when done (allowing for external removal)
  6451. if ( !timer() && timers[ i ] === timer ) {
  6452. timers.splice( i--, 1 );
  6453. }
  6454. }
  6455. if ( !timers.length ) {
  6456. jQuery.fx.stop();
  6457. }
  6458. fxNow = undefined;
  6459. };
  6460. jQuery.fx.timer = function( timer ) {
  6461. jQuery.timers.push( timer );
  6462. jQuery.fx.start();
  6463. };
  6464. jQuery.fx.interval = 13;
  6465. jQuery.fx.start = function() {
  6466. if ( inProgress ) {
  6467. return;
  6468. }
  6469. inProgress = true;
  6470. schedule();
  6471. };
  6472. jQuery.fx.stop = function() {
  6473. inProgress = null;
  6474. };
  6475. jQuery.fx.speeds = {
  6476. slow: 600,
  6477. fast: 200,
  6478. // Default speed
  6479. _default: 400
  6480. };
  6481. // Based off of the plugin by Clint Helfers, with permission.
  6482. jQuery.fn.delay = function( time, type ) {
  6483. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6484. type = type || "fx";
  6485. return this.queue( type, function( next, hooks ) {
  6486. var timeout = window.setTimeout( next, time );
  6487. hooks.stop = function() {
  6488. window.clearTimeout( timeout );
  6489. };
  6490. } );
  6491. };
  6492. ( function() {
  6493. var input = document.createElement( "input" ),
  6494. select = document.createElement( "select" ),
  6495. opt = select.appendChild( document.createElement( "option" ) );
  6496. input.type = "checkbox";
  6497. // Support: Android <=4.3 only
  6498. // Default value for a checkbox should be "on"
  6499. support.checkOn = input.value !== "";
  6500. // Support: IE <=11 only
  6501. // Must access selectedIndex to make default options select
  6502. support.optSelected = opt.selected;
  6503. // Support: IE <=11 only
  6504. // An input loses its value after becoming a radio
  6505. input = document.createElement( "input" );
  6506. input.value = "t";
  6507. input.type = "radio";
  6508. support.radioValue = input.value === "t";
  6509. } )();
  6510. var boolHook,
  6511. attrHandle = jQuery.expr.attrHandle;
  6512. jQuery.fn.extend( {
  6513. attr: function( name, value ) {
  6514. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6515. },
  6516. removeAttr: function( name ) {
  6517. return this.each( function() {
  6518. jQuery.removeAttr( this, name );
  6519. } );
  6520. }
  6521. } );
  6522. jQuery.extend( {
  6523. attr: function( elem, name, value ) {
  6524. var ret, hooks,
  6525. nType = elem.nodeType;
  6526. // Don't get/set attributes on text, comment and attribute nodes
  6527. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6528. return;
  6529. }
  6530. // Fallback to prop when attributes are not supported
  6531. if ( typeof elem.getAttribute === "undefined" ) {
  6532. return jQuery.prop( elem, name, value );
  6533. }
  6534. // Attribute hooks are determined by the lowercase version
  6535. // Grab necessary hook if one is defined
  6536. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6537. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6538. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6539. }
  6540. if ( value !== undefined ) {
  6541. if ( value === null ) {
  6542. jQuery.removeAttr( elem, name );
  6543. return;
  6544. }
  6545. if ( hooks && "set" in hooks &&
  6546. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6547. return ret;
  6548. }
  6549. elem.setAttribute( name, value + "" );
  6550. return value;
  6551. }
  6552. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6553. return ret;
  6554. }
  6555. ret = jQuery.find.attr( elem, name );
  6556. // Non-existent attributes return null, we normalize to undefined
  6557. return ret == null ? undefined : ret;
  6558. },
  6559. attrHooks: {
  6560. type: {
  6561. set: function( elem, value ) {
  6562. if ( !support.radioValue && value === "radio" &&
  6563. nodeName( elem, "input" ) ) {
  6564. var val = elem.value;
  6565. elem.setAttribute( "type", value );
  6566. if ( val ) {
  6567. elem.value = val;
  6568. }
  6569. return value;
  6570. }
  6571. }
  6572. }
  6573. },
  6574. removeAttr: function( elem, value ) {
  6575. var name,
  6576. i = 0,
  6577. // Attribute names can contain non-HTML whitespace characters
  6578. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6579. attrNames = value && value.match( rnothtmlwhite );
  6580. if ( attrNames && elem.nodeType === 1 ) {
  6581. while ( ( name = attrNames[ i++ ] ) ) {
  6582. elem.removeAttribute( name );
  6583. }
  6584. }
  6585. }
  6586. } );
  6587. // Hooks for boolean attributes
  6588. boolHook = {
  6589. set: function( elem, value, name ) {
  6590. if ( value === false ) {
  6591. // Remove boolean attributes when set to false
  6592. jQuery.removeAttr( elem, name );
  6593. } else {
  6594. elem.setAttribute( name, name );
  6595. }
  6596. return name;
  6597. }
  6598. };
  6599. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  6600. var getter = attrHandle[ name ] || jQuery.find.attr;
  6601. attrHandle[ name ] = function( elem, name, isXML ) {
  6602. var ret, handle,
  6603. lowercaseName = name.toLowerCase();
  6604. if ( !isXML ) {
  6605. // Avoid an infinite loop by temporarily removing this function from the getter
  6606. handle = attrHandle[ lowercaseName ];
  6607. attrHandle[ lowercaseName ] = ret;
  6608. ret = getter( elem, name, isXML ) != null ?
  6609. lowercaseName :
  6610. null;
  6611. attrHandle[ lowercaseName ] = handle;
  6612. }
  6613. return ret;
  6614. };
  6615. } );
  6616. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6617. rclickable = /^(?:a|area)$/i;
  6618. jQuery.fn.extend( {
  6619. prop: function( name, value ) {
  6620. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6621. },
  6622. removeProp: function( name ) {
  6623. return this.each( function() {
  6624. delete this[ jQuery.propFix[ name ] || name ];
  6625. } );
  6626. }
  6627. } );
  6628. jQuery.extend( {
  6629. prop: function( elem, name, value ) {
  6630. var ret, hooks,
  6631. nType = elem.nodeType;
  6632. // Don't get/set properties on text, comment and attribute nodes
  6633. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6634. return;
  6635. }
  6636. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6637. // Fix name and attach hooks
  6638. name = jQuery.propFix[ name ] || name;
  6639. hooks = jQuery.propHooks[ name ];
  6640. }
  6641. if ( value !== undefined ) {
  6642. if ( hooks && "set" in hooks &&
  6643. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6644. return ret;
  6645. }
  6646. return ( elem[ name ] = value );
  6647. }
  6648. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6649. return ret;
  6650. }
  6651. return elem[ name ];
  6652. },
  6653. propHooks: {
  6654. tabIndex: {
  6655. get: function( elem ) {
  6656. // Support: IE <=9 - 11 only
  6657. // elem.tabIndex doesn't always return the
  6658. // correct value when it hasn't been explicitly set
  6659. // Use proper attribute retrieval (trac-12072)
  6660. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6661. if ( tabindex ) {
  6662. return parseInt( tabindex, 10 );
  6663. }
  6664. if (
  6665. rfocusable.test( elem.nodeName ) ||
  6666. rclickable.test( elem.nodeName ) &&
  6667. elem.href
  6668. ) {
  6669. return 0;
  6670. }
  6671. return -1;
  6672. }
  6673. }
  6674. },
  6675. propFix: {
  6676. "for": "htmlFor",
  6677. "class": "className"
  6678. }
  6679. } );
  6680. // Support: IE <=11 only
  6681. // Accessing the selectedIndex property
  6682. // forces the browser to respect setting selected
  6683. // on the option
  6684. // The getter ensures a default option is selected
  6685. // when in an optgroup
  6686. // eslint rule "no-unused-expressions" is disabled for this code
  6687. // since it considers such accessions noop
  6688. if ( !support.optSelected ) {
  6689. jQuery.propHooks.selected = {
  6690. get: function( elem ) {
  6691. /* eslint no-unused-expressions: "off" */
  6692. var parent = elem.parentNode;
  6693. if ( parent && parent.parentNode ) {
  6694. parent.parentNode.selectedIndex;
  6695. }
  6696. return null;
  6697. },
  6698. set: function( elem ) {
  6699. /* eslint no-unused-expressions: "off" */
  6700. var parent = elem.parentNode;
  6701. if ( parent ) {
  6702. parent.selectedIndex;
  6703. if ( parent.parentNode ) {
  6704. parent.parentNode.selectedIndex;
  6705. }
  6706. }
  6707. }
  6708. };
  6709. }
  6710. jQuery.each( [
  6711. "tabIndex",
  6712. "readOnly",
  6713. "maxLength",
  6714. "cellSpacing",
  6715. "cellPadding",
  6716. "rowSpan",
  6717. "colSpan",
  6718. "useMap",
  6719. "frameBorder",
  6720. "contentEditable"
  6721. ], function() {
  6722. jQuery.propFix[ this.toLowerCase() ] = this;
  6723. } );
  6724. // Strip and collapse whitespace according to HTML spec
  6725. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  6726. function stripAndCollapse( value ) {
  6727. var tokens = value.match( rnothtmlwhite ) || [];
  6728. return tokens.join( " " );
  6729. }
  6730. function getClass( elem ) {
  6731. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6732. }
  6733. function classesToArray( value ) {
  6734. if ( Array.isArray( value ) ) {
  6735. return value;
  6736. }
  6737. if ( typeof value === "string" ) {
  6738. return value.match( rnothtmlwhite ) || [];
  6739. }
  6740. return [];
  6741. }
  6742. jQuery.fn.extend( {
  6743. addClass: function( value ) {
  6744. var classNames, cur, curValue, className, i, finalValue;
  6745. if ( isFunction( value ) ) {
  6746. return this.each( function( j ) {
  6747. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6748. } );
  6749. }
  6750. classNames = classesToArray( value );
  6751. if ( classNames.length ) {
  6752. return this.each( function() {
  6753. curValue = getClass( this );
  6754. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6755. if ( cur ) {
  6756. for ( i = 0; i < classNames.length; i++ ) {
  6757. className = classNames[ i ];
  6758. if ( cur.indexOf( " " + className + " " ) < 0 ) {
  6759. cur += className + " ";
  6760. }
  6761. }
  6762. // Only assign if different to avoid unneeded rendering.
  6763. finalValue = stripAndCollapse( cur );
  6764. if ( curValue !== finalValue ) {
  6765. this.setAttribute( "class", finalValue );
  6766. }
  6767. }
  6768. } );
  6769. }
  6770. return this;
  6771. },
  6772. removeClass: function( value ) {
  6773. var classNames, cur, curValue, className, i, finalValue;
  6774. if ( isFunction( value ) ) {
  6775. return this.each( function( j ) {
  6776. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6777. } );
  6778. }
  6779. if ( !arguments.length ) {
  6780. return this.attr( "class", "" );
  6781. }
  6782. classNames = classesToArray( value );
  6783. if ( classNames.length ) {
  6784. return this.each( function() {
  6785. curValue = getClass( this );
  6786. // This expression is here for better compressibility (see addClass)
  6787. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6788. if ( cur ) {
  6789. for ( i = 0; i < classNames.length; i++ ) {
  6790. className = classNames[ i ];
  6791. // Remove *all* instances
  6792. while ( cur.indexOf( " " + className + " " ) > -1 ) {
  6793. cur = cur.replace( " " + className + " ", " " );
  6794. }
  6795. }
  6796. // Only assign if different to avoid unneeded rendering.
  6797. finalValue = stripAndCollapse( cur );
  6798. if ( curValue !== finalValue ) {
  6799. this.setAttribute( "class", finalValue );
  6800. }
  6801. }
  6802. } );
  6803. }
  6804. return this;
  6805. },
  6806. toggleClass: function( value, stateVal ) {
  6807. var classNames, className, i, self,
  6808. type = typeof value,
  6809. isValidValue = type === "string" || Array.isArray( value );
  6810. if ( isFunction( value ) ) {
  6811. return this.each( function( i ) {
  6812. jQuery( this ).toggleClass(
  6813. value.call( this, i, getClass( this ), stateVal ),
  6814. stateVal
  6815. );
  6816. } );
  6817. }
  6818. if ( typeof stateVal === "boolean" && isValidValue ) {
  6819. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6820. }
  6821. classNames = classesToArray( value );
  6822. return this.each( function() {
  6823. if ( isValidValue ) {
  6824. // Toggle individual class names
  6825. self = jQuery( this );
  6826. for ( i = 0; i < classNames.length; i++ ) {
  6827. className = classNames[ i ];
  6828. // Check each className given, space separated list
  6829. if ( self.hasClass( className ) ) {
  6830. self.removeClass( className );
  6831. } else {
  6832. self.addClass( className );
  6833. }
  6834. }
  6835. // Toggle whole class name
  6836. } else if ( value === undefined || type === "boolean" ) {
  6837. className = getClass( this );
  6838. if ( className ) {
  6839. // Store className if set
  6840. dataPriv.set( this, "__className__", className );
  6841. }
  6842. // If the element has a class name or if we're passed `false`,
  6843. // then remove the whole classname (if there was one, the above saved it).
  6844. // Otherwise bring back whatever was previously saved (if anything),
  6845. // falling back to the empty string if nothing was stored.
  6846. if ( this.setAttribute ) {
  6847. this.setAttribute( "class",
  6848. className || value === false ?
  6849. "" :
  6850. dataPriv.get( this, "__className__" ) || ""
  6851. );
  6852. }
  6853. }
  6854. } );
  6855. },
  6856. hasClass: function( selector ) {
  6857. var className, elem,
  6858. i = 0;
  6859. className = " " + selector + " ";
  6860. while ( ( elem = this[ i++ ] ) ) {
  6861. if ( elem.nodeType === 1 &&
  6862. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6863. return true;
  6864. }
  6865. }
  6866. return false;
  6867. }
  6868. } );
  6869. var rreturn = /\r/g;
  6870. jQuery.fn.extend( {
  6871. val: function( value ) {
  6872. var hooks, ret, valueIsFunction,
  6873. elem = this[ 0 ];
  6874. if ( !arguments.length ) {
  6875. if ( elem ) {
  6876. hooks = jQuery.valHooks[ elem.type ] ||
  6877. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6878. if ( hooks &&
  6879. "get" in hooks &&
  6880. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6881. ) {
  6882. return ret;
  6883. }
  6884. ret = elem.value;
  6885. // Handle most common string cases
  6886. if ( typeof ret === "string" ) {
  6887. return ret.replace( rreturn, "" );
  6888. }
  6889. // Handle cases where value is null/undef or number
  6890. return ret == null ? "" : ret;
  6891. }
  6892. return;
  6893. }
  6894. valueIsFunction = isFunction( value );
  6895. return this.each( function( i ) {
  6896. var val;
  6897. if ( this.nodeType !== 1 ) {
  6898. return;
  6899. }
  6900. if ( valueIsFunction ) {
  6901. val = value.call( this, i, jQuery( this ).val() );
  6902. } else {
  6903. val = value;
  6904. }
  6905. // Treat null/undefined as ""; convert numbers to string
  6906. if ( val == null ) {
  6907. val = "";
  6908. } else if ( typeof val === "number" ) {
  6909. val += "";
  6910. } else if ( Array.isArray( val ) ) {
  6911. val = jQuery.map( val, function( value ) {
  6912. return value == null ? "" : value + "";
  6913. } );
  6914. }
  6915. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6916. // If set returns undefined, fall back to normal setting
  6917. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6918. this.value = val;
  6919. }
  6920. } );
  6921. }
  6922. } );
  6923. jQuery.extend( {
  6924. valHooks: {
  6925. option: {
  6926. get: function( elem ) {
  6927. var val = jQuery.find.attr( elem, "value" );
  6928. return val != null ?
  6929. val :
  6930. // Support: IE <=10 - 11 only
  6931. // option.text throws exceptions (trac-14686, trac-14858)
  6932. // Strip and collapse whitespace
  6933. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6934. stripAndCollapse( jQuery.text( elem ) );
  6935. }
  6936. },
  6937. select: {
  6938. get: function( elem ) {
  6939. var value, option, i,
  6940. options = elem.options,
  6941. index = elem.selectedIndex,
  6942. one = elem.type === "select-one",
  6943. values = one ? null : [],
  6944. max = one ? index + 1 : options.length;
  6945. if ( index < 0 ) {
  6946. i = max;
  6947. } else {
  6948. i = one ? index : 0;
  6949. }
  6950. // Loop through all the selected options
  6951. for ( ; i < max; i++ ) {
  6952. option = options[ i ];
  6953. // Support: IE <=9 only
  6954. // IE8-9 doesn't update selected after form reset (trac-2551)
  6955. if ( ( option.selected || i === index ) &&
  6956. // Don't return options that are disabled or in a disabled optgroup
  6957. !option.disabled &&
  6958. ( !option.parentNode.disabled ||
  6959. !nodeName( option.parentNode, "optgroup" ) ) ) {
  6960. // Get the specific value for the option
  6961. value = jQuery( option ).val();
  6962. // We don't need an array for one selects
  6963. if ( one ) {
  6964. return value;
  6965. }
  6966. // Multi-Selects return an array
  6967. values.push( value );
  6968. }
  6969. }
  6970. return values;
  6971. },
  6972. set: function( elem, value ) {
  6973. var optionSet, option,
  6974. options = elem.options,
  6975. values = jQuery.makeArray( value ),
  6976. i = options.length;
  6977. while ( i-- ) {
  6978. option = options[ i ];
  6979. /* eslint-disable no-cond-assign */
  6980. if ( option.selected =
  6981. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6982. ) {
  6983. optionSet = true;
  6984. }
  6985. /* eslint-enable no-cond-assign */
  6986. }
  6987. // Force browsers to behave consistently when non-matching value is set
  6988. if ( !optionSet ) {
  6989. elem.selectedIndex = -1;
  6990. }
  6991. return values;
  6992. }
  6993. }
  6994. }
  6995. } );
  6996. // Radios and checkboxes getter/setter
  6997. jQuery.each( [ "radio", "checkbox" ], function() {
  6998. jQuery.valHooks[ this ] = {
  6999. set: function( elem, value ) {
  7000. if ( Array.isArray( value ) ) {
  7001. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  7002. }
  7003. }
  7004. };
  7005. if ( !support.checkOn ) {
  7006. jQuery.valHooks[ this ].get = function( elem ) {
  7007. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  7008. };
  7009. }
  7010. } );
  7011. // Return jQuery for attributes-only inclusion
  7012. var location = window.location;
  7013. var nonce = { guid: Date.now() };
  7014. var rquery = ( /\?/ );
  7015. // Cross-browser xml parsing
  7016. jQuery.parseXML = function( data ) {
  7017. var xml, parserErrorElem;
  7018. if ( !data || typeof data !== "string" ) {
  7019. return null;
  7020. }
  7021. // Support: IE 9 - 11 only
  7022. // IE throws on parseFromString with invalid input.
  7023. try {
  7024. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  7025. } catch ( e ) {}
  7026. parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
  7027. if ( !xml || parserErrorElem ) {
  7028. jQuery.error( "Invalid XML: " + (
  7029. parserErrorElem ?
  7030. jQuery.map( parserErrorElem.childNodes, function( el ) {
  7031. return el.textContent;
  7032. } ).join( "\n" ) :
  7033. data
  7034. ) );
  7035. }
  7036. return xml;
  7037. };
  7038. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  7039. stopPropagationCallback = function( e ) {
  7040. e.stopPropagation();
  7041. };
  7042. jQuery.extend( jQuery.event, {
  7043. trigger: function( event, data, elem, onlyHandlers ) {
  7044. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  7045. eventPath = [ elem || document ],
  7046. type = hasOwn.call( event, "type" ) ? event.type : event,
  7047. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  7048. cur = lastElement = tmp = elem = elem || document;
  7049. // Don't do events on text and comment nodes
  7050. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  7051. return;
  7052. }
  7053. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  7054. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  7055. return;
  7056. }
  7057. if ( type.indexOf( "." ) > -1 ) {
  7058. // Namespaced trigger; create a regexp to match event type in handle()
  7059. namespaces = type.split( "." );
  7060. type = namespaces.shift();
  7061. namespaces.sort();
  7062. }
  7063. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  7064. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  7065. event = event[ jQuery.expando ] ?
  7066. event :
  7067. new jQuery.Event( type, typeof event === "object" && event );
  7068. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  7069. event.isTrigger = onlyHandlers ? 2 : 3;
  7070. event.namespace = namespaces.join( "." );
  7071. event.rnamespace = event.namespace ?
  7072. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  7073. null;
  7074. // Clean up the event in case it is being reused
  7075. event.result = undefined;
  7076. if ( !event.target ) {
  7077. event.target = elem;
  7078. }
  7079. // Clone any incoming data and prepend the event, creating the handler arg list
  7080. data = data == null ?
  7081. [ event ] :
  7082. jQuery.makeArray( data, [ event ] );
  7083. // Allow special events to draw outside the lines
  7084. special = jQuery.event.special[ type ] || {};
  7085. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  7086. return;
  7087. }
  7088. // Determine event propagation path in advance, per W3C events spec (trac-9951)
  7089. // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
  7090. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  7091. bubbleType = special.delegateType || type;
  7092. if ( !rfocusMorph.test( bubbleType + type ) ) {
  7093. cur = cur.parentNode;
  7094. }
  7095. for ( ; cur; cur = cur.parentNode ) {
  7096. eventPath.push( cur );
  7097. tmp = cur;
  7098. }
  7099. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  7100. if ( tmp === ( elem.ownerDocument || document ) ) {
  7101. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  7102. }
  7103. }
  7104. // Fire handlers on the event path
  7105. i = 0;
  7106. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  7107. lastElement = cur;
  7108. event.type = i > 1 ?
  7109. bubbleType :
  7110. special.bindType || type;
  7111. // jQuery handler
  7112. handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
  7113. dataPriv.get( cur, "handle" );
  7114. if ( handle ) {
  7115. handle.apply( cur, data );
  7116. }
  7117. // Native handler
  7118. handle = ontype && cur[ ontype ];
  7119. if ( handle && handle.apply && acceptData( cur ) ) {
  7120. event.result = handle.apply( cur, data );
  7121. if ( event.result === false ) {
  7122. event.preventDefault();
  7123. }
  7124. }
  7125. }
  7126. event.type = type;
  7127. // If nobody prevented the default action, do it now
  7128. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7129. if ( ( !special._default ||
  7130. special._default.apply( eventPath.pop(), data ) === false ) &&
  7131. acceptData( elem ) ) {
  7132. // Call a native DOM method on the target with the same name as the event.
  7133. // Don't do default actions on window, that's where global variables be (trac-6170)
  7134. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7135. // Don't re-trigger an onFOO event when we call its FOO() method
  7136. tmp = elem[ ontype ];
  7137. if ( tmp ) {
  7138. elem[ ontype ] = null;
  7139. }
  7140. // Prevent re-triggering of the same event, since we already bubbled it above
  7141. jQuery.event.triggered = type;
  7142. if ( event.isPropagationStopped() ) {
  7143. lastElement.addEventListener( type, stopPropagationCallback );
  7144. }
  7145. elem[ type ]();
  7146. if ( event.isPropagationStopped() ) {
  7147. lastElement.removeEventListener( type, stopPropagationCallback );
  7148. }
  7149. jQuery.event.triggered = undefined;
  7150. if ( tmp ) {
  7151. elem[ ontype ] = tmp;
  7152. }
  7153. }
  7154. }
  7155. }
  7156. return event.result;
  7157. },
  7158. // Piggyback on a donor event to simulate a different one
  7159. // Used only for `focus(in | out)` events
  7160. simulate: function( type, elem, event ) {
  7161. var e = jQuery.extend(
  7162. new jQuery.Event(),
  7163. event,
  7164. {
  7165. type: type,
  7166. isSimulated: true
  7167. }
  7168. );
  7169. jQuery.event.trigger( e, null, elem );
  7170. }
  7171. } );
  7172. jQuery.fn.extend( {
  7173. trigger: function( type, data ) {
  7174. return this.each( function() {
  7175. jQuery.event.trigger( type, data, this );
  7176. } );
  7177. },
  7178. triggerHandler: function( type, data ) {
  7179. var elem = this[ 0 ];
  7180. if ( elem ) {
  7181. return jQuery.event.trigger( type, data, elem, true );
  7182. }
  7183. }
  7184. } );
  7185. var
  7186. rbracket = /\[\]$/,
  7187. rCRLF = /\r?\n/g,
  7188. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7189. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7190. function buildParams( prefix, obj, traditional, add ) {
  7191. var name;
  7192. if ( Array.isArray( obj ) ) {
  7193. // Serialize array item.
  7194. jQuery.each( obj, function( i, v ) {
  7195. if ( traditional || rbracket.test( prefix ) ) {
  7196. // Treat each array item as a scalar.
  7197. add( prefix, v );
  7198. } else {
  7199. // Item is non-scalar (array or object), encode its numeric index.
  7200. buildParams(
  7201. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7202. v,
  7203. traditional,
  7204. add
  7205. );
  7206. }
  7207. } );
  7208. } else if ( !traditional && toType( obj ) === "object" ) {
  7209. // Serialize object item.
  7210. for ( name in obj ) {
  7211. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7212. }
  7213. } else {
  7214. // Serialize scalar item.
  7215. add( prefix, obj );
  7216. }
  7217. }
  7218. // Serialize an array of form elements or a set of
  7219. // key/values into a query string
  7220. jQuery.param = function( a, traditional ) {
  7221. var prefix,
  7222. s = [],
  7223. add = function( key, valueOrFunction ) {
  7224. // If value is a function, invoke it and use its return value
  7225. var value = isFunction( valueOrFunction ) ?
  7226. valueOrFunction() :
  7227. valueOrFunction;
  7228. s[ s.length ] = encodeURIComponent( key ) + "=" +
  7229. encodeURIComponent( value == null ? "" : value );
  7230. };
  7231. if ( a == null ) {
  7232. return "";
  7233. }
  7234. // If an array was passed in, assume that it is an array of form elements.
  7235. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7236. // Serialize the form elements
  7237. jQuery.each( a, function() {
  7238. add( this.name, this.value );
  7239. } );
  7240. } else {
  7241. // If traditional, encode the "old" way (the way 1.3.2 or older
  7242. // did it), otherwise encode params recursively.
  7243. for ( prefix in a ) {
  7244. buildParams( prefix, a[ prefix ], traditional, add );
  7245. }
  7246. }
  7247. // Return the resulting serialization
  7248. return s.join( "&" );
  7249. };
  7250. jQuery.fn.extend( {
  7251. serialize: function() {
  7252. return jQuery.param( this.serializeArray() );
  7253. },
  7254. serializeArray: function() {
  7255. return this.map( function() {
  7256. // Can add propHook for "elements" to filter or add form elements
  7257. var elements = jQuery.prop( this, "elements" );
  7258. return elements ? jQuery.makeArray( elements ) : this;
  7259. } ).filter( function() {
  7260. var type = this.type;
  7261. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7262. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7263. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7264. ( this.checked || !rcheckableType.test( type ) );
  7265. } ).map( function( _i, elem ) {
  7266. var val = jQuery( this ).val();
  7267. if ( val == null ) {
  7268. return null;
  7269. }
  7270. if ( Array.isArray( val ) ) {
  7271. return jQuery.map( val, function( val ) {
  7272. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7273. } );
  7274. }
  7275. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7276. } ).get();
  7277. }
  7278. } );
  7279. var
  7280. r20 = /%20/g,
  7281. rhash = /#.*$/,
  7282. rantiCache = /([?&])_=[^&]*/,
  7283. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7284. // trac-7653, trac-8125, trac-8152: local protocol detection
  7285. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7286. rnoContent = /^(?:GET|HEAD)$/,
  7287. rprotocol = /^\/\//,
  7288. /* Prefilters
  7289. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7290. * 2) These are called:
  7291. * - BEFORE asking for a transport
  7292. * - AFTER param serialization (s.data is a string if s.processData is true)
  7293. * 3) key is the dataType
  7294. * 4) the catchall symbol "*" can be used
  7295. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7296. */
  7297. prefilters = {},
  7298. /* Transports bindings
  7299. * 1) key is the dataType
  7300. * 2) the catchall symbol "*" can be used
  7301. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7302. */
  7303. transports = {},
  7304. // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
  7305. allTypes = "*/".concat( "*" ),
  7306. // Anchor tag for parsing the document origin
  7307. originAnchor = document.createElement( "a" );
  7308. originAnchor.href = location.href;
  7309. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7310. function addToPrefiltersOrTransports( structure ) {
  7311. // dataTypeExpression is optional and defaults to "*"
  7312. return function( dataTypeExpression, func ) {
  7313. if ( typeof dataTypeExpression !== "string" ) {
  7314. func = dataTypeExpression;
  7315. dataTypeExpression = "*";
  7316. }
  7317. var dataType,
  7318. i = 0,
  7319. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7320. if ( isFunction( func ) ) {
  7321. // For each dataType in the dataTypeExpression
  7322. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7323. // Prepend if requested
  7324. if ( dataType[ 0 ] === "+" ) {
  7325. dataType = dataType.slice( 1 ) || "*";
  7326. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7327. // Otherwise append
  7328. } else {
  7329. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7330. }
  7331. }
  7332. }
  7333. };
  7334. }
  7335. // Base inspection function for prefilters and transports
  7336. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7337. var inspected = {},
  7338. seekingTransport = ( structure === transports );
  7339. function inspect( dataType ) {
  7340. var selected;
  7341. inspected[ dataType ] = true;
  7342. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7343. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7344. if ( typeof dataTypeOrTransport === "string" &&
  7345. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7346. options.dataTypes.unshift( dataTypeOrTransport );
  7347. inspect( dataTypeOrTransport );
  7348. return false;
  7349. } else if ( seekingTransport ) {
  7350. return !( selected = dataTypeOrTransport );
  7351. }
  7352. } );
  7353. return selected;
  7354. }
  7355. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7356. }
  7357. // A special extend for ajax options
  7358. // that takes "flat" options (not to be deep extended)
  7359. // Fixes trac-9887
  7360. function ajaxExtend( target, src ) {
  7361. var key, deep,
  7362. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7363. for ( key in src ) {
  7364. if ( src[ key ] !== undefined ) {
  7365. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7366. }
  7367. }
  7368. if ( deep ) {
  7369. jQuery.extend( true, target, deep );
  7370. }
  7371. return target;
  7372. }
  7373. /* Handles responses to an ajax request:
  7374. * - finds the right dataType (mediates between content-type and expected dataType)
  7375. * - returns the corresponding response
  7376. */
  7377. function ajaxHandleResponses( s, jqXHR, responses ) {
  7378. var ct, type, finalDataType, firstDataType,
  7379. contents = s.contents,
  7380. dataTypes = s.dataTypes;
  7381. // Remove auto dataType and get content-type in the process
  7382. while ( dataTypes[ 0 ] === "*" ) {
  7383. dataTypes.shift();
  7384. if ( ct === undefined ) {
  7385. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7386. }
  7387. }
  7388. // Check if we're dealing with a known content-type
  7389. if ( ct ) {
  7390. for ( type in contents ) {
  7391. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7392. dataTypes.unshift( type );
  7393. break;
  7394. }
  7395. }
  7396. }
  7397. // Check to see if we have a response for the expected dataType
  7398. if ( dataTypes[ 0 ] in responses ) {
  7399. finalDataType = dataTypes[ 0 ];
  7400. } else {
  7401. // Try convertible dataTypes
  7402. for ( type in responses ) {
  7403. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7404. finalDataType = type;
  7405. break;
  7406. }
  7407. if ( !firstDataType ) {
  7408. firstDataType = type;
  7409. }
  7410. }
  7411. // Or just use first one
  7412. finalDataType = finalDataType || firstDataType;
  7413. }
  7414. // If we found a dataType
  7415. // We add the dataType to the list if needed
  7416. // and return the corresponding response
  7417. if ( finalDataType ) {
  7418. if ( finalDataType !== dataTypes[ 0 ] ) {
  7419. dataTypes.unshift( finalDataType );
  7420. }
  7421. return responses[ finalDataType ];
  7422. }
  7423. }
  7424. /* Chain conversions given the request and the original response
  7425. * Also sets the responseXXX fields on the jqXHR instance
  7426. */
  7427. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7428. var conv2, current, conv, tmp, prev,
  7429. converters = {},
  7430. // Work with a copy of dataTypes in case we need to modify it for conversion
  7431. dataTypes = s.dataTypes.slice();
  7432. // Create converters map with lowercased keys
  7433. if ( dataTypes[ 1 ] ) {
  7434. for ( conv in s.converters ) {
  7435. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7436. }
  7437. }
  7438. current = dataTypes.shift();
  7439. // Convert to each sequential dataType
  7440. while ( current ) {
  7441. if ( s.responseFields[ current ] ) {
  7442. jqXHR[ s.responseFields[ current ] ] = response;
  7443. }
  7444. // Apply the dataFilter if provided
  7445. if ( !prev && isSuccess && s.dataFilter ) {
  7446. response = s.dataFilter( response, s.dataType );
  7447. }
  7448. prev = current;
  7449. current = dataTypes.shift();
  7450. if ( current ) {
  7451. // There's only work to do if current dataType is non-auto
  7452. if ( current === "*" ) {
  7453. current = prev;
  7454. // Convert response if prev dataType is non-auto and differs from current
  7455. } else if ( prev !== "*" && prev !== current ) {
  7456. // Seek a direct converter
  7457. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7458. // If none found, seek a pair
  7459. if ( !conv ) {
  7460. for ( conv2 in converters ) {
  7461. // If conv2 outputs current
  7462. tmp = conv2.split( " " );
  7463. if ( tmp[ 1 ] === current ) {
  7464. // If prev can be converted to accepted input
  7465. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7466. converters[ "* " + tmp[ 0 ] ];
  7467. if ( conv ) {
  7468. // Condense equivalence converters
  7469. if ( conv === true ) {
  7470. conv = converters[ conv2 ];
  7471. // Otherwise, insert the intermediate dataType
  7472. } else if ( converters[ conv2 ] !== true ) {
  7473. current = tmp[ 0 ];
  7474. dataTypes.unshift( tmp[ 1 ] );
  7475. }
  7476. break;
  7477. }
  7478. }
  7479. }
  7480. }
  7481. // Apply converter (if not an equivalence)
  7482. if ( conv !== true ) {
  7483. // Unless errors are allowed to bubble, catch and return them
  7484. if ( conv && s.throws ) {
  7485. response = conv( response );
  7486. } else {
  7487. try {
  7488. response = conv( response );
  7489. } catch ( e ) {
  7490. return {
  7491. state: "parsererror",
  7492. error: conv ? e : "No conversion from " + prev + " to " + current
  7493. };
  7494. }
  7495. }
  7496. }
  7497. }
  7498. }
  7499. }
  7500. return { state: "success", data: response };
  7501. }
  7502. jQuery.extend( {
  7503. // Counter for holding the number of active queries
  7504. active: 0,
  7505. // Last-Modified header cache for next request
  7506. lastModified: {},
  7507. etag: {},
  7508. ajaxSettings: {
  7509. url: location.href,
  7510. type: "GET",
  7511. isLocal: rlocalProtocol.test( location.protocol ),
  7512. global: true,
  7513. processData: true,
  7514. async: true,
  7515. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7516. /*
  7517. timeout: 0,
  7518. data: null,
  7519. dataType: null,
  7520. username: null,
  7521. password: null,
  7522. cache: null,
  7523. throws: false,
  7524. traditional: false,
  7525. headers: {},
  7526. */
  7527. accepts: {
  7528. "*": allTypes,
  7529. text: "text/plain",
  7530. html: "text/html",
  7531. xml: "application/xml, text/xml",
  7532. json: "application/json, text/javascript"
  7533. },
  7534. contents: {
  7535. xml: /\bxml\b/,
  7536. html: /\bhtml/,
  7537. json: /\bjson\b/
  7538. },
  7539. responseFields: {
  7540. xml: "responseXML",
  7541. text: "responseText",
  7542. json: "responseJSON"
  7543. },
  7544. // Data converters
  7545. // Keys separate source (or catchall "*") and destination types with a single space
  7546. converters: {
  7547. // Convert anything to text
  7548. "* text": String,
  7549. // Text to html (true = no transformation)
  7550. "text html": true,
  7551. // Evaluate text as a json expression
  7552. "text json": JSON.parse,
  7553. // Parse text as xml
  7554. "text xml": jQuery.parseXML
  7555. },
  7556. // For options that shouldn't be deep extended:
  7557. // you can add your own custom options here if
  7558. // and when you create one that shouldn't be
  7559. // deep extended (see ajaxExtend)
  7560. flatOptions: {
  7561. url: true,
  7562. context: true
  7563. }
  7564. },
  7565. // Creates a full fledged settings object into target
  7566. // with both ajaxSettings and settings fields.
  7567. // If target is omitted, writes into ajaxSettings.
  7568. ajaxSetup: function( target, settings ) {
  7569. return settings ?
  7570. // Building a settings object
  7571. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7572. // Extending ajaxSettings
  7573. ajaxExtend( jQuery.ajaxSettings, target );
  7574. },
  7575. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7576. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7577. // Main method
  7578. ajax: function( url, options ) {
  7579. // If url is an object, simulate pre-1.5 signature
  7580. if ( typeof url === "object" ) {
  7581. options = url;
  7582. url = undefined;
  7583. }
  7584. // Force options to be an object
  7585. options = options || {};
  7586. var transport,
  7587. // URL without anti-cache param
  7588. cacheURL,
  7589. // Response headers
  7590. responseHeadersString,
  7591. responseHeaders,
  7592. // timeout handle
  7593. timeoutTimer,
  7594. // Url cleanup var
  7595. urlAnchor,
  7596. // Request state (becomes false upon send and true upon completion)
  7597. completed,
  7598. // To know if global events are to be dispatched
  7599. fireGlobals,
  7600. // Loop variable
  7601. i,
  7602. // uncached part of the url
  7603. uncached,
  7604. // Create the final options object
  7605. s = jQuery.ajaxSetup( {}, options ),
  7606. // Callbacks context
  7607. callbackContext = s.context || s,
  7608. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7609. globalEventContext = s.context &&
  7610. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7611. jQuery( callbackContext ) :
  7612. jQuery.event,
  7613. // Deferreds
  7614. deferred = jQuery.Deferred(),
  7615. completeDeferred = jQuery.Callbacks( "once memory" ),
  7616. // Status-dependent callbacks
  7617. statusCode = s.statusCode || {},
  7618. // Headers (they are sent all at once)
  7619. requestHeaders = {},
  7620. requestHeadersNames = {},
  7621. // Default abort message
  7622. strAbort = "canceled",
  7623. // Fake xhr
  7624. jqXHR = {
  7625. readyState: 0,
  7626. // Builds headers hashtable if needed
  7627. getResponseHeader: function( key ) {
  7628. var match;
  7629. if ( completed ) {
  7630. if ( !responseHeaders ) {
  7631. responseHeaders = {};
  7632. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7633. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  7634. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  7635. .concat( match[ 2 ] );
  7636. }
  7637. }
  7638. match = responseHeaders[ key.toLowerCase() + " " ];
  7639. }
  7640. return match == null ? null : match.join( ", " );
  7641. },
  7642. // Raw string
  7643. getAllResponseHeaders: function() {
  7644. return completed ? responseHeadersString : null;
  7645. },
  7646. // Caches the header
  7647. setRequestHeader: function( name, value ) {
  7648. if ( completed == null ) {
  7649. name = requestHeadersNames[ name.toLowerCase() ] =
  7650. requestHeadersNames[ name.toLowerCase() ] || name;
  7651. requestHeaders[ name ] = value;
  7652. }
  7653. return this;
  7654. },
  7655. // Overrides response content-type header
  7656. overrideMimeType: function( type ) {
  7657. if ( completed == null ) {
  7658. s.mimeType = type;
  7659. }
  7660. return this;
  7661. },
  7662. // Status-dependent callbacks
  7663. statusCode: function( map ) {
  7664. var code;
  7665. if ( map ) {
  7666. if ( completed ) {
  7667. // Execute the appropriate callbacks
  7668. jqXHR.always( map[ jqXHR.status ] );
  7669. } else {
  7670. // Lazy-add the new callbacks in a way that preserves old ones
  7671. for ( code in map ) {
  7672. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7673. }
  7674. }
  7675. }
  7676. return this;
  7677. },
  7678. // Cancel the request
  7679. abort: function( statusText ) {
  7680. var finalText = statusText || strAbort;
  7681. if ( transport ) {
  7682. transport.abort( finalText );
  7683. }
  7684. done( 0, finalText );
  7685. return this;
  7686. }
  7687. };
  7688. // Attach deferreds
  7689. deferred.promise( jqXHR );
  7690. // Add protocol if not provided (prefilters might expect it)
  7691. // Handle falsy url in the settings object (trac-10093: consistency with old signature)
  7692. // We also use the url parameter if available
  7693. s.url = ( ( url || s.url || location.href ) + "" )
  7694. .replace( rprotocol, location.protocol + "//" );
  7695. // Alias method option to type as per ticket trac-12004
  7696. s.type = options.method || options.type || s.method || s.type;
  7697. // Extract dataTypes list
  7698. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7699. // A cross-domain request is in order when the origin doesn't match the current origin.
  7700. if ( s.crossDomain == null ) {
  7701. urlAnchor = document.createElement( "a" );
  7702. // Support: IE <=8 - 11, Edge 12 - 15
  7703. // IE throws exception on accessing the href property if url is malformed,
  7704. // e.g. http://example.com:80x/
  7705. try {
  7706. urlAnchor.href = s.url;
  7707. // Support: IE <=8 - 11 only
  7708. // Anchor's host property isn't correctly set when s.url is relative
  7709. urlAnchor.href = urlAnchor.href;
  7710. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7711. urlAnchor.protocol + "//" + urlAnchor.host;
  7712. } catch ( e ) {
  7713. // If there is an error parsing the URL, assume it is crossDomain,
  7714. // it can be rejected by the transport if it is invalid
  7715. s.crossDomain = true;
  7716. }
  7717. }
  7718. // Convert data if not already a string
  7719. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7720. s.data = jQuery.param( s.data, s.traditional );
  7721. }
  7722. // Apply prefilters
  7723. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7724. // If request was aborted inside a prefilter, stop there
  7725. if ( completed ) {
  7726. return jqXHR;
  7727. }
  7728. // We can fire global events as of now if asked to
  7729. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
  7730. fireGlobals = jQuery.event && s.global;
  7731. // Watch for a new set of requests
  7732. if ( fireGlobals && jQuery.active++ === 0 ) {
  7733. jQuery.event.trigger( "ajaxStart" );
  7734. }
  7735. // Uppercase the type
  7736. s.type = s.type.toUpperCase();
  7737. // Determine if request has content
  7738. s.hasContent = !rnoContent.test( s.type );
  7739. // Save the URL in case we're toying with the If-Modified-Since
  7740. // and/or If-None-Match header later on
  7741. // Remove hash to simplify url manipulation
  7742. cacheURL = s.url.replace( rhash, "" );
  7743. // More options handling for requests with no content
  7744. if ( !s.hasContent ) {
  7745. // Remember the hash so we can put it back
  7746. uncached = s.url.slice( cacheURL.length );
  7747. // If data is available and should be processed, append data to url
  7748. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  7749. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7750. // trac-9682: remove data so that it's not used in an eventual retry
  7751. delete s.data;
  7752. }
  7753. // Add or update anti-cache param if needed
  7754. if ( s.cache === false ) {
  7755. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7756. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  7757. uncached;
  7758. }
  7759. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7760. s.url = cacheURL + uncached;
  7761. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7762. } else if ( s.data && s.processData &&
  7763. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7764. s.data = s.data.replace( r20, "+" );
  7765. }
  7766. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7767. if ( s.ifModified ) {
  7768. if ( jQuery.lastModified[ cacheURL ] ) {
  7769. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7770. }
  7771. if ( jQuery.etag[ cacheURL ] ) {
  7772. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7773. }
  7774. }
  7775. // Set the correct header, if data is being sent
  7776. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7777. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7778. }
  7779. // Set the Accepts header for the server, depending on the dataType
  7780. jqXHR.setRequestHeader(
  7781. "Accept",
  7782. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7783. s.accepts[ s.dataTypes[ 0 ] ] +
  7784. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7785. s.accepts[ "*" ]
  7786. );
  7787. // Check for headers option
  7788. for ( i in s.headers ) {
  7789. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7790. }
  7791. // Allow custom headers/mimetypes and early abort
  7792. if ( s.beforeSend &&
  7793. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7794. // Abort if not done already and return
  7795. return jqXHR.abort();
  7796. }
  7797. // Aborting is no longer a cancellation
  7798. strAbort = "abort";
  7799. // Install callbacks on deferreds
  7800. completeDeferred.add( s.complete );
  7801. jqXHR.done( s.success );
  7802. jqXHR.fail( s.error );
  7803. // Get transport
  7804. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7805. // If no transport, we auto-abort
  7806. if ( !transport ) {
  7807. done( -1, "No Transport" );
  7808. } else {
  7809. jqXHR.readyState = 1;
  7810. // Send global event
  7811. if ( fireGlobals ) {
  7812. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7813. }
  7814. // If request was aborted inside ajaxSend, stop there
  7815. if ( completed ) {
  7816. return jqXHR;
  7817. }
  7818. // Timeout
  7819. if ( s.async && s.timeout > 0 ) {
  7820. timeoutTimer = window.setTimeout( function() {
  7821. jqXHR.abort( "timeout" );
  7822. }, s.timeout );
  7823. }
  7824. try {
  7825. completed = false;
  7826. transport.send( requestHeaders, done );
  7827. } catch ( e ) {
  7828. // Rethrow post-completion exceptions
  7829. if ( completed ) {
  7830. throw e;
  7831. }
  7832. // Propagate others as results
  7833. done( -1, e );
  7834. }
  7835. }
  7836. // Callback for when everything is done
  7837. function done( status, nativeStatusText, responses, headers ) {
  7838. var isSuccess, success, error, response, modified,
  7839. statusText = nativeStatusText;
  7840. // Ignore repeat invocations
  7841. if ( completed ) {
  7842. return;
  7843. }
  7844. completed = true;
  7845. // Clear timeout if it exists
  7846. if ( timeoutTimer ) {
  7847. window.clearTimeout( timeoutTimer );
  7848. }
  7849. // Dereference transport for early garbage collection
  7850. // (no matter how long the jqXHR object will be used)
  7851. transport = undefined;
  7852. // Cache response headers
  7853. responseHeadersString = headers || "";
  7854. // Set readyState
  7855. jqXHR.readyState = status > 0 ? 4 : 0;
  7856. // Determine if successful
  7857. isSuccess = status >= 200 && status < 300 || status === 304;
  7858. // Get response data
  7859. if ( responses ) {
  7860. response = ajaxHandleResponses( s, jqXHR, responses );
  7861. }
  7862. // Use a noop converter for missing script but not if jsonp
  7863. if ( !isSuccess &&
  7864. jQuery.inArray( "script", s.dataTypes ) > -1 &&
  7865. jQuery.inArray( "json", s.dataTypes ) < 0 ) {
  7866. s.converters[ "text script" ] = function() {};
  7867. }
  7868. // Convert no matter what (that way responseXXX fields are always set)
  7869. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7870. // If successful, handle type chaining
  7871. if ( isSuccess ) {
  7872. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7873. if ( s.ifModified ) {
  7874. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7875. if ( modified ) {
  7876. jQuery.lastModified[ cacheURL ] = modified;
  7877. }
  7878. modified = jqXHR.getResponseHeader( "etag" );
  7879. if ( modified ) {
  7880. jQuery.etag[ cacheURL ] = modified;
  7881. }
  7882. }
  7883. // if no content
  7884. if ( status === 204 || s.type === "HEAD" ) {
  7885. statusText = "nocontent";
  7886. // if not modified
  7887. } else if ( status === 304 ) {
  7888. statusText = "notmodified";
  7889. // If we have data, let's convert it
  7890. } else {
  7891. statusText = response.state;
  7892. success = response.data;
  7893. error = response.error;
  7894. isSuccess = !error;
  7895. }
  7896. } else {
  7897. // Extract error from statusText and normalize for non-aborts
  7898. error = statusText;
  7899. if ( status || !statusText ) {
  7900. statusText = "error";
  7901. if ( status < 0 ) {
  7902. status = 0;
  7903. }
  7904. }
  7905. }
  7906. // Set data for the fake xhr object
  7907. jqXHR.status = status;
  7908. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7909. // Success/Error
  7910. if ( isSuccess ) {
  7911. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7912. } else {
  7913. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7914. }
  7915. // Status-dependent callbacks
  7916. jqXHR.statusCode( statusCode );
  7917. statusCode = undefined;
  7918. if ( fireGlobals ) {
  7919. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7920. [ jqXHR, s, isSuccess ? success : error ] );
  7921. }
  7922. // Complete
  7923. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7924. if ( fireGlobals ) {
  7925. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7926. // Handle the global AJAX counter
  7927. if ( !( --jQuery.active ) ) {
  7928. jQuery.event.trigger( "ajaxStop" );
  7929. }
  7930. }
  7931. }
  7932. return jqXHR;
  7933. },
  7934. getJSON: function( url, data, callback ) {
  7935. return jQuery.get( url, data, callback, "json" );
  7936. },
  7937. getScript: function( url, callback ) {
  7938. return jQuery.get( url, undefined, callback, "script" );
  7939. }
  7940. } );
  7941. jQuery.each( [ "get", "post" ], function( _i, method ) {
  7942. jQuery[ method ] = function( url, data, callback, type ) {
  7943. // Shift arguments if data argument was omitted
  7944. if ( isFunction( data ) ) {
  7945. type = type || callback;
  7946. callback = data;
  7947. data = undefined;
  7948. }
  7949. // The url can be an options object (which then must have .url)
  7950. return jQuery.ajax( jQuery.extend( {
  7951. url: url,
  7952. type: method,
  7953. dataType: type,
  7954. data: data,
  7955. success: callback
  7956. }, jQuery.isPlainObject( url ) && url ) );
  7957. };
  7958. } );
  7959. jQuery.ajaxPrefilter( function( s ) {
  7960. var i;
  7961. for ( i in s.headers ) {
  7962. if ( i.toLowerCase() === "content-type" ) {
  7963. s.contentType = s.headers[ i ] || "";
  7964. }
  7965. }
  7966. } );
  7967. jQuery._evalUrl = function( url, options, doc ) {
  7968. return jQuery.ajax( {
  7969. url: url,
  7970. // Make this explicit, since user can override this through ajaxSetup (trac-11264)
  7971. type: "GET",
  7972. dataType: "script",
  7973. cache: true,
  7974. async: false,
  7975. global: false,
  7976. // Only evaluate the response if it is successful (gh-4126)
  7977. // dataFilter is not invoked for failure responses, so using it instead
  7978. // of the default converter is kludgy but it works.
  7979. converters: {
  7980. "text script": function() {}
  7981. },
  7982. dataFilter: function( response ) {
  7983. jQuery.globalEval( response, options, doc );
  7984. }
  7985. } );
  7986. };
  7987. jQuery.fn.extend( {
  7988. wrapAll: function( html ) {
  7989. var wrap;
  7990. if ( this[ 0 ] ) {
  7991. if ( isFunction( html ) ) {
  7992. html = html.call( this[ 0 ] );
  7993. }
  7994. // The elements to wrap the target around
  7995. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7996. if ( this[ 0 ].parentNode ) {
  7997. wrap.insertBefore( this[ 0 ] );
  7998. }
  7999. wrap.map( function() {
  8000. var elem = this;
  8001. while ( elem.firstElementChild ) {
  8002. elem = elem.firstElementChild;
  8003. }
  8004. return elem;
  8005. } ).append( this );
  8006. }
  8007. return this;
  8008. },
  8009. wrapInner: function( html ) {
  8010. if ( isFunction( html ) ) {
  8011. return this.each( function( i ) {
  8012. jQuery( this ).wrapInner( html.call( this, i ) );
  8013. } );
  8014. }
  8015. return this.each( function() {
  8016. var self = jQuery( this ),
  8017. contents = self.contents();
  8018. if ( contents.length ) {
  8019. contents.wrapAll( html );
  8020. } else {
  8021. self.append( html );
  8022. }
  8023. } );
  8024. },
  8025. wrap: function( html ) {
  8026. var htmlIsFunction = isFunction( html );
  8027. return this.each( function( i ) {
  8028. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  8029. } );
  8030. },
  8031. unwrap: function( selector ) {
  8032. this.parent( selector ).not( "body" ).each( function() {
  8033. jQuery( this ).replaceWith( this.childNodes );
  8034. } );
  8035. return this;
  8036. }
  8037. } );
  8038. jQuery.expr.pseudos.hidden = function( elem ) {
  8039. return !jQuery.expr.pseudos.visible( elem );
  8040. };
  8041. jQuery.expr.pseudos.visible = function( elem ) {
  8042. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  8043. };
  8044. jQuery.ajaxSettings.xhr = function() {
  8045. try {
  8046. return new window.XMLHttpRequest();
  8047. } catch ( e ) {}
  8048. };
  8049. var xhrSuccessStatus = {
  8050. // File protocol always yields status code 0, assume 200
  8051. 0: 200,
  8052. // Support: IE <=9 only
  8053. // trac-1450: sometimes IE returns 1223 when it should be 204
  8054. 1223: 204
  8055. },
  8056. xhrSupported = jQuery.ajaxSettings.xhr();
  8057. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  8058. support.ajax = xhrSupported = !!xhrSupported;
  8059. jQuery.ajaxTransport( function( options ) {
  8060. var callback, errorCallback;
  8061. // Cross domain only allowed if supported through XMLHttpRequest
  8062. if ( support.cors || xhrSupported && !options.crossDomain ) {
  8063. return {
  8064. send: function( headers, complete ) {
  8065. var i,
  8066. xhr = options.xhr();
  8067. xhr.open(
  8068. options.type,
  8069. options.url,
  8070. options.async,
  8071. options.username,
  8072. options.password
  8073. );
  8074. // Apply custom fields if provided
  8075. if ( options.xhrFields ) {
  8076. for ( i in options.xhrFields ) {
  8077. xhr[ i ] = options.xhrFields[ i ];
  8078. }
  8079. }
  8080. // Override mime type if needed
  8081. if ( options.mimeType && xhr.overrideMimeType ) {
  8082. xhr.overrideMimeType( options.mimeType );
  8083. }
  8084. // X-Requested-With header
  8085. // For cross-domain requests, seeing as conditions for a preflight are
  8086. // akin to a jigsaw puzzle, we simply never set it to be sure.
  8087. // (it can always be set on a per-request basis or even using ajaxSetup)
  8088. // For same-domain requests, won't change header if already provided.
  8089. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  8090. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  8091. }
  8092. // Set headers
  8093. for ( i in headers ) {
  8094. xhr.setRequestHeader( i, headers[ i ] );
  8095. }
  8096. // Callback
  8097. callback = function( type ) {
  8098. return function() {
  8099. if ( callback ) {
  8100. callback = errorCallback = xhr.onload =
  8101. xhr.onerror = xhr.onabort = xhr.ontimeout =
  8102. xhr.onreadystatechange = null;
  8103. if ( type === "abort" ) {
  8104. xhr.abort();
  8105. } else if ( type === "error" ) {
  8106. // Support: IE <=9 only
  8107. // On a manual native abort, IE9 throws
  8108. // errors on any property access that is not readyState
  8109. if ( typeof xhr.status !== "number" ) {
  8110. complete( 0, "error" );
  8111. } else {
  8112. complete(
  8113. // File: protocol always yields status 0; see trac-8605, trac-14207
  8114. xhr.status,
  8115. xhr.statusText
  8116. );
  8117. }
  8118. } else {
  8119. complete(
  8120. xhrSuccessStatus[ xhr.status ] || xhr.status,
  8121. xhr.statusText,
  8122. // Support: IE <=9 only
  8123. // IE9 has no XHR2 but throws on binary (trac-11426)
  8124. // For XHR2 non-text, let the caller handle it (gh-2498)
  8125. ( xhr.responseType || "text" ) !== "text" ||
  8126. typeof xhr.responseText !== "string" ?
  8127. { binary: xhr.response } :
  8128. { text: xhr.responseText },
  8129. xhr.getAllResponseHeaders()
  8130. );
  8131. }
  8132. }
  8133. };
  8134. };
  8135. // Listen to events
  8136. xhr.onload = callback();
  8137. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  8138. // Support: IE 9 only
  8139. // Use onreadystatechange to replace onabort
  8140. // to handle uncaught aborts
  8141. if ( xhr.onabort !== undefined ) {
  8142. xhr.onabort = errorCallback;
  8143. } else {
  8144. xhr.onreadystatechange = function() {
  8145. // Check readyState before timeout as it changes
  8146. if ( xhr.readyState === 4 ) {
  8147. // Allow onerror to be called first,
  8148. // but that will not handle a native abort
  8149. // Also, save errorCallback to a variable
  8150. // as xhr.onerror cannot be accessed
  8151. window.setTimeout( function() {
  8152. if ( callback ) {
  8153. errorCallback();
  8154. }
  8155. } );
  8156. }
  8157. };
  8158. }
  8159. // Create the abort callback
  8160. callback = callback( "abort" );
  8161. try {
  8162. // Do send the request (this may raise an exception)
  8163. xhr.send( options.hasContent && options.data || null );
  8164. } catch ( e ) {
  8165. // trac-14683: Only rethrow if this hasn't been notified as an error yet
  8166. if ( callback ) {
  8167. throw e;
  8168. }
  8169. }
  8170. },
  8171. abort: function() {
  8172. if ( callback ) {
  8173. callback();
  8174. }
  8175. }
  8176. };
  8177. }
  8178. } );
  8179. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  8180. jQuery.ajaxPrefilter( function( s ) {
  8181. if ( s.crossDomain ) {
  8182. s.contents.script = false;
  8183. }
  8184. } );
  8185. // Install script dataType
  8186. jQuery.ajaxSetup( {
  8187. accepts: {
  8188. script: "text/javascript, application/javascript, " +
  8189. "application/ecmascript, application/x-ecmascript"
  8190. },
  8191. contents: {
  8192. script: /\b(?:java|ecma)script\b/
  8193. },
  8194. converters: {
  8195. "text script": function( text ) {
  8196. jQuery.globalEval( text );
  8197. return text;
  8198. }
  8199. }
  8200. } );
  8201. // Handle cache's special case and crossDomain
  8202. jQuery.ajaxPrefilter( "script", function( s ) {
  8203. if ( s.cache === undefined ) {
  8204. s.cache = false;
  8205. }
  8206. if ( s.crossDomain ) {
  8207. s.type = "GET";
  8208. }
  8209. } );
  8210. // Bind script tag hack transport
  8211. jQuery.ajaxTransport( "script", function( s ) {
  8212. // This transport only deals with cross domain or forced-by-attrs requests
  8213. if ( s.crossDomain || s.scriptAttrs ) {
  8214. var script, callback;
  8215. return {
  8216. send: function( _, complete ) {
  8217. script = jQuery( "<script>" )
  8218. .attr( s.scriptAttrs || {} )
  8219. .prop( { charset: s.scriptCharset, src: s.url } )
  8220. .on( "load error", callback = function( evt ) {
  8221. script.remove();
  8222. callback = null;
  8223. if ( evt ) {
  8224. complete( evt.type === "error" ? 404 : 200, evt.type );
  8225. }
  8226. } );
  8227. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8228. document.head.appendChild( script[ 0 ] );
  8229. },
  8230. abort: function() {
  8231. if ( callback ) {
  8232. callback();
  8233. }
  8234. }
  8235. };
  8236. }
  8237. } );
  8238. var oldCallbacks = [],
  8239. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8240. // Default jsonp settings
  8241. jQuery.ajaxSetup( {
  8242. jsonp: "callback",
  8243. jsonpCallback: function() {
  8244. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  8245. this[ callback ] = true;
  8246. return callback;
  8247. }
  8248. } );
  8249. // Detect, normalize options and install callbacks for jsonp requests
  8250. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8251. var callbackName, overwritten, responseContainer,
  8252. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8253. "url" :
  8254. typeof s.data === "string" &&
  8255. ( s.contentType || "" )
  8256. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  8257. rjsonp.test( s.data ) && "data"
  8258. );
  8259. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8260. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8261. // Get callback name, remembering preexisting value associated with it
  8262. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  8263. s.jsonpCallback() :
  8264. s.jsonpCallback;
  8265. // Insert callback into url or form data
  8266. if ( jsonProp ) {
  8267. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8268. } else if ( s.jsonp !== false ) {
  8269. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8270. }
  8271. // Use data converter to retrieve json after script execution
  8272. s.converters[ "script json" ] = function() {
  8273. if ( !responseContainer ) {
  8274. jQuery.error( callbackName + " was not called" );
  8275. }
  8276. return responseContainer[ 0 ];
  8277. };
  8278. // Force json dataType
  8279. s.dataTypes[ 0 ] = "json";
  8280. // Install callback
  8281. overwritten = window[ callbackName ];
  8282. window[ callbackName ] = function() {
  8283. responseContainer = arguments;
  8284. };
  8285. // Clean-up function (fires after converters)
  8286. jqXHR.always( function() {
  8287. // If previous value didn't exist - remove it
  8288. if ( overwritten === undefined ) {
  8289. jQuery( window ).removeProp( callbackName );
  8290. // Otherwise restore preexisting value
  8291. } else {
  8292. window[ callbackName ] = overwritten;
  8293. }
  8294. // Save back as free
  8295. if ( s[ callbackName ] ) {
  8296. // Make sure that re-using the options doesn't screw things around
  8297. s.jsonpCallback = originalSettings.jsonpCallback;
  8298. // Save the callback name for future use
  8299. oldCallbacks.push( callbackName );
  8300. }
  8301. // Call if it was a function and we have a response
  8302. if ( responseContainer && isFunction( overwritten ) ) {
  8303. overwritten( responseContainer[ 0 ] );
  8304. }
  8305. responseContainer = overwritten = undefined;
  8306. } );
  8307. // Delegate to script
  8308. return "script";
  8309. }
  8310. } );
  8311. // Support: Safari 8 only
  8312. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8313. // collapse sibling forms: the second one becomes a child of the first one.
  8314. // Because of that, this security measure has to be disabled in Safari 8.
  8315. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8316. support.createHTMLDocument = ( function() {
  8317. var body = document.implementation.createHTMLDocument( "" ).body;
  8318. body.innerHTML = "<form></form><form></form>";
  8319. return body.childNodes.length === 2;
  8320. } )();
  8321. // Argument "data" should be string of html
  8322. // context (optional): If specified, the fragment will be created in this context,
  8323. // defaults to document
  8324. // keepScripts (optional): If true, will include scripts passed in the html string
  8325. jQuery.parseHTML = function( data, context, keepScripts ) {
  8326. if ( typeof data !== "string" ) {
  8327. return [];
  8328. }
  8329. if ( typeof context === "boolean" ) {
  8330. keepScripts = context;
  8331. context = false;
  8332. }
  8333. var base, parsed, scripts;
  8334. if ( !context ) {
  8335. // Stop scripts or inline event handlers from being executed immediately
  8336. // by using document.implementation
  8337. if ( support.createHTMLDocument ) {
  8338. context = document.implementation.createHTMLDocument( "" );
  8339. // Set the base href for the created document
  8340. // so any parsed elements with URLs
  8341. // are based on the document's URL (gh-2965)
  8342. base = context.createElement( "base" );
  8343. base.href = document.location.href;
  8344. context.head.appendChild( base );
  8345. } else {
  8346. context = document;
  8347. }
  8348. }
  8349. parsed = rsingleTag.exec( data );
  8350. scripts = !keepScripts && [];
  8351. // Single tag
  8352. if ( parsed ) {
  8353. return [ context.createElement( parsed[ 1 ] ) ];
  8354. }
  8355. parsed = buildFragment( [ data ], context, scripts );
  8356. if ( scripts && scripts.length ) {
  8357. jQuery( scripts ).remove();
  8358. }
  8359. return jQuery.merge( [], parsed.childNodes );
  8360. };
  8361. /**
  8362. * Load a url into a page
  8363. */
  8364. jQuery.fn.load = function( url, params, callback ) {
  8365. var selector, type, response,
  8366. self = this,
  8367. off = url.indexOf( " " );
  8368. if ( off > -1 ) {
  8369. selector = stripAndCollapse( url.slice( off ) );
  8370. url = url.slice( 0, off );
  8371. }
  8372. // If it's a function
  8373. if ( isFunction( params ) ) {
  8374. // We assume that it's the callback
  8375. callback = params;
  8376. params = undefined;
  8377. // Otherwise, build a param string
  8378. } else if ( params && typeof params === "object" ) {
  8379. type = "POST";
  8380. }
  8381. // If we have elements to modify, make the request
  8382. if ( self.length > 0 ) {
  8383. jQuery.ajax( {
  8384. url: url,
  8385. // If "type" variable is undefined, then "GET" method will be used.
  8386. // Make value of this field explicit since
  8387. // user can override it through ajaxSetup method
  8388. type: type || "GET",
  8389. dataType: "html",
  8390. data: params
  8391. } ).done( function( responseText ) {
  8392. // Save response for use in complete callback
  8393. response = arguments;
  8394. self.html( selector ?
  8395. // If a selector was specified, locate the right elements in a dummy div
  8396. // Exclude scripts to avoid IE 'Permission Denied' errors
  8397. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8398. // Otherwise use the full result
  8399. responseText );
  8400. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8401. // but they are ignored because response was set above.
  8402. // If it fails, this function gets "jqXHR", "status", "error"
  8403. } ).always( callback && function( jqXHR, status ) {
  8404. self.each( function() {
  8405. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8406. } );
  8407. } );
  8408. }
  8409. return this;
  8410. };
  8411. jQuery.expr.pseudos.animated = function( elem ) {
  8412. return jQuery.grep( jQuery.timers, function( fn ) {
  8413. return elem === fn.elem;
  8414. } ).length;
  8415. };
  8416. jQuery.offset = {
  8417. setOffset: function( elem, options, i ) {
  8418. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8419. position = jQuery.css( elem, "position" ),
  8420. curElem = jQuery( elem ),
  8421. props = {};
  8422. // Set position first, in-case top/left are set even on static elem
  8423. if ( position === "static" ) {
  8424. elem.style.position = "relative";
  8425. }
  8426. curOffset = curElem.offset();
  8427. curCSSTop = jQuery.css( elem, "top" );
  8428. curCSSLeft = jQuery.css( elem, "left" );
  8429. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8430. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8431. // Need to be able to calculate position if either
  8432. // top or left is auto and position is either absolute or fixed
  8433. if ( calculatePosition ) {
  8434. curPosition = curElem.position();
  8435. curTop = curPosition.top;
  8436. curLeft = curPosition.left;
  8437. } else {
  8438. curTop = parseFloat( curCSSTop ) || 0;
  8439. curLeft = parseFloat( curCSSLeft ) || 0;
  8440. }
  8441. if ( isFunction( options ) ) {
  8442. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8443. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8444. }
  8445. if ( options.top != null ) {
  8446. props.top = ( options.top - curOffset.top ) + curTop;
  8447. }
  8448. if ( options.left != null ) {
  8449. props.left = ( options.left - curOffset.left ) + curLeft;
  8450. }
  8451. if ( "using" in options ) {
  8452. options.using.call( elem, props );
  8453. } else {
  8454. curElem.css( props );
  8455. }
  8456. }
  8457. };
  8458. jQuery.fn.extend( {
  8459. // offset() relates an element's border box to the document origin
  8460. offset: function( options ) {
  8461. // Preserve chaining for setter
  8462. if ( arguments.length ) {
  8463. return options === undefined ?
  8464. this :
  8465. this.each( function( i ) {
  8466. jQuery.offset.setOffset( this, options, i );
  8467. } );
  8468. }
  8469. var rect, win,
  8470. elem = this[ 0 ];
  8471. if ( !elem ) {
  8472. return;
  8473. }
  8474. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8475. // Support: IE <=11 only
  8476. // Running getBoundingClientRect on a
  8477. // disconnected node in IE throws an error
  8478. if ( !elem.getClientRects().length ) {
  8479. return { top: 0, left: 0 };
  8480. }
  8481. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8482. rect = elem.getBoundingClientRect();
  8483. win = elem.ownerDocument.defaultView;
  8484. return {
  8485. top: rect.top + win.pageYOffset,
  8486. left: rect.left + win.pageXOffset
  8487. };
  8488. },
  8489. // position() relates an element's margin box to its offset parent's padding box
  8490. // This corresponds to the behavior of CSS absolute positioning
  8491. position: function() {
  8492. if ( !this[ 0 ] ) {
  8493. return;
  8494. }
  8495. var offsetParent, offset, doc,
  8496. elem = this[ 0 ],
  8497. parentOffset = { top: 0, left: 0 };
  8498. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8499. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8500. // Assume position:fixed implies availability of getBoundingClientRect
  8501. offset = elem.getBoundingClientRect();
  8502. } else {
  8503. offset = this.offset();
  8504. // Account for the *real* offset parent, which can be the document or its root element
  8505. // when a statically positioned element is identified
  8506. doc = elem.ownerDocument;
  8507. offsetParent = elem.offsetParent || doc.documentElement;
  8508. while ( offsetParent &&
  8509. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8510. jQuery.css( offsetParent, "position" ) === "static" ) {
  8511. offsetParent = offsetParent.parentNode;
  8512. }
  8513. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8514. // Incorporate borders into its offset, since they are outside its content origin
  8515. parentOffset = jQuery( offsetParent ).offset();
  8516. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8517. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8518. }
  8519. }
  8520. // Subtract parent offsets and element margins
  8521. return {
  8522. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8523. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8524. };
  8525. },
  8526. // This method will return documentElement in the following cases:
  8527. // 1) For the element inside the iframe without offsetParent, this method will return
  8528. // documentElement of the parent window
  8529. // 2) For the hidden or detached element
  8530. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8531. //
  8532. // but those exceptions were never presented as a real life use-cases
  8533. // and might be considered as more preferable results.
  8534. //
  8535. // This logic, however, is not guaranteed and can change at any point in the future
  8536. offsetParent: function() {
  8537. return this.map( function() {
  8538. var offsetParent = this.offsetParent;
  8539. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8540. offsetParent = offsetParent.offsetParent;
  8541. }
  8542. return offsetParent || documentElement;
  8543. } );
  8544. }
  8545. } );
  8546. // Create scrollLeft and scrollTop methods
  8547. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8548. var top = "pageYOffset" === prop;
  8549. jQuery.fn[ method ] = function( val ) {
  8550. return access( this, function( elem, method, val ) {
  8551. // Coalesce documents and windows
  8552. var win;
  8553. if ( isWindow( elem ) ) {
  8554. win = elem;
  8555. } else if ( elem.nodeType === 9 ) {
  8556. win = elem.defaultView;
  8557. }
  8558. if ( val === undefined ) {
  8559. return win ? win[ prop ] : elem[ method ];
  8560. }
  8561. if ( win ) {
  8562. win.scrollTo(
  8563. !top ? val : win.pageXOffset,
  8564. top ? val : win.pageYOffset
  8565. );
  8566. } else {
  8567. elem[ method ] = val;
  8568. }
  8569. }, method, val, arguments.length );
  8570. };
  8571. } );
  8572. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8573. // Add the top/left cssHooks using jQuery.fn.position
  8574. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8575. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8576. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8577. // rather than make the css module depend on the offset module, just check for it here
  8578. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8579. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8580. function( elem, computed ) {
  8581. if ( computed ) {
  8582. computed = curCSS( elem, prop );
  8583. // If curCSS returns percentage, fallback to offset
  8584. return rnumnonpx.test( computed ) ?
  8585. jQuery( elem ).position()[ prop ] + "px" :
  8586. computed;
  8587. }
  8588. }
  8589. );
  8590. } );
  8591. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8592. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8593. jQuery.each( {
  8594. padding: "inner" + name,
  8595. content: type,
  8596. "": "outer" + name
  8597. }, function( defaultExtra, funcName ) {
  8598. // Margin is only for outerHeight, outerWidth
  8599. jQuery.fn[ funcName ] = function( margin, value ) {
  8600. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8601. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8602. return access( this, function( elem, type, value ) {
  8603. var doc;
  8604. if ( isWindow( elem ) ) {
  8605. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8606. return funcName.indexOf( "outer" ) === 0 ?
  8607. elem[ "inner" + name ] :
  8608. elem.document.documentElement[ "client" + name ];
  8609. }
  8610. // Get document width or height
  8611. if ( elem.nodeType === 9 ) {
  8612. doc = elem.documentElement;
  8613. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8614. // whichever is greatest
  8615. return Math.max(
  8616. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8617. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8618. doc[ "client" + name ]
  8619. );
  8620. }
  8621. return value === undefined ?
  8622. // Get width or height on the element, requesting but not forcing parseFloat
  8623. jQuery.css( elem, type, extra ) :
  8624. // Set width or height on the element
  8625. jQuery.style( elem, type, value, extra );
  8626. }, type, chainable ? margin : undefined, chainable );
  8627. };
  8628. } );
  8629. } );
  8630. jQuery.each( [
  8631. "ajaxStart",
  8632. "ajaxStop",
  8633. "ajaxComplete",
  8634. "ajaxError",
  8635. "ajaxSuccess",
  8636. "ajaxSend"
  8637. ], function( _i, type ) {
  8638. jQuery.fn[ type ] = function( fn ) {
  8639. return this.on( type, fn );
  8640. };
  8641. } );
  8642. jQuery.fn.extend( {
  8643. bind: function( types, data, fn ) {
  8644. return this.on( types, null, data, fn );
  8645. },
  8646. unbind: function( types, fn ) {
  8647. return this.off( types, null, fn );
  8648. },
  8649. delegate: function( selector, types, data, fn ) {
  8650. return this.on( types, selector, data, fn );
  8651. },
  8652. undelegate: function( selector, types, fn ) {
  8653. // ( namespace ) or ( selector, types [, fn] )
  8654. return arguments.length === 1 ?
  8655. this.off( selector, "**" ) :
  8656. this.off( types, selector || "**", fn );
  8657. },
  8658. hover: function( fnOver, fnOut ) {
  8659. return this
  8660. .on( "mouseenter", fnOver )
  8661. .on( "mouseleave", fnOut || fnOver );
  8662. }
  8663. } );
  8664. jQuery.each(
  8665. ( "blur focus focusin focusout resize scroll click dblclick " +
  8666. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8667. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8668. function( _i, name ) {
  8669. // Handle event binding
  8670. jQuery.fn[ name ] = function( data, fn ) {
  8671. return arguments.length > 0 ?
  8672. this.on( name, null, data, fn ) :
  8673. this.trigger( name );
  8674. };
  8675. }
  8676. );
  8677. // Support: Android <=4.0 only
  8678. // Make sure we trim BOM and NBSP
  8679. // Require that the "whitespace run" starts from a non-whitespace
  8680. // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
  8681. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  8682. // Bind a function to a context, optionally partially applying any
  8683. // arguments.
  8684. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8685. // However, it is not slated for removal any time soon
  8686. jQuery.proxy = function( fn, context ) {
  8687. var tmp, args, proxy;
  8688. if ( typeof context === "string" ) {
  8689. tmp = fn[ context ];
  8690. context = fn;
  8691. fn = tmp;
  8692. }
  8693. // Quick check to determine if target is callable, in the spec
  8694. // this throws a TypeError, but we will just return undefined.
  8695. if ( !isFunction( fn ) ) {
  8696. return undefined;
  8697. }
  8698. // Simulated bind
  8699. args = slice.call( arguments, 2 );
  8700. proxy = function() {
  8701. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8702. };
  8703. // Set the guid of unique handler to the same of original handler, so it can be removed
  8704. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8705. return proxy;
  8706. };
  8707. jQuery.holdReady = function( hold ) {
  8708. if ( hold ) {
  8709. jQuery.readyWait++;
  8710. } else {
  8711. jQuery.ready( true );
  8712. }
  8713. };
  8714. jQuery.isArray = Array.isArray;
  8715. jQuery.parseJSON = JSON.parse;
  8716. jQuery.nodeName = nodeName;
  8717. jQuery.isFunction = isFunction;
  8718. jQuery.isWindow = isWindow;
  8719. jQuery.camelCase = camelCase;
  8720. jQuery.type = toType;
  8721. jQuery.now = Date.now;
  8722. jQuery.isNumeric = function( obj ) {
  8723. // As of jQuery 3.0, isNumeric is limited to
  8724. // strings and numbers (primitives or objects)
  8725. // that can be coerced to finite numbers (gh-2662)
  8726. var type = jQuery.type( obj );
  8727. return ( type === "number" || type === "string" ) &&
  8728. // parseFloat NaNs numeric-cast false positives ("")
  8729. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8730. // subtraction forces infinities to NaN
  8731. !isNaN( obj - parseFloat( obj ) );
  8732. };
  8733. jQuery.trim = function( text ) {
  8734. return text == null ?
  8735. "" :
  8736. ( text + "" ).replace( rtrim, "$1" );
  8737. };
  8738. // Register as a named AMD module, since jQuery can be concatenated with other
  8739. // files that may use define, but not via a proper concatenation script that
  8740. // understands anonymous AMD modules. A named AMD is safest and most robust
  8741. // way to register. Lowercase jquery is used because AMD module names are
  8742. // derived from file names, and jQuery is normally delivered in a lowercase
  8743. // file name. Do this after creating the global so that if an AMD module wants
  8744. // to call noConflict to hide this version of jQuery, it will work.
  8745. // Note that for maximum portability, libraries that are not jQuery should
  8746. // declare themselves as anonymous modules, and avoid setting a global if an
  8747. // AMD loader is present. jQuery is a special case. For more information, see
  8748. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8749. if ( true ) {
  8750. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  8751. return jQuery;
  8752. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  8753. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8754. }
  8755. var
  8756. // Map over jQuery in case of overwrite
  8757. _jQuery = window.jQuery,
  8758. // Map over the $ in case of overwrite
  8759. _$ = window.$;
  8760. jQuery.noConflict = function( deep ) {
  8761. if ( window.$ === jQuery ) {
  8762. window.$ = _$;
  8763. }
  8764. if ( deep && window.jQuery === jQuery ) {
  8765. window.jQuery = _jQuery;
  8766. }
  8767. return jQuery;
  8768. };
  8769. // Expose jQuery and $ identifiers, even in AMD
  8770. // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8771. // and CommonJS for browser emulators (trac-13566)
  8772. if ( typeof noGlobal === "undefined" ) {
  8773. window.jQuery = window.$ = jQuery;
  8774. }
  8775. return jQuery;
  8776. } );
  8777. /***/ })
  8778. /******/ });
  8779. /************************************************************************/
  8780. /******/ // The module cache
  8781. /******/ var __webpack_module_cache__ = {};
  8782. /******/
  8783. /******/ // The require function
  8784. /******/ function __webpack_require__(moduleId) {
  8785. /******/ // Check if module is in cache
  8786. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  8787. /******/ if (cachedModule !== undefined) {
  8788. /******/ return cachedModule.exports;
  8789. /******/ }
  8790. /******/ // Create a new module (and put it into the cache)
  8791. /******/ var module = __webpack_module_cache__[moduleId] = {
  8792. /******/ // no module.id needed
  8793. /******/ // no module.loaded needed
  8794. /******/ exports: {}
  8795. /******/ };
  8796. /******/
  8797. /******/ // Execute the module function
  8798. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  8799. /******/
  8800. /******/ // Return the exports of the module
  8801. /******/ return module.exports;
  8802. /******/ }
  8803. /******/
  8804. /************************************************************************/
  8805. /******/ /* webpack/runtime/compat get default export */
  8806. /******/ (() => {
  8807. /******/ // getDefaultExport function for compatibility with non-harmony modules
  8808. /******/ __webpack_require__.n = (module) => {
  8809. /******/ var getter = module && module.__esModule ?
  8810. /******/ () => (module['default']) :
  8811. /******/ () => (module);
  8812. /******/ __webpack_require__.d(getter, { a: getter });
  8813. /******/ return getter;
  8814. /******/ };
  8815. /******/ })();
  8816. /******/
  8817. /******/ /* webpack/runtime/define property getters */
  8818. /******/ (() => {
  8819. /******/ // define getter functions for harmony exports
  8820. /******/ __webpack_require__.d = (exports, definition) => {
  8821. /******/ for(var key in definition) {
  8822. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  8823. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  8824. /******/ }
  8825. /******/ }
  8826. /******/ };
  8827. /******/ })();
  8828. /******/
  8829. /******/ /* webpack/runtime/global */
  8830. /******/ (() => {
  8831. /******/ __webpack_require__.g = (function() {
  8832. /******/ if (typeof globalThis === 'object') return globalThis;
  8833. /******/ try {
  8834. /******/ return this || new Function('return this')();
  8835. /******/ } catch (e) {
  8836. /******/ if (typeof window === 'object') return window;
  8837. /******/ }
  8838. /******/ })();
  8839. /******/ })();
  8840. /******/
  8841. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  8842. /******/ (() => {
  8843. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  8844. /******/ })();
  8845. /******/
  8846. /******/ /* webpack/runtime/make namespace object */
  8847. /******/ (() => {
  8848. /******/ // define __esModule on exports
  8849. /******/ __webpack_require__.r = (exports) => {
  8850. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  8851. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  8852. /******/ }
  8853. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  8854. /******/ };
  8855. /******/ })();
  8856. /******/
  8857. /************************************************************************/
  8858. var __webpack_exports__ = {};
  8859. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  8860. (() => {
  8861. "use strict";
  8862. /*!******************************!*\
  8863. !*** ./resources/js/main.js ***!
  8864. \******************************/
  8865. __webpack_require__.r(__webpack_exports__);
  8866. /* harmony import */ var aos__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! aos */ "./node_modules/aos/dist/aos.js");
  8867. /* harmony import */ var aos__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(aos__WEBPACK_IMPORTED_MODULE_0__);
  8868. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  8869. /* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);
  8870. /* harmony import */ var _api_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./api/api */ "./resources/js/api/api.js");
  8871. var $ = (jquery__WEBPACK_IMPORTED_MODULE_1___default());
  8872. var api = new _api_api__WEBPACK_IMPORTED_MODULE_2__["default"]();
  8873. var bookingRules = [];
  8874. setTimeout(function () {
  8875. console.log("AOS init");
  8876. aos__WEBPACK_IMPORTED_MODULE_0___default().init();
  8877. }, 500);
  8878. $(document).ready(function () {
  8879. $('.article-carousel-item').on('click', function () {
  8880. var redirectlink = $(this).data('href');
  8881. location.href = redirectlink;
  8882. });
  8883. $('#contact-form').on('submit', function (e) {
  8884. e.preventDefault();
  8885. var name = $(this).find("#name").val();
  8886. var email = $(this).find("#email").val();
  8887. var message = $(this).find("#message").val();
  8888. var submitButton = $(this).find('#submitButton');
  8889. var loadingSpan = document.createElement('span');
  8890. $(submitButton).prop("disabled", true);
  8891. $(loadingSpan).attr("role", "status");
  8892. $(loadingSpan).attr("aria-hidden", "true");
  8893. $(loadingSpan).addClass("spinner-border spinner-border-sm");
  8894. submitButton.text("Sending ");
  8895. $(submitButton).append(loadingSpan);
  8896. var _callback = function _callback(resp) {
  8897. var status = resp.status;
  8898. if (status === "Success") {
  8899. submitButton.text("Success");
  8900. $("#name").val("");
  8901. $("#email").val("");
  8902. $("#message").val("");
  8903. } else {
  8904. submitButton.text("Fail");
  8905. }
  8906. setTimeout(function () {
  8907. $(submitButton).prop("disabled", false);
  8908. submitButton.text("Submit");
  8909. }, 1000);
  8910. };
  8911. api.enquiry({
  8912. name: name,
  8913. email: email,
  8914. message: message
  8915. }, _callback);
  8916. });
  8917. // this section is for booking page
  8918. //check if booking section exist in any page
  8919. var bookingContainer = $('#booking-section');
  8920. if (bookingContainer.length > 0) {
  8921. api.listState({
  8922. _callback: function _callback(_ref) {
  8923. var state_city = _ref.state_city;
  8924. var selectLocationInput = $("#select-location");
  8925. if (Array.isArray(state_city)) {
  8926. state_city.forEach(function (_ref2, i) {
  8927. var state = _ref2.state,
  8928. city = _ref2.city;
  8929. var newOption = document.createElement('option');
  8930. $(newOption).attr("id", "location_".concat(i));
  8931. $(newOption).attr("value", JSON.stringify({
  8932. state: state,
  8933. city: city
  8934. }));
  8935. $(newOption).addClass("select-value");
  8936. newOption.text = "".concat(city, ", ").concat(state);
  8937. $(selectLocationInput).append(newOption);
  8938. });
  8939. }
  8940. $(selectLocationInput).on('change', function () {
  8941. resetField();
  8942. });
  8943. }
  8944. });
  8945. // set date max and min
  8946. var _createDateInputWithR = createDateInputWithRange(14),
  8947. maxDate = _createDateInputWithR.maxDate,
  8948. minDate = _createDateInputWithR.minDate;
  8949. var inputDate = $('#input-booking-date');
  8950. $(inputDate).attr("min", minDate);
  8951. $(inputDate).attr("max", maxDate);
  8952. resetDate();
  8953. }
  8954. $("#booknow-btn").on('click', function () {
  8955. document.getElementById("download-container").scrollIntoView();
  8956. });
  8957. $("#select-location").on('change', function () {
  8958. resetDate();
  8959. resetRules();
  8960. resetField();
  8961. $("#select-location").children("#default-input-select-location").remove();
  8962. setTimeout(function () {
  8963. document.getElementById("field-location-container").scrollIntoView({
  8964. behavior: "smooth",
  8965. block: "end",
  8966. inline: "end"
  8967. });
  8968. }, 300);
  8969. if (this.value !== "default") {
  8970. var _JSON$parse = JSON.parse(this.value),
  8971. state = _JSON$parse.state,
  8972. city = _JSON$parse.city;
  8973. api.listLocation({
  8974. state: state,
  8975. city: city,
  8976. _callback: function _callback(_ref3) {
  8977. var field_location = _ref3.field_location;
  8978. var template = $('#field-location-template');
  8979. var container = $(template).parent();
  8980. //reset eveything
  8981. $(container).children(".select-field").remove();
  8982. try {
  8983. field_location.forEach(function (_ref4) {
  8984. var field_name = _ref4.field_name,
  8985. city = _ref4.city,
  8986. state = _ref4.state,
  8987. photo_path = _ref4.photo_path;
  8988. var newField = $(template).clone();
  8989. $(newField).css('display', 'block');
  8990. $(newField).removeAttr("id");
  8991. $(newField).addClass("select-field");
  8992. $(newField).find('.field-location-text').text("");
  8993. $(newField).on('click', function () {
  8994. handleClickFieldLocation(city, state, field_name, newField);
  8995. });
  8996. $(newField).find('.field-location-img').attr("style", "background-image:url(https://thebola.club/files/".concat(photo_path, ")"));
  8997. $(container).append(newField);
  8998. });
  8999. } catch (err) {
  9000. console.log(err);
  9001. }
  9002. }
  9003. });
  9004. }
  9005. });
  9006. var handleClickFieldLocation = function handleClickFieldLocation(city, state, field_name, refElem) {
  9007. $("#field-location-container").find(".select-field").removeClass("active");
  9008. $(refElem).addClass("active");
  9009. resetDate();
  9010. resetRules();
  9011. resetField();
  9012. setTimeout(function () {
  9013. document.getElementById("field-container").scrollIntoView();
  9014. }, 300);
  9015. api.listField({
  9016. state: state,
  9017. city: city,
  9018. field_name: field_name,
  9019. _callback: function _callback(_ref5) {
  9020. var results = _ref5.results;
  9021. var container = $('#field-container');
  9022. var template = $('#field-template');
  9023. try {
  9024. results.forEach(function (_ref6) {
  9025. var location_name = _ref6.location_name,
  9026. photo_path = _ref6.photo_path,
  9027. slot_rules = _ref6.slot_rules;
  9028. var newField = $(template).clone();
  9029. $(newField).css('display', 'block');
  9030. $(newField).removeAttr("id");
  9031. $(newField).addClass("select-field");
  9032. $(newField).find('.field-text').text(location_name);
  9033. $(newField).on('click', function () {
  9034. handleClickField(slot_rules, newField);
  9035. });
  9036. $(newField).find('.field-img').attr("style", "background-image:url(https://thebola.club/files/".concat(photo_path, ")"));
  9037. $(container).append(newField);
  9038. });
  9039. } catch (err) {
  9040. console.log(err);
  9041. }
  9042. }
  9043. });
  9044. };
  9045. var handleClickField = function handleClickField(slot_rules, refElem) {
  9046. // remove all child active class, then add active on clicked
  9047. var fieldContainer = $('#field-container');
  9048. $(fieldContainer).find(".select-field").removeClass("active");
  9049. $(refElem).addClass("active");
  9050. resetRules();
  9051. resetDate();
  9052. bookingRules = slot_rules.rules;
  9053. };
  9054. $('#input-booking-date').change(function () {
  9055. if (bookingRules) {
  9056. // render rule of slot base on current input value date
  9057. var dayName = getDayNameFromInput(document.getElementById("input-booking-date"));
  9058. resetRules();
  9059. setTimeout(function () {
  9060. // append slot list
  9061. bookingRules[dayName].forEach(function (_ref7) {
  9062. var end_time = _ref7.end_time,
  9063. start_time = _ref7.start_time,
  9064. price = _ref7.price,
  9065. id = _ref7.id;
  9066. var newOption = document.createElement('option');
  9067. $(newOption).attr("id", id);
  9068. $(newOption).addClass("select-value");
  9069. newOption.text = "".concat(start_time, " - ").concat(end_time, " (RM ").concat(price, ")");
  9070. $("#input-booking-slot").append(newOption);
  9071. });
  9072. }, 1000);
  9073. }
  9074. });
  9075. function createDateInputWithRange(days) {
  9076. var today = new Date();
  9077. var futureDate = new Date(today.getTime() + days * 24 * 60 * 60 * 1000);
  9078. var maxDate = futureDate.toISOString().split('T')[0];
  9079. var minDate = today.toISOString().split('T')[0];
  9080. return {
  9081. maxDate: maxDate,
  9082. minDate: minDate
  9083. };
  9084. }
  9085. function getDayNameFromInput(inputElement) {
  9086. var selectedDate = inputElement.value;
  9087. var date = new Date(selectedDate);
  9088. var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
  9089. var dayIndex = date.getDay();
  9090. return dayNames[dayIndex];
  9091. }
  9092. function resetField() {
  9093. $('#field-container').children(".select-field").remove();
  9094. }
  9095. function resetDate() {
  9096. var _createDateInputWithR2 = createDateInputWithRange(14),
  9097. maxDate = _createDateInputWithR2.maxDate,
  9098. minDate = _createDateInputWithR2.minDate;
  9099. $('#input-booking-date').val(minDate);
  9100. }
  9101. function resetRules() {
  9102. $("#input-booking-slot").children(".select-value").remove();
  9103. }
  9104. });
  9105. })();
  9106. /******/ })()
  9107. ;