bundle.js 626 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ i: moduleId,
  12. /******/ l: false,
  13. /******/ exports: {}
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.l = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // identity function for calling harmony imports with the correct context
  27. /******/ __webpack_require__.i = function(value) { return value; };
  28. /******/ // define getter function for harmony exports
  29. /******/ __webpack_require__.d = function(exports, name, getter) {
  30. /******/ if(!__webpack_require__.o(exports, name)) {
  31. /******/ Object.defineProperty(exports, name, {
  32. /******/ configurable: false,
  33. /******/ enumerable: true,
  34. /******/ get: getter
  35. /******/ });
  36. /******/ }
  37. /******/ };
  38. /******/ // getDefaultExport function for compatibility with non-harmony modules
  39. /******/ __webpack_require__.n = function(module) {
  40. /******/ var getter = module && module.__esModule ?
  41. /******/ function getDefault() { return module['default']; } :
  42. /******/ function getModuleExports() { return module; };
  43. /******/ __webpack_require__.d(getter, 'a', getter);
  44. /******/ return getter;
  45. /******/ };
  46. /******/ // Object.prototype.hasOwnProperty.call
  47. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  48. /******/ // __webpack_public_path__
  49. /******/ __webpack_require__.p = "";
  50. /******/ // Load entry module and return exports
  51. /******/ return __webpack_require__(__webpack_require__.s = 26);
  52. /******/ })
  53. /************************************************************************/
  54. /******/ ([
  55. /* 0 */
  56. /***/ (function(module, exports) {
  57. module.exports = function normalizeComponent (
  58. rawScriptExports,
  59. compiledTemplate,
  60. scopeId,
  61. cssModules
  62. ) {
  63. var esModule
  64. var scriptExports = rawScriptExports = rawScriptExports || {}
  65. // ES6 modules interop
  66. var type = typeof rawScriptExports.default
  67. if (type === 'object' || type === 'function') {
  68. esModule = rawScriptExports
  69. scriptExports = rawScriptExports.default
  70. }
  71. // Vue.extend constructor export interop
  72. var options = typeof scriptExports === 'function'
  73. ? scriptExports.options
  74. : scriptExports
  75. // render functions
  76. if (compiledTemplate) {
  77. options.render = compiledTemplate.render
  78. options.staticRenderFns = compiledTemplate.staticRenderFns
  79. }
  80. // scopedId
  81. if (scopeId) {
  82. options._scopeId = scopeId
  83. }
  84. // inject cssModules
  85. if (cssModules) {
  86. var computed = options.computed || (options.computed = {})
  87. Object.keys(cssModules).forEach(function (key) {
  88. var module = cssModules[key]
  89. computed[key] = function () { return module }
  90. })
  91. }
  92. return {
  93. esModule: esModule,
  94. exports: scriptExports,
  95. options: options
  96. }
  97. }
  98. /***/ }),
  99. /* 1 */
  100. /***/ (function(module, exports, __webpack_require__) {
  101. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  102. * jQuery JavaScript Library v3.1.1
  103. * https://jquery.com/
  104. *
  105. * Includes Sizzle.js
  106. * https://sizzlejs.com/
  107. *
  108. * Copyright jQuery Foundation and other contributors
  109. * Released under the MIT license
  110. * https://jquery.org/license
  111. *
  112. * Date: 2016-09-22T22:30Z
  113. */
  114. ( function( global, factory ) {
  115. "use strict";
  116. if ( typeof module === "object" && typeof module.exports === "object" ) {
  117. // For CommonJS and CommonJS-like environments where a proper `window`
  118. // is present, execute the factory and get jQuery.
  119. // For environments that do not have a `window` with a `document`
  120. // (such as Node.js), expose a factory as module.exports.
  121. // This accentuates the need for the creation of a real `window`.
  122. // e.g. var jQuery = require("jquery")(window);
  123. // See ticket #14549 for more info.
  124. module.exports = global.document ?
  125. factory( global, true ) :
  126. function( w ) {
  127. if ( !w.document ) {
  128. throw new Error( "jQuery requires a window with a document" );
  129. }
  130. return factory( w );
  131. };
  132. } else {
  133. factory( global );
  134. }
  135. // Pass this if window is not defined yet
  136. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  137. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  138. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  139. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  140. // enough that all such attempts are guarded in a try block.
  141. "use strict";
  142. var arr = [];
  143. var document = window.document;
  144. var getProto = Object.getPrototypeOf;
  145. var slice = arr.slice;
  146. var concat = arr.concat;
  147. var push = arr.push;
  148. var indexOf = arr.indexOf;
  149. var class2type = {};
  150. var toString = class2type.toString;
  151. var hasOwn = class2type.hasOwnProperty;
  152. var fnToString = hasOwn.toString;
  153. var ObjectFunctionString = fnToString.call( Object );
  154. var support = {};
  155. function DOMEval( code, doc ) {
  156. doc = doc || document;
  157. var script = doc.createElement( "script" );
  158. script.text = code;
  159. doc.head.appendChild( script ).parentNode.removeChild( script );
  160. }
  161. /* global Symbol */
  162. // Defining this global in .eslintrc.json would create a danger of using the global
  163. // unguarded in another place, it seems safer to define global only for this module
  164. var
  165. version = "3.1.1",
  166. // Define a local copy of jQuery
  167. jQuery = function( selector, context ) {
  168. // The jQuery object is actually just the init constructor 'enhanced'
  169. // Need init if jQuery is called (just allow error to be thrown if not included)
  170. return new jQuery.fn.init( selector, context );
  171. },
  172. // Support: Android <=4.0 only
  173. // Make sure we trim BOM and NBSP
  174. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  175. // Matches dashed string for camelizing
  176. rmsPrefix = /^-ms-/,
  177. rdashAlpha = /-([a-z])/g,
  178. // Used by jQuery.camelCase as callback to replace()
  179. fcamelCase = function( all, letter ) {
  180. return letter.toUpperCase();
  181. };
  182. jQuery.fn = jQuery.prototype = {
  183. // The current version of jQuery being used
  184. jquery: version,
  185. constructor: jQuery,
  186. // The default length of a jQuery object is 0
  187. length: 0,
  188. toArray: function() {
  189. return slice.call( this );
  190. },
  191. // Get the Nth element in the matched element set OR
  192. // Get the whole matched element set as a clean array
  193. get: function( num ) {
  194. // Return all the elements in a clean array
  195. if ( num == null ) {
  196. return slice.call( this );
  197. }
  198. // Return just the one element from the set
  199. return num < 0 ? this[ num + this.length ] : this[ num ];
  200. },
  201. // Take an array of elements and push it onto the stack
  202. // (returning the new matched element set)
  203. pushStack: function( elems ) {
  204. // Build a new jQuery matched element set
  205. var ret = jQuery.merge( this.constructor(), elems );
  206. // Add the old object onto the stack (as a reference)
  207. ret.prevObject = this;
  208. // Return the newly-formed element set
  209. return ret;
  210. },
  211. // Execute a callback for every element in the matched set.
  212. each: function( callback ) {
  213. return jQuery.each( this, callback );
  214. },
  215. map: function( callback ) {
  216. return this.pushStack( jQuery.map( this, function( elem, i ) {
  217. return callback.call( elem, i, elem );
  218. } ) );
  219. },
  220. slice: function() {
  221. return this.pushStack( slice.apply( this, arguments ) );
  222. },
  223. first: function() {
  224. return this.eq( 0 );
  225. },
  226. last: function() {
  227. return this.eq( -1 );
  228. },
  229. eq: function( i ) {
  230. var len = this.length,
  231. j = +i + ( i < 0 ? len : 0 );
  232. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  233. },
  234. end: function() {
  235. return this.prevObject || this.constructor();
  236. },
  237. // For internal use only.
  238. // Behaves like an Array's method, not like a jQuery method.
  239. push: push,
  240. sort: arr.sort,
  241. splice: arr.splice
  242. };
  243. jQuery.extend = jQuery.fn.extend = function() {
  244. var options, name, src, copy, copyIsArray, clone,
  245. target = arguments[ 0 ] || {},
  246. i = 1,
  247. length = arguments.length,
  248. deep = false;
  249. // Handle a deep copy situation
  250. if ( typeof target === "boolean" ) {
  251. deep = target;
  252. // Skip the boolean and the target
  253. target = arguments[ i ] || {};
  254. i++;
  255. }
  256. // Handle case when target is a string or something (possible in deep copy)
  257. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  258. target = {};
  259. }
  260. // Extend jQuery itself if only one argument is passed
  261. if ( i === length ) {
  262. target = this;
  263. i--;
  264. }
  265. for ( ; i < length; i++ ) {
  266. // Only deal with non-null/undefined values
  267. if ( ( options = arguments[ i ] ) != null ) {
  268. // Extend the base object
  269. for ( name in options ) {
  270. src = target[ name ];
  271. copy = options[ name ];
  272. // Prevent never-ending loop
  273. if ( target === copy ) {
  274. continue;
  275. }
  276. // Recurse if we're merging plain objects or arrays
  277. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  278. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  279. if ( copyIsArray ) {
  280. copyIsArray = false;
  281. clone = src && jQuery.isArray( src ) ? src : [];
  282. } else {
  283. clone = src && jQuery.isPlainObject( src ) ? src : {};
  284. }
  285. // Never move original objects, clone them
  286. target[ name ] = jQuery.extend( deep, clone, copy );
  287. // Don't bring in undefined values
  288. } else if ( copy !== undefined ) {
  289. target[ name ] = copy;
  290. }
  291. }
  292. }
  293. }
  294. // Return the modified object
  295. return target;
  296. };
  297. jQuery.extend( {
  298. // Unique for each copy of jQuery on the page
  299. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  300. // Assume jQuery is ready without the ready module
  301. isReady: true,
  302. error: function( msg ) {
  303. throw new Error( msg );
  304. },
  305. noop: function() {},
  306. isFunction: function( obj ) {
  307. return jQuery.type( obj ) === "function";
  308. },
  309. isArray: Array.isArray,
  310. isWindow: function( obj ) {
  311. return obj != null && obj === obj.window;
  312. },
  313. isNumeric: function( obj ) {
  314. // As of jQuery 3.0, isNumeric is limited to
  315. // strings and numbers (primitives or objects)
  316. // that can be coerced to finite numbers (gh-2662)
  317. var type = jQuery.type( obj );
  318. return ( type === "number" || type === "string" ) &&
  319. // parseFloat NaNs numeric-cast false positives ("")
  320. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  321. // subtraction forces infinities to NaN
  322. !isNaN( obj - parseFloat( obj ) );
  323. },
  324. isPlainObject: function( obj ) {
  325. var proto, Ctor;
  326. // Detect obvious negatives
  327. // Use toString instead of jQuery.type to catch host objects
  328. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  329. return false;
  330. }
  331. proto = getProto( obj );
  332. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  333. if ( !proto ) {
  334. return true;
  335. }
  336. // Objects with prototype are plain iff they were constructed by a global Object function
  337. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  338. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  339. },
  340. isEmptyObject: function( obj ) {
  341. /* eslint-disable no-unused-vars */
  342. // See https://github.com/eslint/eslint/issues/6125
  343. var name;
  344. for ( name in obj ) {
  345. return false;
  346. }
  347. return true;
  348. },
  349. type: function( obj ) {
  350. if ( obj == null ) {
  351. return obj + "";
  352. }
  353. // Support: Android <=2.3 only (functionish RegExp)
  354. return typeof obj === "object" || typeof obj === "function" ?
  355. class2type[ toString.call( obj ) ] || "object" :
  356. typeof obj;
  357. },
  358. // Evaluates a script in a global context
  359. globalEval: function( code ) {
  360. DOMEval( code );
  361. },
  362. // Convert dashed to camelCase; used by the css and data modules
  363. // Support: IE <=9 - 11, Edge 12 - 13
  364. // Microsoft forgot to hump their vendor prefix (#9572)
  365. camelCase: function( string ) {
  366. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  367. },
  368. nodeName: function( elem, name ) {
  369. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  370. },
  371. each: function( obj, callback ) {
  372. var length, i = 0;
  373. if ( isArrayLike( obj ) ) {
  374. length = obj.length;
  375. for ( ; i < length; i++ ) {
  376. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  377. break;
  378. }
  379. }
  380. } else {
  381. for ( i in obj ) {
  382. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  383. break;
  384. }
  385. }
  386. }
  387. return obj;
  388. },
  389. // Support: Android <=4.0 only
  390. trim: function( text ) {
  391. return text == null ?
  392. "" :
  393. ( text + "" ).replace( rtrim, "" );
  394. },
  395. // results is for internal usage only
  396. makeArray: function( arr, results ) {
  397. var ret = results || [];
  398. if ( arr != null ) {
  399. if ( isArrayLike( Object( arr ) ) ) {
  400. jQuery.merge( ret,
  401. typeof arr === "string" ?
  402. [ arr ] : arr
  403. );
  404. } else {
  405. push.call( ret, arr );
  406. }
  407. }
  408. return ret;
  409. },
  410. inArray: function( elem, arr, i ) {
  411. return arr == null ? -1 : indexOf.call( arr, elem, i );
  412. },
  413. // Support: Android <=4.0 only, PhantomJS 1 only
  414. // push.apply(_, arraylike) throws on ancient WebKit
  415. merge: function( first, second ) {
  416. var len = +second.length,
  417. j = 0,
  418. i = first.length;
  419. for ( ; j < len; j++ ) {
  420. first[ i++ ] = second[ j ];
  421. }
  422. first.length = i;
  423. return first;
  424. },
  425. grep: function( elems, callback, invert ) {
  426. var callbackInverse,
  427. matches = [],
  428. i = 0,
  429. length = elems.length,
  430. callbackExpect = !invert;
  431. // Go through the array, only saving the items
  432. // that pass the validator function
  433. for ( ; i < length; i++ ) {
  434. callbackInverse = !callback( elems[ i ], i );
  435. if ( callbackInverse !== callbackExpect ) {
  436. matches.push( elems[ i ] );
  437. }
  438. }
  439. return matches;
  440. },
  441. // arg is for internal usage only
  442. map: function( elems, callback, arg ) {
  443. var length, value,
  444. i = 0,
  445. ret = [];
  446. // Go through the array, translating each of the items to their new values
  447. if ( isArrayLike( elems ) ) {
  448. length = elems.length;
  449. for ( ; i < length; i++ ) {
  450. value = callback( elems[ i ], i, arg );
  451. if ( value != null ) {
  452. ret.push( value );
  453. }
  454. }
  455. // Go through every key on the object,
  456. } else {
  457. for ( i in elems ) {
  458. value = callback( elems[ i ], i, arg );
  459. if ( value != null ) {
  460. ret.push( value );
  461. }
  462. }
  463. }
  464. // Flatten any nested arrays
  465. return concat.apply( [], ret );
  466. },
  467. // A global GUID counter for objects
  468. guid: 1,
  469. // Bind a function to a context, optionally partially applying any
  470. // arguments.
  471. proxy: function( fn, context ) {
  472. var tmp, args, proxy;
  473. if ( typeof context === "string" ) {
  474. tmp = fn[ context ];
  475. context = fn;
  476. fn = tmp;
  477. }
  478. // Quick check to determine if target is callable, in the spec
  479. // this throws a TypeError, but we will just return undefined.
  480. if ( !jQuery.isFunction( fn ) ) {
  481. return undefined;
  482. }
  483. // Simulated bind
  484. args = slice.call( arguments, 2 );
  485. proxy = function() {
  486. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  487. };
  488. // Set the guid of unique handler to the same of original handler, so it can be removed
  489. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  490. return proxy;
  491. },
  492. now: Date.now,
  493. // jQuery.support is not used in Core but other projects attach their
  494. // properties to it so it needs to exist.
  495. support: support
  496. } );
  497. if ( typeof Symbol === "function" ) {
  498. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  499. }
  500. // Populate the class2type map
  501. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  502. function( i, name ) {
  503. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  504. } );
  505. function isArrayLike( obj ) {
  506. // Support: real iOS 8.2 only (not reproducible in simulator)
  507. // `in` check used to prevent JIT error (gh-2145)
  508. // hasOwn isn't used here due to false negatives
  509. // regarding Nodelist length in IE
  510. var length = !!obj && "length" in obj && obj.length,
  511. type = jQuery.type( obj );
  512. if ( type === "function" || jQuery.isWindow( obj ) ) {
  513. return false;
  514. }
  515. return type === "array" || length === 0 ||
  516. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  517. }
  518. var Sizzle =
  519. /*!
  520. * Sizzle CSS Selector Engine v2.3.3
  521. * https://sizzlejs.com/
  522. *
  523. * Copyright jQuery Foundation and other contributors
  524. * Released under the MIT license
  525. * http://jquery.org/license
  526. *
  527. * Date: 2016-08-08
  528. */
  529. (function( window ) {
  530. var i,
  531. support,
  532. Expr,
  533. getText,
  534. isXML,
  535. tokenize,
  536. compile,
  537. select,
  538. outermostContext,
  539. sortInput,
  540. hasDuplicate,
  541. // Local document vars
  542. setDocument,
  543. document,
  544. docElem,
  545. documentIsHTML,
  546. rbuggyQSA,
  547. rbuggyMatches,
  548. matches,
  549. contains,
  550. // Instance-specific data
  551. expando = "sizzle" + 1 * new Date(),
  552. preferredDoc = window.document,
  553. dirruns = 0,
  554. done = 0,
  555. classCache = createCache(),
  556. tokenCache = createCache(),
  557. compilerCache = createCache(),
  558. sortOrder = function( a, b ) {
  559. if ( a === b ) {
  560. hasDuplicate = true;
  561. }
  562. return 0;
  563. },
  564. // Instance methods
  565. hasOwn = ({}).hasOwnProperty,
  566. arr = [],
  567. pop = arr.pop,
  568. push_native = arr.push,
  569. push = arr.push,
  570. slice = arr.slice,
  571. // Use a stripped-down indexOf as it's faster than native
  572. // https://jsperf.com/thor-indexof-vs-for/5
  573. indexOf = function( list, elem ) {
  574. var i = 0,
  575. len = list.length;
  576. for ( ; i < len; i++ ) {
  577. if ( list[i] === elem ) {
  578. return i;
  579. }
  580. }
  581. return -1;
  582. },
  583. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  584. // Regular expressions
  585. // http://www.w3.org/TR/css3-selectors/#whitespace
  586. whitespace = "[\\x20\\t\\r\\n\\f]",
  587. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  588. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  589. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  590. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  591. // Operator (capture 2)
  592. "*([*^$|!~]?=)" + whitespace +
  593. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  594. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  595. "*\\]",
  596. pseudos = ":(" + identifier + ")(?:\\((" +
  597. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  598. // 1. quoted (capture 3; capture 4 or capture 5)
  599. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  600. // 2. simple (capture 6)
  601. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  602. // 3. anything else (capture 2)
  603. ".*" +
  604. ")\\)|)",
  605. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  606. rwhitespace = new RegExp( whitespace + "+", "g" ),
  607. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  608. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  609. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  610. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  611. rpseudo = new RegExp( pseudos ),
  612. ridentifier = new RegExp( "^" + identifier + "$" ),
  613. matchExpr = {
  614. "ID": new RegExp( "^#(" + identifier + ")" ),
  615. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  616. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  617. "ATTR": new RegExp( "^" + attributes ),
  618. "PSEUDO": new RegExp( "^" + pseudos ),
  619. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  620. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  621. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  622. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  623. // For use in libraries implementing .is()
  624. // We use this for POS matching in `select`
  625. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  626. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  627. },
  628. rinputs = /^(?:input|select|textarea|button)$/i,
  629. rheader = /^h\d$/i,
  630. rnative = /^[^{]+\{\s*\[native \w/,
  631. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  632. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  633. rsibling = /[+~]/,
  634. // CSS escapes
  635. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  636. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  637. funescape = function( _, escaped, escapedWhitespace ) {
  638. var high = "0x" + escaped - 0x10000;
  639. // NaN means non-codepoint
  640. // Support: Firefox<24
  641. // Workaround erroneous numeric interpretation of +"0x"
  642. return high !== high || escapedWhitespace ?
  643. escaped :
  644. high < 0 ?
  645. // BMP codepoint
  646. String.fromCharCode( high + 0x10000 ) :
  647. // Supplemental Plane codepoint (surrogate pair)
  648. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  649. },
  650. // CSS string/identifier serialization
  651. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  652. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  653. fcssescape = function( ch, asCodePoint ) {
  654. if ( asCodePoint ) {
  655. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  656. if ( ch === "\0" ) {
  657. return "\uFFFD";
  658. }
  659. // Control characters and (dependent upon position) numbers get escaped as code points
  660. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  661. }
  662. // Other potentially-special ASCII characters get backslash-escaped
  663. return "\\" + ch;
  664. },
  665. // Used for iframes
  666. // See setDocument()
  667. // Removing the function wrapper causes a "Permission Denied"
  668. // error in IE
  669. unloadHandler = function() {
  670. setDocument();
  671. },
  672. disabledAncestor = addCombinator(
  673. function( elem ) {
  674. return elem.disabled === true && ("form" in elem || "label" in elem);
  675. },
  676. { dir: "parentNode", next: "legend" }
  677. );
  678. // Optimize for push.apply( _, NodeList )
  679. try {
  680. push.apply(
  681. (arr = slice.call( preferredDoc.childNodes )),
  682. preferredDoc.childNodes
  683. );
  684. // Support: Android<4.0
  685. // Detect silently failing push.apply
  686. arr[ preferredDoc.childNodes.length ].nodeType;
  687. } catch ( e ) {
  688. push = { apply: arr.length ?
  689. // Leverage slice if possible
  690. function( target, els ) {
  691. push_native.apply( target, slice.call(els) );
  692. } :
  693. // Support: IE<9
  694. // Otherwise append directly
  695. function( target, els ) {
  696. var j = target.length,
  697. i = 0;
  698. // Can't trust NodeList.length
  699. while ( (target[j++] = els[i++]) ) {}
  700. target.length = j - 1;
  701. }
  702. };
  703. }
  704. function Sizzle( selector, context, results, seed ) {
  705. var m, i, elem, nid, match, groups, newSelector,
  706. newContext = context && context.ownerDocument,
  707. // nodeType defaults to 9, since context defaults to document
  708. nodeType = context ? context.nodeType : 9;
  709. results = results || [];
  710. // Return early from calls with invalid selector or context
  711. if ( typeof selector !== "string" || !selector ||
  712. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  713. return results;
  714. }
  715. // Try to shortcut find operations (as opposed to filters) in HTML documents
  716. if ( !seed ) {
  717. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  718. setDocument( context );
  719. }
  720. context = context || document;
  721. if ( documentIsHTML ) {
  722. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  723. // (excepting DocumentFragment context, where the methods don't exist)
  724. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  725. // ID selector
  726. if ( (m = match[1]) ) {
  727. // Document context
  728. if ( nodeType === 9 ) {
  729. if ( (elem = context.getElementById( m )) ) {
  730. // Support: IE, Opera, Webkit
  731. // TODO: identify versions
  732. // getElementById can match elements by name instead of ID
  733. if ( elem.id === m ) {
  734. results.push( elem );
  735. return results;
  736. }
  737. } else {
  738. return results;
  739. }
  740. // Element context
  741. } else {
  742. // Support: IE, Opera, Webkit
  743. // TODO: identify versions
  744. // getElementById can match elements by name instead of ID
  745. if ( newContext && (elem = newContext.getElementById( m )) &&
  746. contains( context, elem ) &&
  747. elem.id === m ) {
  748. results.push( elem );
  749. return results;
  750. }
  751. }
  752. // Type selector
  753. } else if ( match[2] ) {
  754. push.apply( results, context.getElementsByTagName( selector ) );
  755. return results;
  756. // Class selector
  757. } else if ( (m = match[3]) && support.getElementsByClassName &&
  758. context.getElementsByClassName ) {
  759. push.apply( results, context.getElementsByClassName( m ) );
  760. return results;
  761. }
  762. }
  763. // Take advantage of querySelectorAll
  764. if ( support.qsa &&
  765. !compilerCache[ selector + " " ] &&
  766. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  767. if ( nodeType !== 1 ) {
  768. newContext = context;
  769. newSelector = selector;
  770. // qSA looks outside Element context, which is not what we want
  771. // Thanks to Andrew Dupont for this workaround technique
  772. // Support: IE <=8
  773. // Exclude object elements
  774. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  775. // Capture the context ID, setting it first if necessary
  776. if ( (nid = context.getAttribute( "id" )) ) {
  777. nid = nid.replace( rcssescape, fcssescape );
  778. } else {
  779. context.setAttribute( "id", (nid = expando) );
  780. }
  781. // Prefix every selector in the list
  782. groups = tokenize( selector );
  783. i = groups.length;
  784. while ( i-- ) {
  785. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  786. }
  787. newSelector = groups.join( "," );
  788. // Expand context for sibling selectors
  789. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  790. context;
  791. }
  792. if ( newSelector ) {
  793. try {
  794. push.apply( results,
  795. newContext.querySelectorAll( newSelector )
  796. );
  797. return results;
  798. } catch ( qsaError ) {
  799. } finally {
  800. if ( nid === expando ) {
  801. context.removeAttribute( "id" );
  802. }
  803. }
  804. }
  805. }
  806. }
  807. }
  808. // All others
  809. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  810. }
  811. /**
  812. * Create key-value caches of limited size
  813. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  814. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  815. * deleting the oldest entry
  816. */
  817. function createCache() {
  818. var keys = [];
  819. function cache( key, value ) {
  820. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  821. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  822. // Only keep the most recent entries
  823. delete cache[ keys.shift() ];
  824. }
  825. return (cache[ key + " " ] = value);
  826. }
  827. return cache;
  828. }
  829. /**
  830. * Mark a function for special use by Sizzle
  831. * @param {Function} fn The function to mark
  832. */
  833. function markFunction( fn ) {
  834. fn[ expando ] = true;
  835. return fn;
  836. }
  837. /**
  838. * Support testing using an element
  839. * @param {Function} fn Passed the created element and returns a boolean result
  840. */
  841. function assert( fn ) {
  842. var el = document.createElement("fieldset");
  843. try {
  844. return !!fn( el );
  845. } catch (e) {
  846. return false;
  847. } finally {
  848. // Remove from its parent by default
  849. if ( el.parentNode ) {
  850. el.parentNode.removeChild( el );
  851. }
  852. // release memory in IE
  853. el = null;
  854. }
  855. }
  856. /**
  857. * Adds the same handler for all of the specified attrs
  858. * @param {String} attrs Pipe-separated list of attributes
  859. * @param {Function} handler The method that will be applied
  860. */
  861. function addHandle( attrs, handler ) {
  862. var arr = attrs.split("|"),
  863. i = arr.length;
  864. while ( i-- ) {
  865. Expr.attrHandle[ arr[i] ] = handler;
  866. }
  867. }
  868. /**
  869. * Checks document order of two siblings
  870. * @param {Element} a
  871. * @param {Element} b
  872. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  873. */
  874. function siblingCheck( a, b ) {
  875. var cur = b && a,
  876. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  877. a.sourceIndex - b.sourceIndex;
  878. // Use IE sourceIndex if available on both nodes
  879. if ( diff ) {
  880. return diff;
  881. }
  882. // Check if b follows a
  883. if ( cur ) {
  884. while ( (cur = cur.nextSibling) ) {
  885. if ( cur === b ) {
  886. return -1;
  887. }
  888. }
  889. }
  890. return a ? 1 : -1;
  891. }
  892. /**
  893. * Returns a function to use in pseudos for input types
  894. * @param {String} type
  895. */
  896. function createInputPseudo( type ) {
  897. return function( elem ) {
  898. var name = elem.nodeName.toLowerCase();
  899. return name === "input" && elem.type === type;
  900. };
  901. }
  902. /**
  903. * Returns a function to use in pseudos for buttons
  904. * @param {String} type
  905. */
  906. function createButtonPseudo( type ) {
  907. return function( elem ) {
  908. var name = elem.nodeName.toLowerCase();
  909. return (name === "input" || name === "button") && elem.type === type;
  910. };
  911. }
  912. /**
  913. * Returns a function to use in pseudos for :enabled/:disabled
  914. * @param {Boolean} disabled true for :disabled; false for :enabled
  915. */
  916. function createDisabledPseudo( disabled ) {
  917. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  918. return function( elem ) {
  919. // Only certain elements can match :enabled or :disabled
  920. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  921. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  922. if ( "form" in elem ) {
  923. // Check for inherited disabledness on relevant non-disabled elements:
  924. // * listed form-associated elements in a disabled fieldset
  925. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  926. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  927. // * option elements in a disabled optgroup
  928. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  929. // All such elements have a "form" property.
  930. if ( elem.parentNode && elem.disabled === false ) {
  931. // Option elements defer to a parent optgroup if present
  932. if ( "label" in elem ) {
  933. if ( "label" in elem.parentNode ) {
  934. return elem.parentNode.disabled === disabled;
  935. } else {
  936. return elem.disabled === disabled;
  937. }
  938. }
  939. // Support: IE 6 - 11
  940. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  941. return elem.isDisabled === disabled ||
  942. // Where there is no isDisabled, check manually
  943. /* jshint -W018 */
  944. elem.isDisabled !== !disabled &&
  945. disabledAncestor( elem ) === disabled;
  946. }
  947. return elem.disabled === disabled;
  948. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  949. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  950. // even exist on them, let alone have a boolean value.
  951. } else if ( "label" in elem ) {
  952. return elem.disabled === disabled;
  953. }
  954. // Remaining elements are neither :enabled nor :disabled
  955. return false;
  956. };
  957. }
  958. /**
  959. * Returns a function to use in pseudos for positionals
  960. * @param {Function} fn
  961. */
  962. function createPositionalPseudo( fn ) {
  963. return markFunction(function( argument ) {
  964. argument = +argument;
  965. return markFunction(function( seed, matches ) {
  966. var j,
  967. matchIndexes = fn( [], seed.length, argument ),
  968. i = matchIndexes.length;
  969. // Match elements found at the specified indexes
  970. while ( i-- ) {
  971. if ( seed[ (j = matchIndexes[i]) ] ) {
  972. seed[j] = !(matches[j] = seed[j]);
  973. }
  974. }
  975. });
  976. });
  977. }
  978. /**
  979. * Checks a node for validity as a Sizzle context
  980. * @param {Element|Object=} context
  981. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  982. */
  983. function testContext( context ) {
  984. return context && typeof context.getElementsByTagName !== "undefined" && context;
  985. }
  986. // Expose support vars for convenience
  987. support = Sizzle.support = {};
  988. /**
  989. * Detects XML nodes
  990. * @param {Element|Object} elem An element or a document
  991. * @returns {Boolean} True iff elem is a non-HTML XML node
  992. */
  993. isXML = Sizzle.isXML = function( elem ) {
  994. // documentElement is verified for cases where it doesn't yet exist
  995. // (such as loading iframes in IE - #4833)
  996. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  997. return documentElement ? documentElement.nodeName !== "HTML" : false;
  998. };
  999. /**
  1000. * Sets document-related variables once based on the current document
  1001. * @param {Element|Object} [doc] An element or document object to use to set the document
  1002. * @returns {Object} Returns the current document
  1003. */
  1004. setDocument = Sizzle.setDocument = function( node ) {
  1005. var hasCompare, subWindow,
  1006. doc = node ? node.ownerDocument || node : preferredDoc;
  1007. // Return early if doc is invalid or already selected
  1008. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  1009. return document;
  1010. }
  1011. // Update global variables
  1012. document = doc;
  1013. docElem = document.documentElement;
  1014. documentIsHTML = !isXML( document );
  1015. // Support: IE 9-11, Edge
  1016. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  1017. if ( preferredDoc !== document &&
  1018. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  1019. // Support: IE 11, Edge
  1020. if ( subWindow.addEventListener ) {
  1021. subWindow.addEventListener( "unload", unloadHandler, false );
  1022. // Support: IE 9 - 10 only
  1023. } else if ( subWindow.attachEvent ) {
  1024. subWindow.attachEvent( "onunload", unloadHandler );
  1025. }
  1026. }
  1027. /* Attributes
  1028. ---------------------------------------------------------------------- */
  1029. // Support: IE<8
  1030. // Verify that getAttribute really returns attributes and not properties
  1031. // (excepting IE8 booleans)
  1032. support.attributes = assert(function( el ) {
  1033. el.className = "i";
  1034. return !el.getAttribute("className");
  1035. });
  1036. /* getElement(s)By*
  1037. ---------------------------------------------------------------------- */
  1038. // Check if getElementsByTagName("*") returns only elements
  1039. support.getElementsByTagName = assert(function( el ) {
  1040. el.appendChild( document.createComment("") );
  1041. return !el.getElementsByTagName("*").length;
  1042. });
  1043. // Support: IE<9
  1044. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  1045. // Support: IE<10
  1046. // Check if getElementById returns elements by name
  1047. // The broken getElementById methods don't pick up programmatically-set names,
  1048. // so use a roundabout getElementsByName test
  1049. support.getById = assert(function( el ) {
  1050. docElem.appendChild( el ).id = expando;
  1051. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  1052. });
  1053. // ID filter and find
  1054. if ( support.getById ) {
  1055. Expr.filter["ID"] = function( id ) {
  1056. var attrId = id.replace( runescape, funescape );
  1057. return function( elem ) {
  1058. return elem.getAttribute("id") === attrId;
  1059. };
  1060. };
  1061. Expr.find["ID"] = function( id, context ) {
  1062. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1063. var elem = context.getElementById( id );
  1064. return elem ? [ elem ] : [];
  1065. }
  1066. };
  1067. } else {
  1068. Expr.filter["ID"] = function( id ) {
  1069. var attrId = id.replace( runescape, funescape );
  1070. return function( elem ) {
  1071. var node = typeof elem.getAttributeNode !== "undefined" &&
  1072. elem.getAttributeNode("id");
  1073. return node && node.value === attrId;
  1074. };
  1075. };
  1076. // Support: IE 6 - 7 only
  1077. // getElementById is not reliable as a find shortcut
  1078. Expr.find["ID"] = function( id, context ) {
  1079. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1080. var node, i, elems,
  1081. elem = context.getElementById( id );
  1082. if ( elem ) {
  1083. // Verify the id attribute
  1084. node = elem.getAttributeNode("id");
  1085. if ( node && node.value === id ) {
  1086. return [ elem ];
  1087. }
  1088. // Fall back on getElementsByName
  1089. elems = context.getElementsByName( id );
  1090. i = 0;
  1091. while ( (elem = elems[i++]) ) {
  1092. node = elem.getAttributeNode("id");
  1093. if ( node && node.value === id ) {
  1094. return [ elem ];
  1095. }
  1096. }
  1097. }
  1098. return [];
  1099. }
  1100. };
  1101. }
  1102. // Tag
  1103. Expr.find["TAG"] = support.getElementsByTagName ?
  1104. function( tag, context ) {
  1105. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1106. return context.getElementsByTagName( tag );
  1107. // DocumentFragment nodes don't have gEBTN
  1108. } else if ( support.qsa ) {
  1109. return context.querySelectorAll( tag );
  1110. }
  1111. } :
  1112. function( tag, context ) {
  1113. var elem,
  1114. tmp = [],
  1115. i = 0,
  1116. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1117. results = context.getElementsByTagName( tag );
  1118. // Filter out possible comments
  1119. if ( tag === "*" ) {
  1120. while ( (elem = results[i++]) ) {
  1121. if ( elem.nodeType === 1 ) {
  1122. tmp.push( elem );
  1123. }
  1124. }
  1125. return tmp;
  1126. }
  1127. return results;
  1128. };
  1129. // Class
  1130. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  1131. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  1132. return context.getElementsByClassName( className );
  1133. }
  1134. };
  1135. /* QSA/matchesSelector
  1136. ---------------------------------------------------------------------- */
  1137. // QSA and matchesSelector support
  1138. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1139. rbuggyMatches = [];
  1140. // qSa(:focus) reports false when true (Chrome 21)
  1141. // We allow this because of a bug in IE8/9 that throws an error
  1142. // whenever `document.activeElement` is accessed on an iframe
  1143. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1144. // See https://bugs.jquery.com/ticket/13378
  1145. rbuggyQSA = [];
  1146. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  1147. // Build QSA regex
  1148. // Regex strategy adopted from Diego Perini
  1149. assert(function( el ) {
  1150. // Select is set to empty string on purpose
  1151. // This is to test IE's treatment of not explicitly
  1152. // setting a boolean content attribute,
  1153. // since its presence should be enough
  1154. // https://bugs.jquery.com/ticket/12359
  1155. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  1156. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  1157. "<option selected=''></option></select>";
  1158. // Support: IE8, Opera 11-12.16
  1159. // Nothing should be selected when empty strings follow ^= or $= or *=
  1160. // The test attribute must be unknown in Opera but "safe" for WinRT
  1161. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1162. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  1163. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1164. }
  1165. // Support: IE8
  1166. // Boolean attributes and "value" are not treated correctly
  1167. if ( !el.querySelectorAll("[selected]").length ) {
  1168. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1169. }
  1170. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  1171. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1172. rbuggyQSA.push("~=");
  1173. }
  1174. // Webkit/Opera - :checked should return selected option elements
  1175. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1176. // IE8 throws error here and will not see later tests
  1177. if ( !el.querySelectorAll(":checked").length ) {
  1178. rbuggyQSA.push(":checked");
  1179. }
  1180. // Support: Safari 8+, iOS 8+
  1181. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1182. // In-page `selector#id sibling-combinator selector` fails
  1183. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1184. rbuggyQSA.push(".#.+[+~]");
  1185. }
  1186. });
  1187. assert(function( el ) {
  1188. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  1189. "<select disabled='disabled'><option/></select>";
  1190. // Support: Windows 8 Native Apps
  1191. // The type and name attributes are restricted during .innerHTML assignment
  1192. var input = document.createElement("input");
  1193. input.setAttribute( "type", "hidden" );
  1194. el.appendChild( input ).setAttribute( "name", "D" );
  1195. // Support: IE8
  1196. // Enforce case-sensitivity of name attribute
  1197. if ( el.querySelectorAll("[name=d]").length ) {
  1198. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1199. }
  1200. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1201. // IE8 throws error here and will not see later tests
  1202. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  1203. rbuggyQSA.push( ":enabled", ":disabled" );
  1204. }
  1205. // Support: IE9-11+
  1206. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1207. docElem.appendChild( el ).disabled = true;
  1208. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  1209. rbuggyQSA.push( ":enabled", ":disabled" );
  1210. }
  1211. // Opera 10-11 does not throw on post-comma invalid pseudos
  1212. el.querySelectorAll("*,:x");
  1213. rbuggyQSA.push(",.*:");
  1214. });
  1215. }
  1216. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1217. docElem.webkitMatchesSelector ||
  1218. docElem.mozMatchesSelector ||
  1219. docElem.oMatchesSelector ||
  1220. docElem.msMatchesSelector) )) ) {
  1221. assert(function( el ) {
  1222. // Check to see if it's possible to do matchesSelector
  1223. // on a disconnected node (IE 9)
  1224. support.disconnectedMatch = matches.call( el, "*" );
  1225. // This should fail with an exception
  1226. // Gecko does not error, returns false instead
  1227. matches.call( el, "[s!='']:x" );
  1228. rbuggyMatches.push( "!=", pseudos );
  1229. });
  1230. }
  1231. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1232. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1233. /* Contains
  1234. ---------------------------------------------------------------------- */
  1235. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1236. // Element contains another
  1237. // Purposefully self-exclusive
  1238. // As in, an element does not contain itself
  1239. contains = hasCompare || rnative.test( docElem.contains ) ?
  1240. function( a, b ) {
  1241. var adown = a.nodeType === 9 ? a.documentElement : a,
  1242. bup = b && b.parentNode;
  1243. return a === bup || !!( bup && bup.nodeType === 1 && (
  1244. adown.contains ?
  1245. adown.contains( bup ) :
  1246. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1247. ));
  1248. } :
  1249. function( a, b ) {
  1250. if ( b ) {
  1251. while ( (b = b.parentNode) ) {
  1252. if ( b === a ) {
  1253. return true;
  1254. }
  1255. }
  1256. }
  1257. return false;
  1258. };
  1259. /* Sorting
  1260. ---------------------------------------------------------------------- */
  1261. // Document order sorting
  1262. sortOrder = hasCompare ?
  1263. function( a, b ) {
  1264. // Flag for duplicate removal
  1265. if ( a === b ) {
  1266. hasDuplicate = true;
  1267. return 0;
  1268. }
  1269. // Sort on method existence if only one input has compareDocumentPosition
  1270. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1271. if ( compare ) {
  1272. return compare;
  1273. }
  1274. // Calculate position if both inputs belong to the same document
  1275. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1276. a.compareDocumentPosition( b ) :
  1277. // Otherwise we know they are disconnected
  1278. 1;
  1279. // Disconnected nodes
  1280. if ( compare & 1 ||
  1281. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1282. // Choose the first element that is related to our preferred document
  1283. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1284. return -1;
  1285. }
  1286. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1287. return 1;
  1288. }
  1289. // Maintain original order
  1290. return sortInput ?
  1291. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1292. 0;
  1293. }
  1294. return compare & 4 ? -1 : 1;
  1295. } :
  1296. function( a, b ) {
  1297. // Exit early if the nodes are identical
  1298. if ( a === b ) {
  1299. hasDuplicate = true;
  1300. return 0;
  1301. }
  1302. var cur,
  1303. i = 0,
  1304. aup = a.parentNode,
  1305. bup = b.parentNode,
  1306. ap = [ a ],
  1307. bp = [ b ];
  1308. // Parentless nodes are either documents or disconnected
  1309. if ( !aup || !bup ) {
  1310. return a === document ? -1 :
  1311. b === document ? 1 :
  1312. aup ? -1 :
  1313. bup ? 1 :
  1314. sortInput ?
  1315. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1316. 0;
  1317. // If the nodes are siblings, we can do a quick check
  1318. } else if ( aup === bup ) {
  1319. return siblingCheck( a, b );
  1320. }
  1321. // Otherwise we need full lists of their ancestors for comparison
  1322. cur = a;
  1323. while ( (cur = cur.parentNode) ) {
  1324. ap.unshift( cur );
  1325. }
  1326. cur = b;
  1327. while ( (cur = cur.parentNode) ) {
  1328. bp.unshift( cur );
  1329. }
  1330. // Walk down the tree looking for a discrepancy
  1331. while ( ap[i] === bp[i] ) {
  1332. i++;
  1333. }
  1334. return i ?
  1335. // Do a sibling check if the nodes have a common ancestor
  1336. siblingCheck( ap[i], bp[i] ) :
  1337. // Otherwise nodes in our document sort first
  1338. ap[i] === preferredDoc ? -1 :
  1339. bp[i] === preferredDoc ? 1 :
  1340. 0;
  1341. };
  1342. return document;
  1343. };
  1344. Sizzle.matches = function( expr, elements ) {
  1345. return Sizzle( expr, null, null, elements );
  1346. };
  1347. Sizzle.matchesSelector = function( elem, expr ) {
  1348. // Set document vars if needed
  1349. if ( ( elem.ownerDocument || elem ) !== document ) {
  1350. setDocument( elem );
  1351. }
  1352. // Make sure that attribute selectors are quoted
  1353. expr = expr.replace( rattributeQuotes, "='$1']" );
  1354. if ( support.matchesSelector && documentIsHTML &&
  1355. !compilerCache[ expr + " " ] &&
  1356. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1357. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1358. try {
  1359. var ret = matches.call( elem, expr );
  1360. // IE 9's matchesSelector returns false on disconnected nodes
  1361. if ( ret || support.disconnectedMatch ||
  1362. // As well, disconnected nodes are said to be in a document
  1363. // fragment in IE 9
  1364. elem.document && elem.document.nodeType !== 11 ) {
  1365. return ret;
  1366. }
  1367. } catch (e) {}
  1368. }
  1369. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1370. };
  1371. Sizzle.contains = function( context, elem ) {
  1372. // Set document vars if needed
  1373. if ( ( context.ownerDocument || context ) !== document ) {
  1374. setDocument( context );
  1375. }
  1376. return contains( context, elem );
  1377. };
  1378. Sizzle.attr = function( elem, name ) {
  1379. // Set document vars if needed
  1380. if ( ( elem.ownerDocument || elem ) !== document ) {
  1381. setDocument( elem );
  1382. }
  1383. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1384. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1385. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1386. fn( elem, name, !documentIsHTML ) :
  1387. undefined;
  1388. return val !== undefined ?
  1389. val :
  1390. support.attributes || !documentIsHTML ?
  1391. elem.getAttribute( name ) :
  1392. (val = elem.getAttributeNode(name)) && val.specified ?
  1393. val.value :
  1394. null;
  1395. };
  1396. Sizzle.escape = function( sel ) {
  1397. return (sel + "").replace( rcssescape, fcssescape );
  1398. };
  1399. Sizzle.error = function( msg ) {
  1400. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1401. };
  1402. /**
  1403. * Document sorting and removing duplicates
  1404. * @param {ArrayLike} results
  1405. */
  1406. Sizzle.uniqueSort = function( results ) {
  1407. var elem,
  1408. duplicates = [],
  1409. j = 0,
  1410. i = 0;
  1411. // Unless we *know* we can detect duplicates, assume their presence
  1412. hasDuplicate = !support.detectDuplicates;
  1413. sortInput = !support.sortStable && results.slice( 0 );
  1414. results.sort( sortOrder );
  1415. if ( hasDuplicate ) {
  1416. while ( (elem = results[i++]) ) {
  1417. if ( elem === results[ i ] ) {
  1418. j = duplicates.push( i );
  1419. }
  1420. }
  1421. while ( j-- ) {
  1422. results.splice( duplicates[ j ], 1 );
  1423. }
  1424. }
  1425. // Clear input after sorting to release objects
  1426. // See https://github.com/jquery/sizzle/pull/225
  1427. sortInput = null;
  1428. return results;
  1429. };
  1430. /**
  1431. * Utility function for retrieving the text value of an array of DOM nodes
  1432. * @param {Array|Element} elem
  1433. */
  1434. getText = Sizzle.getText = function( elem ) {
  1435. var node,
  1436. ret = "",
  1437. i = 0,
  1438. nodeType = elem.nodeType;
  1439. if ( !nodeType ) {
  1440. // If no nodeType, this is expected to be an array
  1441. while ( (node = elem[i++]) ) {
  1442. // Do not traverse comment nodes
  1443. ret += getText( node );
  1444. }
  1445. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1446. // Use textContent for elements
  1447. // innerText usage removed for consistency of new lines (jQuery #11153)
  1448. if ( typeof elem.textContent === "string" ) {
  1449. return elem.textContent;
  1450. } else {
  1451. // Traverse its children
  1452. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1453. ret += getText( elem );
  1454. }
  1455. }
  1456. } else if ( nodeType === 3 || nodeType === 4 ) {
  1457. return elem.nodeValue;
  1458. }
  1459. // Do not include comment or processing instruction nodes
  1460. return ret;
  1461. };
  1462. Expr = Sizzle.selectors = {
  1463. // Can be adjusted by the user
  1464. cacheLength: 50,
  1465. createPseudo: markFunction,
  1466. match: matchExpr,
  1467. attrHandle: {},
  1468. find: {},
  1469. relative: {
  1470. ">": { dir: "parentNode", first: true },
  1471. " ": { dir: "parentNode" },
  1472. "+": { dir: "previousSibling", first: true },
  1473. "~": { dir: "previousSibling" }
  1474. },
  1475. preFilter: {
  1476. "ATTR": function( match ) {
  1477. match[1] = match[1].replace( runescape, funescape );
  1478. // Move the given value to match[3] whether quoted or unquoted
  1479. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1480. if ( match[2] === "~=" ) {
  1481. match[3] = " " + match[3] + " ";
  1482. }
  1483. return match.slice( 0, 4 );
  1484. },
  1485. "CHILD": function( match ) {
  1486. /* matches from matchExpr["CHILD"]
  1487. 1 type (only|nth|...)
  1488. 2 what (child|of-type)
  1489. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1490. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1491. 5 sign of xn-component
  1492. 6 x of xn-component
  1493. 7 sign of y-component
  1494. 8 y of y-component
  1495. */
  1496. match[1] = match[1].toLowerCase();
  1497. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1498. // nth-* requires argument
  1499. if ( !match[3] ) {
  1500. Sizzle.error( match[0] );
  1501. }
  1502. // numeric x and y parameters for Expr.filter.CHILD
  1503. // remember that false/true cast respectively to 0/1
  1504. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1505. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1506. // other types prohibit arguments
  1507. } else if ( match[3] ) {
  1508. Sizzle.error( match[0] );
  1509. }
  1510. return match;
  1511. },
  1512. "PSEUDO": function( match ) {
  1513. var excess,
  1514. unquoted = !match[6] && match[2];
  1515. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1516. return null;
  1517. }
  1518. // Accept quoted arguments as-is
  1519. if ( match[3] ) {
  1520. match[2] = match[4] || match[5] || "";
  1521. // Strip excess characters from unquoted arguments
  1522. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1523. // Get excess from tokenize (recursively)
  1524. (excess = tokenize( unquoted, true )) &&
  1525. // advance to the next closing parenthesis
  1526. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1527. // excess is a negative index
  1528. match[0] = match[0].slice( 0, excess );
  1529. match[2] = unquoted.slice( 0, excess );
  1530. }
  1531. // Return only captures needed by the pseudo filter method (type and argument)
  1532. return match.slice( 0, 3 );
  1533. }
  1534. },
  1535. filter: {
  1536. "TAG": function( nodeNameSelector ) {
  1537. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1538. return nodeNameSelector === "*" ?
  1539. function() { return true; } :
  1540. function( elem ) {
  1541. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1542. };
  1543. },
  1544. "CLASS": function( className ) {
  1545. var pattern = classCache[ className + " " ];
  1546. return pattern ||
  1547. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1548. classCache( className, function( elem ) {
  1549. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  1550. });
  1551. },
  1552. "ATTR": function( name, operator, check ) {
  1553. return function( elem ) {
  1554. var result = Sizzle.attr( elem, name );
  1555. if ( result == null ) {
  1556. return operator === "!=";
  1557. }
  1558. if ( !operator ) {
  1559. return true;
  1560. }
  1561. result += "";
  1562. return operator === "=" ? result === check :
  1563. operator === "!=" ? result !== check :
  1564. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1565. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1566. operator === "$=" ? check && result.slice( -check.length ) === check :
  1567. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1568. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1569. false;
  1570. };
  1571. },
  1572. "CHILD": function( type, what, argument, first, last ) {
  1573. var simple = type.slice( 0, 3 ) !== "nth",
  1574. forward = type.slice( -4 ) !== "last",
  1575. ofType = what === "of-type";
  1576. return first === 1 && last === 0 ?
  1577. // Shortcut for :nth-*(n)
  1578. function( elem ) {
  1579. return !!elem.parentNode;
  1580. } :
  1581. function( elem, context, xml ) {
  1582. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1583. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1584. parent = elem.parentNode,
  1585. name = ofType && elem.nodeName.toLowerCase(),
  1586. useCache = !xml && !ofType,
  1587. diff = false;
  1588. if ( parent ) {
  1589. // :(first|last|only)-(child|of-type)
  1590. if ( simple ) {
  1591. while ( dir ) {
  1592. node = elem;
  1593. while ( (node = node[ dir ]) ) {
  1594. if ( ofType ?
  1595. node.nodeName.toLowerCase() === name :
  1596. node.nodeType === 1 ) {
  1597. return false;
  1598. }
  1599. }
  1600. // Reverse direction for :only-* (if we haven't yet done so)
  1601. start = dir = type === "only" && !start && "nextSibling";
  1602. }
  1603. return true;
  1604. }
  1605. start = [ forward ? parent.firstChild : parent.lastChild ];
  1606. // non-xml :nth-child(...) stores cache data on `parent`
  1607. if ( forward && useCache ) {
  1608. // Seek `elem` from a previously-cached index
  1609. // ...in a gzip-friendly way
  1610. node = parent;
  1611. outerCache = node[ expando ] || (node[ expando ] = {});
  1612. // Support: IE <9 only
  1613. // Defend against cloned attroperties (jQuery gh-1709)
  1614. uniqueCache = outerCache[ node.uniqueID ] ||
  1615. (outerCache[ node.uniqueID ] = {});
  1616. cache = uniqueCache[ type ] || [];
  1617. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1618. diff = nodeIndex && cache[ 2 ];
  1619. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1620. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1621. // Fallback to seeking `elem` from the start
  1622. (diff = nodeIndex = 0) || start.pop()) ) {
  1623. // When found, cache indexes on `parent` and break
  1624. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1625. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1626. break;
  1627. }
  1628. }
  1629. } else {
  1630. // Use previously-cached element index if available
  1631. if ( useCache ) {
  1632. // ...in a gzip-friendly way
  1633. node = elem;
  1634. outerCache = node[ expando ] || (node[ expando ] = {});
  1635. // Support: IE <9 only
  1636. // Defend against cloned attroperties (jQuery gh-1709)
  1637. uniqueCache = outerCache[ node.uniqueID ] ||
  1638. (outerCache[ node.uniqueID ] = {});
  1639. cache = uniqueCache[ type ] || [];
  1640. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1641. diff = nodeIndex;
  1642. }
  1643. // xml :nth-child(...)
  1644. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1645. if ( diff === false ) {
  1646. // Use the same loop as above to seek `elem` from the start
  1647. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1648. (diff = nodeIndex = 0) || start.pop()) ) {
  1649. if ( ( ofType ?
  1650. node.nodeName.toLowerCase() === name :
  1651. node.nodeType === 1 ) &&
  1652. ++diff ) {
  1653. // Cache the index of each encountered element
  1654. if ( useCache ) {
  1655. outerCache = node[ expando ] || (node[ expando ] = {});
  1656. // Support: IE <9 only
  1657. // Defend against cloned attroperties (jQuery gh-1709)
  1658. uniqueCache = outerCache[ node.uniqueID ] ||
  1659. (outerCache[ node.uniqueID ] = {});
  1660. uniqueCache[ type ] = [ dirruns, diff ];
  1661. }
  1662. if ( node === elem ) {
  1663. break;
  1664. }
  1665. }
  1666. }
  1667. }
  1668. }
  1669. // Incorporate the offset, then check against cycle size
  1670. diff -= last;
  1671. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1672. }
  1673. };
  1674. },
  1675. "PSEUDO": function( pseudo, argument ) {
  1676. // pseudo-class names are case-insensitive
  1677. // http://www.w3.org/TR/selectors/#pseudo-classes
  1678. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1679. // Remember that setFilters inherits from pseudos
  1680. var args,
  1681. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1682. Sizzle.error( "unsupported pseudo: " + pseudo );
  1683. // The user may use createPseudo to indicate that
  1684. // arguments are needed to create the filter function
  1685. // just as Sizzle does
  1686. if ( fn[ expando ] ) {
  1687. return fn( argument );
  1688. }
  1689. // But maintain support for old signatures
  1690. if ( fn.length > 1 ) {
  1691. args = [ pseudo, pseudo, "", argument ];
  1692. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1693. markFunction(function( seed, matches ) {
  1694. var idx,
  1695. matched = fn( seed, argument ),
  1696. i = matched.length;
  1697. while ( i-- ) {
  1698. idx = indexOf( seed, matched[i] );
  1699. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1700. }
  1701. }) :
  1702. function( elem ) {
  1703. return fn( elem, 0, args );
  1704. };
  1705. }
  1706. return fn;
  1707. }
  1708. },
  1709. pseudos: {
  1710. // Potentially complex pseudos
  1711. "not": markFunction(function( selector ) {
  1712. // Trim the selector passed to compile
  1713. // to avoid treating leading and trailing
  1714. // spaces as combinators
  1715. var input = [],
  1716. results = [],
  1717. matcher = compile( selector.replace( rtrim, "$1" ) );
  1718. return matcher[ expando ] ?
  1719. markFunction(function( seed, matches, context, xml ) {
  1720. var elem,
  1721. unmatched = matcher( seed, null, xml, [] ),
  1722. i = seed.length;
  1723. // Match elements unmatched by `matcher`
  1724. while ( i-- ) {
  1725. if ( (elem = unmatched[i]) ) {
  1726. seed[i] = !(matches[i] = elem);
  1727. }
  1728. }
  1729. }) :
  1730. function( elem, context, xml ) {
  1731. input[0] = elem;
  1732. matcher( input, null, xml, results );
  1733. // Don't keep the element (issue #299)
  1734. input[0] = null;
  1735. return !results.pop();
  1736. };
  1737. }),
  1738. "has": markFunction(function( selector ) {
  1739. return function( elem ) {
  1740. return Sizzle( selector, elem ).length > 0;
  1741. };
  1742. }),
  1743. "contains": markFunction(function( text ) {
  1744. text = text.replace( runescape, funescape );
  1745. return function( elem ) {
  1746. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1747. };
  1748. }),
  1749. // "Whether an element is represented by a :lang() selector
  1750. // is based solely on the element's language value
  1751. // being equal to the identifier C,
  1752. // or beginning with the identifier C immediately followed by "-".
  1753. // The matching of C against the element's language value is performed case-insensitively.
  1754. // The identifier C does not have to be a valid language name."
  1755. // http://www.w3.org/TR/selectors/#lang-pseudo
  1756. "lang": markFunction( function( lang ) {
  1757. // lang value must be a valid identifier
  1758. if ( !ridentifier.test(lang || "") ) {
  1759. Sizzle.error( "unsupported lang: " + lang );
  1760. }
  1761. lang = lang.replace( runescape, funescape ).toLowerCase();
  1762. return function( elem ) {
  1763. var elemLang;
  1764. do {
  1765. if ( (elemLang = documentIsHTML ?
  1766. elem.lang :
  1767. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1768. elemLang = elemLang.toLowerCase();
  1769. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1770. }
  1771. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1772. return false;
  1773. };
  1774. }),
  1775. // Miscellaneous
  1776. "target": function( elem ) {
  1777. var hash = window.location && window.location.hash;
  1778. return hash && hash.slice( 1 ) === elem.id;
  1779. },
  1780. "root": function( elem ) {
  1781. return elem === docElem;
  1782. },
  1783. "focus": function( elem ) {
  1784. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1785. },
  1786. // Boolean properties
  1787. "enabled": createDisabledPseudo( false ),
  1788. "disabled": createDisabledPseudo( true ),
  1789. "checked": function( elem ) {
  1790. // In CSS3, :checked should return both checked and selected elements
  1791. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1792. var nodeName = elem.nodeName.toLowerCase();
  1793. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1794. },
  1795. "selected": function( elem ) {
  1796. // Accessing this property makes selected-by-default
  1797. // options in Safari work properly
  1798. if ( elem.parentNode ) {
  1799. elem.parentNode.selectedIndex;
  1800. }
  1801. return elem.selected === true;
  1802. },
  1803. // Contents
  1804. "empty": function( elem ) {
  1805. // http://www.w3.org/TR/selectors/#empty-pseudo
  1806. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1807. // but not by others (comment: 8; processing instruction: 7; etc.)
  1808. // nodeType < 6 works because attributes (2) do not appear as children
  1809. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1810. if ( elem.nodeType < 6 ) {
  1811. return false;
  1812. }
  1813. }
  1814. return true;
  1815. },
  1816. "parent": function( elem ) {
  1817. return !Expr.pseudos["empty"]( elem );
  1818. },
  1819. // Element/input types
  1820. "header": function( elem ) {
  1821. return rheader.test( elem.nodeName );
  1822. },
  1823. "input": function( elem ) {
  1824. return rinputs.test( elem.nodeName );
  1825. },
  1826. "button": function( elem ) {
  1827. var name = elem.nodeName.toLowerCase();
  1828. return name === "input" && elem.type === "button" || name === "button";
  1829. },
  1830. "text": function( elem ) {
  1831. var attr;
  1832. return elem.nodeName.toLowerCase() === "input" &&
  1833. elem.type === "text" &&
  1834. // Support: IE<8
  1835. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1836. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1837. },
  1838. // Position-in-collection
  1839. "first": createPositionalPseudo(function() {
  1840. return [ 0 ];
  1841. }),
  1842. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1843. return [ length - 1 ];
  1844. }),
  1845. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1846. return [ argument < 0 ? argument + length : argument ];
  1847. }),
  1848. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1849. var i = 0;
  1850. for ( ; i < length; i += 2 ) {
  1851. matchIndexes.push( i );
  1852. }
  1853. return matchIndexes;
  1854. }),
  1855. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1856. var i = 1;
  1857. for ( ; i < length; i += 2 ) {
  1858. matchIndexes.push( i );
  1859. }
  1860. return matchIndexes;
  1861. }),
  1862. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1863. var i = argument < 0 ? argument + length : argument;
  1864. for ( ; --i >= 0; ) {
  1865. matchIndexes.push( i );
  1866. }
  1867. return matchIndexes;
  1868. }),
  1869. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1870. var i = argument < 0 ? argument + length : argument;
  1871. for ( ; ++i < length; ) {
  1872. matchIndexes.push( i );
  1873. }
  1874. return matchIndexes;
  1875. })
  1876. }
  1877. };
  1878. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1879. // Add button/input type pseudos
  1880. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1881. Expr.pseudos[ i ] = createInputPseudo( i );
  1882. }
  1883. for ( i in { submit: true, reset: true } ) {
  1884. Expr.pseudos[ i ] = createButtonPseudo( i );
  1885. }
  1886. // Easy API for creating new setFilters
  1887. function setFilters() {}
  1888. setFilters.prototype = Expr.filters = Expr.pseudos;
  1889. Expr.setFilters = new setFilters();
  1890. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1891. var matched, match, tokens, type,
  1892. soFar, groups, preFilters,
  1893. cached = tokenCache[ selector + " " ];
  1894. if ( cached ) {
  1895. return parseOnly ? 0 : cached.slice( 0 );
  1896. }
  1897. soFar = selector;
  1898. groups = [];
  1899. preFilters = Expr.preFilter;
  1900. while ( soFar ) {
  1901. // Comma and first run
  1902. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1903. if ( match ) {
  1904. // Don't consume trailing commas as valid
  1905. soFar = soFar.slice( match[0].length ) || soFar;
  1906. }
  1907. groups.push( (tokens = []) );
  1908. }
  1909. matched = false;
  1910. // Combinators
  1911. if ( (match = rcombinators.exec( soFar )) ) {
  1912. matched = match.shift();
  1913. tokens.push({
  1914. value: matched,
  1915. // Cast descendant combinators to space
  1916. type: match[0].replace( rtrim, " " )
  1917. });
  1918. soFar = soFar.slice( matched.length );
  1919. }
  1920. // Filters
  1921. for ( type in Expr.filter ) {
  1922. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1923. (match = preFilters[ type ]( match ))) ) {
  1924. matched = match.shift();
  1925. tokens.push({
  1926. value: matched,
  1927. type: type,
  1928. matches: match
  1929. });
  1930. soFar = soFar.slice( matched.length );
  1931. }
  1932. }
  1933. if ( !matched ) {
  1934. break;
  1935. }
  1936. }
  1937. // Return the length of the invalid excess
  1938. // if we're just parsing
  1939. // Otherwise, throw an error or return tokens
  1940. return parseOnly ?
  1941. soFar.length :
  1942. soFar ?
  1943. Sizzle.error( selector ) :
  1944. // Cache the tokens
  1945. tokenCache( selector, groups ).slice( 0 );
  1946. };
  1947. function toSelector( tokens ) {
  1948. var i = 0,
  1949. len = tokens.length,
  1950. selector = "";
  1951. for ( ; i < len; i++ ) {
  1952. selector += tokens[i].value;
  1953. }
  1954. return selector;
  1955. }
  1956. function addCombinator( matcher, combinator, base ) {
  1957. var dir = combinator.dir,
  1958. skip = combinator.next,
  1959. key = skip || dir,
  1960. checkNonElements = base && key === "parentNode",
  1961. doneName = done++;
  1962. return combinator.first ?
  1963. // Check against closest ancestor/preceding element
  1964. function( elem, context, xml ) {
  1965. while ( (elem = elem[ dir ]) ) {
  1966. if ( elem.nodeType === 1 || checkNonElements ) {
  1967. return matcher( elem, context, xml );
  1968. }
  1969. }
  1970. return false;
  1971. } :
  1972. // Check against all ancestor/preceding elements
  1973. function( elem, context, xml ) {
  1974. var oldCache, uniqueCache, outerCache,
  1975. newCache = [ dirruns, doneName ];
  1976. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1977. if ( xml ) {
  1978. while ( (elem = elem[ dir ]) ) {
  1979. if ( elem.nodeType === 1 || checkNonElements ) {
  1980. if ( matcher( elem, context, xml ) ) {
  1981. return true;
  1982. }
  1983. }
  1984. }
  1985. } else {
  1986. while ( (elem = elem[ dir ]) ) {
  1987. if ( elem.nodeType === 1 || checkNonElements ) {
  1988. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1989. // Support: IE <9 only
  1990. // Defend against cloned attroperties (jQuery gh-1709)
  1991. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  1992. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  1993. elem = elem[ dir ] || elem;
  1994. } else if ( (oldCache = uniqueCache[ key ]) &&
  1995. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1996. // Assign to newCache so results back-propagate to previous elements
  1997. return (newCache[ 2 ] = oldCache[ 2 ]);
  1998. } else {
  1999. // Reuse newcache so results back-propagate to previous elements
  2000. uniqueCache[ key ] = newCache;
  2001. // A match means we're done; a fail means we have to keep checking
  2002. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  2003. return true;
  2004. }
  2005. }
  2006. }
  2007. }
  2008. }
  2009. return false;
  2010. };
  2011. }
  2012. function elementMatcher( matchers ) {
  2013. return matchers.length > 1 ?
  2014. function( elem, context, xml ) {
  2015. var i = matchers.length;
  2016. while ( i-- ) {
  2017. if ( !matchers[i]( elem, context, xml ) ) {
  2018. return false;
  2019. }
  2020. }
  2021. return true;
  2022. } :
  2023. matchers[0];
  2024. }
  2025. function multipleContexts( selector, contexts, results ) {
  2026. var i = 0,
  2027. len = contexts.length;
  2028. for ( ; i < len; i++ ) {
  2029. Sizzle( selector, contexts[i], results );
  2030. }
  2031. return results;
  2032. }
  2033. function condense( unmatched, map, filter, context, xml ) {
  2034. var elem,
  2035. newUnmatched = [],
  2036. i = 0,
  2037. len = unmatched.length,
  2038. mapped = map != null;
  2039. for ( ; i < len; i++ ) {
  2040. if ( (elem = unmatched[i]) ) {
  2041. if ( !filter || filter( elem, context, xml ) ) {
  2042. newUnmatched.push( elem );
  2043. if ( mapped ) {
  2044. map.push( i );
  2045. }
  2046. }
  2047. }
  2048. }
  2049. return newUnmatched;
  2050. }
  2051. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  2052. if ( postFilter && !postFilter[ expando ] ) {
  2053. postFilter = setMatcher( postFilter );
  2054. }
  2055. if ( postFinder && !postFinder[ expando ] ) {
  2056. postFinder = setMatcher( postFinder, postSelector );
  2057. }
  2058. return markFunction(function( seed, results, context, xml ) {
  2059. var temp, i, elem,
  2060. preMap = [],
  2061. postMap = [],
  2062. preexisting = results.length,
  2063. // Get initial elements from seed or context
  2064. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  2065. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  2066. matcherIn = preFilter && ( seed || !selector ) ?
  2067. condense( elems, preMap, preFilter, context, xml ) :
  2068. elems,
  2069. matcherOut = matcher ?
  2070. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  2071. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  2072. // ...intermediate processing is necessary
  2073. [] :
  2074. // ...otherwise use results directly
  2075. results :
  2076. matcherIn;
  2077. // Find primary matches
  2078. if ( matcher ) {
  2079. matcher( matcherIn, matcherOut, context, xml );
  2080. }
  2081. // Apply postFilter
  2082. if ( postFilter ) {
  2083. temp = condense( matcherOut, postMap );
  2084. postFilter( temp, [], context, xml );
  2085. // Un-match failing elements by moving them back to matcherIn
  2086. i = temp.length;
  2087. while ( i-- ) {
  2088. if ( (elem = temp[i]) ) {
  2089. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  2090. }
  2091. }
  2092. }
  2093. if ( seed ) {
  2094. if ( postFinder || preFilter ) {
  2095. if ( postFinder ) {
  2096. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  2097. temp = [];
  2098. i = matcherOut.length;
  2099. while ( i-- ) {
  2100. if ( (elem = matcherOut[i]) ) {
  2101. // Restore matcherIn since elem is not yet a final match
  2102. temp.push( (matcherIn[i] = elem) );
  2103. }
  2104. }
  2105. postFinder( null, (matcherOut = []), temp, xml );
  2106. }
  2107. // Move matched elements from seed to results to keep them synchronized
  2108. i = matcherOut.length;
  2109. while ( i-- ) {
  2110. if ( (elem = matcherOut[i]) &&
  2111. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  2112. seed[temp] = !(results[temp] = elem);
  2113. }
  2114. }
  2115. }
  2116. // Add elements to results, through postFinder if defined
  2117. } else {
  2118. matcherOut = condense(
  2119. matcherOut === results ?
  2120. matcherOut.splice( preexisting, matcherOut.length ) :
  2121. matcherOut
  2122. );
  2123. if ( postFinder ) {
  2124. postFinder( null, results, matcherOut, xml );
  2125. } else {
  2126. push.apply( results, matcherOut );
  2127. }
  2128. }
  2129. });
  2130. }
  2131. function matcherFromTokens( tokens ) {
  2132. var checkContext, matcher, j,
  2133. len = tokens.length,
  2134. leadingRelative = Expr.relative[ tokens[0].type ],
  2135. implicitRelative = leadingRelative || Expr.relative[" "],
  2136. i = leadingRelative ? 1 : 0,
  2137. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2138. matchContext = addCombinator( function( elem ) {
  2139. return elem === checkContext;
  2140. }, implicitRelative, true ),
  2141. matchAnyContext = addCombinator( function( elem ) {
  2142. return indexOf( checkContext, elem ) > -1;
  2143. }, implicitRelative, true ),
  2144. matchers = [ function( elem, context, xml ) {
  2145. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2146. (checkContext = context).nodeType ?
  2147. matchContext( elem, context, xml ) :
  2148. matchAnyContext( elem, context, xml ) );
  2149. // Avoid hanging onto element (issue #299)
  2150. checkContext = null;
  2151. return ret;
  2152. } ];
  2153. for ( ; i < len; i++ ) {
  2154. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  2155. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  2156. } else {
  2157. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  2158. // Return special upon seeing a positional matcher
  2159. if ( matcher[ expando ] ) {
  2160. // Find the next relative operator (if any) for proper handling
  2161. j = ++i;
  2162. for ( ; j < len; j++ ) {
  2163. if ( Expr.relative[ tokens[j].type ] ) {
  2164. break;
  2165. }
  2166. }
  2167. return setMatcher(
  2168. i > 1 && elementMatcher( matchers ),
  2169. i > 1 && toSelector(
  2170. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2171. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  2172. ).replace( rtrim, "$1" ),
  2173. matcher,
  2174. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2175. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  2176. j < len && toSelector( tokens )
  2177. );
  2178. }
  2179. matchers.push( matcher );
  2180. }
  2181. }
  2182. return elementMatcher( matchers );
  2183. }
  2184. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2185. var bySet = setMatchers.length > 0,
  2186. byElement = elementMatchers.length > 0,
  2187. superMatcher = function( seed, context, xml, results, outermost ) {
  2188. var elem, j, matcher,
  2189. matchedCount = 0,
  2190. i = "0",
  2191. unmatched = seed && [],
  2192. setMatched = [],
  2193. contextBackup = outermostContext,
  2194. // We must always have either seed elements or outermost context
  2195. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  2196. // Use integer dirruns iff this is the outermost matcher
  2197. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  2198. len = elems.length;
  2199. if ( outermost ) {
  2200. outermostContext = context === document || context || outermost;
  2201. }
  2202. // Add elements passing elementMatchers directly to results
  2203. // Support: IE<9, Safari
  2204. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2205. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  2206. if ( byElement && elem ) {
  2207. j = 0;
  2208. if ( !context && elem.ownerDocument !== document ) {
  2209. setDocument( elem );
  2210. xml = !documentIsHTML;
  2211. }
  2212. while ( (matcher = elementMatchers[j++]) ) {
  2213. if ( matcher( elem, context || document, xml) ) {
  2214. results.push( elem );
  2215. break;
  2216. }
  2217. }
  2218. if ( outermost ) {
  2219. dirruns = dirrunsUnique;
  2220. }
  2221. }
  2222. // Track unmatched elements for set filters
  2223. if ( bySet ) {
  2224. // They will have gone through all possible matchers
  2225. if ( (elem = !matcher && elem) ) {
  2226. matchedCount--;
  2227. }
  2228. // Lengthen the array for every element, matched or not
  2229. if ( seed ) {
  2230. unmatched.push( elem );
  2231. }
  2232. }
  2233. }
  2234. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2235. // makes the latter nonnegative.
  2236. matchedCount += i;
  2237. // Apply set filters to unmatched elements
  2238. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2239. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2240. // no element matchers and no seed.
  2241. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2242. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2243. // numerically zero.
  2244. if ( bySet && i !== matchedCount ) {
  2245. j = 0;
  2246. while ( (matcher = setMatchers[j++]) ) {
  2247. matcher( unmatched, setMatched, context, xml );
  2248. }
  2249. if ( seed ) {
  2250. // Reintegrate element matches to eliminate the need for sorting
  2251. if ( matchedCount > 0 ) {
  2252. while ( i-- ) {
  2253. if ( !(unmatched[i] || setMatched[i]) ) {
  2254. setMatched[i] = pop.call( results );
  2255. }
  2256. }
  2257. }
  2258. // Discard index placeholder values to get only actual matches
  2259. setMatched = condense( setMatched );
  2260. }
  2261. // Add matches to results
  2262. push.apply( results, setMatched );
  2263. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2264. if ( outermost && !seed && setMatched.length > 0 &&
  2265. ( matchedCount + setMatchers.length ) > 1 ) {
  2266. Sizzle.uniqueSort( results );
  2267. }
  2268. }
  2269. // Override manipulation of globals by nested matchers
  2270. if ( outermost ) {
  2271. dirruns = dirrunsUnique;
  2272. outermostContext = contextBackup;
  2273. }
  2274. return unmatched;
  2275. };
  2276. return bySet ?
  2277. markFunction( superMatcher ) :
  2278. superMatcher;
  2279. }
  2280. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2281. var i,
  2282. setMatchers = [],
  2283. elementMatchers = [],
  2284. cached = compilerCache[ selector + " " ];
  2285. if ( !cached ) {
  2286. // Generate a function of recursive functions that can be used to check each element
  2287. if ( !match ) {
  2288. match = tokenize( selector );
  2289. }
  2290. i = match.length;
  2291. while ( i-- ) {
  2292. cached = matcherFromTokens( match[i] );
  2293. if ( cached[ expando ] ) {
  2294. setMatchers.push( cached );
  2295. } else {
  2296. elementMatchers.push( cached );
  2297. }
  2298. }
  2299. // Cache the compiled function
  2300. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2301. // Save selector and tokenization
  2302. cached.selector = selector;
  2303. }
  2304. return cached;
  2305. };
  2306. /**
  2307. * A low-level selection function that works with Sizzle's compiled
  2308. * selector functions
  2309. * @param {String|Function} selector A selector or a pre-compiled
  2310. * selector function built with Sizzle.compile
  2311. * @param {Element} context
  2312. * @param {Array} [results]
  2313. * @param {Array} [seed] A set of elements to match against
  2314. */
  2315. select = Sizzle.select = function( selector, context, results, seed ) {
  2316. var i, tokens, token, type, find,
  2317. compiled = typeof selector === "function" && selector,
  2318. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2319. results = results || [];
  2320. // Try to minimize operations if there is only one selector in the list and no seed
  2321. // (the latter of which guarantees us context)
  2322. if ( match.length === 1 ) {
  2323. // Reduce context if the leading compound selector is an ID
  2324. tokens = match[0] = match[0].slice( 0 );
  2325. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2326. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  2327. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2328. if ( !context ) {
  2329. return results;
  2330. // Precompiled matchers will still verify ancestry, so step up a level
  2331. } else if ( compiled ) {
  2332. context = context.parentNode;
  2333. }
  2334. selector = selector.slice( tokens.shift().value.length );
  2335. }
  2336. // Fetch a seed set for right-to-left matching
  2337. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2338. while ( i-- ) {
  2339. token = tokens[i];
  2340. // Abort if we hit a combinator
  2341. if ( Expr.relative[ (type = token.type) ] ) {
  2342. break;
  2343. }
  2344. if ( (find = Expr.find[ type ]) ) {
  2345. // Search, expanding context for leading sibling combinators
  2346. if ( (seed = find(
  2347. token.matches[0].replace( runescape, funescape ),
  2348. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2349. )) ) {
  2350. // If seed is empty or no tokens remain, we can return early
  2351. tokens.splice( i, 1 );
  2352. selector = seed.length && toSelector( tokens );
  2353. if ( !selector ) {
  2354. push.apply( results, seed );
  2355. return results;
  2356. }
  2357. break;
  2358. }
  2359. }
  2360. }
  2361. }
  2362. // Compile and execute a filtering function if one is not provided
  2363. // Provide `match` to avoid retokenization if we modified the selector above
  2364. ( compiled || compile( selector, match ) )(
  2365. seed,
  2366. context,
  2367. !documentIsHTML,
  2368. results,
  2369. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2370. );
  2371. return results;
  2372. };
  2373. // One-time assignments
  2374. // Sort stability
  2375. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2376. // Support: Chrome 14-35+
  2377. // Always assume duplicates if they aren't passed to the comparison function
  2378. support.detectDuplicates = !!hasDuplicate;
  2379. // Initialize against the default document
  2380. setDocument();
  2381. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2382. // Detached nodes confoundingly follow *each other*
  2383. support.sortDetached = assert(function( el ) {
  2384. // Should return 1, but returns 4 (following)
  2385. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  2386. });
  2387. // Support: IE<8
  2388. // Prevent attribute/property "interpolation"
  2389. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2390. if ( !assert(function( el ) {
  2391. el.innerHTML = "<a href='#'></a>";
  2392. return el.firstChild.getAttribute("href") === "#" ;
  2393. }) ) {
  2394. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2395. if ( !isXML ) {
  2396. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2397. }
  2398. });
  2399. }
  2400. // Support: IE<9
  2401. // Use defaultValue in place of getAttribute("value")
  2402. if ( !support.attributes || !assert(function( el ) {
  2403. el.innerHTML = "<input/>";
  2404. el.firstChild.setAttribute( "value", "" );
  2405. return el.firstChild.getAttribute( "value" ) === "";
  2406. }) ) {
  2407. addHandle( "value", function( elem, name, isXML ) {
  2408. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2409. return elem.defaultValue;
  2410. }
  2411. });
  2412. }
  2413. // Support: IE<9
  2414. // Use getAttributeNode to fetch booleans when getAttribute lies
  2415. if ( !assert(function( el ) {
  2416. return el.getAttribute("disabled") == null;
  2417. }) ) {
  2418. addHandle( booleans, function( elem, name, isXML ) {
  2419. var val;
  2420. if ( !isXML ) {
  2421. return elem[ name ] === true ? name.toLowerCase() :
  2422. (val = elem.getAttributeNode( name )) && val.specified ?
  2423. val.value :
  2424. null;
  2425. }
  2426. });
  2427. }
  2428. return Sizzle;
  2429. })( window );
  2430. jQuery.find = Sizzle;
  2431. jQuery.expr = Sizzle.selectors;
  2432. // Deprecated
  2433. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2434. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2435. jQuery.text = Sizzle.getText;
  2436. jQuery.isXMLDoc = Sizzle.isXML;
  2437. jQuery.contains = Sizzle.contains;
  2438. jQuery.escapeSelector = Sizzle.escape;
  2439. var dir = function( elem, dir, until ) {
  2440. var matched = [],
  2441. truncate = until !== undefined;
  2442. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2443. if ( elem.nodeType === 1 ) {
  2444. if ( truncate && jQuery( elem ).is( until ) ) {
  2445. break;
  2446. }
  2447. matched.push( elem );
  2448. }
  2449. }
  2450. return matched;
  2451. };
  2452. var siblings = function( n, elem ) {
  2453. var matched = [];
  2454. for ( ; n; n = n.nextSibling ) {
  2455. if ( n.nodeType === 1 && n !== elem ) {
  2456. matched.push( n );
  2457. }
  2458. }
  2459. return matched;
  2460. };
  2461. var rneedsContext = jQuery.expr.match.needsContext;
  2462. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2463. var risSimple = /^.[^:#\[\.,]*$/;
  2464. // Implement the identical functionality for filter and not
  2465. function winnow( elements, qualifier, not ) {
  2466. if ( jQuery.isFunction( qualifier ) ) {
  2467. return jQuery.grep( elements, function( elem, i ) {
  2468. return !!qualifier.call( elem, i, elem ) !== not;
  2469. } );
  2470. }
  2471. // Single element
  2472. if ( qualifier.nodeType ) {
  2473. return jQuery.grep( elements, function( elem ) {
  2474. return ( elem === qualifier ) !== not;
  2475. } );
  2476. }
  2477. // Arraylike of elements (jQuery, arguments, Array)
  2478. if ( typeof qualifier !== "string" ) {
  2479. return jQuery.grep( elements, function( elem ) {
  2480. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2481. } );
  2482. }
  2483. // Simple selector that can be filtered directly, removing non-Elements
  2484. if ( risSimple.test( qualifier ) ) {
  2485. return jQuery.filter( qualifier, elements, not );
  2486. }
  2487. // Complex selector, compare the two sets, removing non-Elements
  2488. qualifier = jQuery.filter( qualifier, elements );
  2489. return jQuery.grep( elements, function( elem ) {
  2490. return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
  2491. } );
  2492. }
  2493. jQuery.filter = function( expr, elems, not ) {
  2494. var elem = elems[ 0 ];
  2495. if ( not ) {
  2496. expr = ":not(" + expr + ")";
  2497. }
  2498. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2499. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2500. }
  2501. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2502. return elem.nodeType === 1;
  2503. } ) );
  2504. };
  2505. jQuery.fn.extend( {
  2506. find: function( selector ) {
  2507. var i, ret,
  2508. len = this.length,
  2509. self = this;
  2510. if ( typeof selector !== "string" ) {
  2511. return this.pushStack( jQuery( selector ).filter( function() {
  2512. for ( i = 0; i < len; i++ ) {
  2513. if ( jQuery.contains( self[ i ], this ) ) {
  2514. return true;
  2515. }
  2516. }
  2517. } ) );
  2518. }
  2519. ret = this.pushStack( [] );
  2520. for ( i = 0; i < len; i++ ) {
  2521. jQuery.find( selector, self[ i ], ret );
  2522. }
  2523. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2524. },
  2525. filter: function( selector ) {
  2526. return this.pushStack( winnow( this, selector || [], false ) );
  2527. },
  2528. not: function( selector ) {
  2529. return this.pushStack( winnow( this, selector || [], true ) );
  2530. },
  2531. is: function( selector ) {
  2532. return !!winnow(
  2533. this,
  2534. // If this is a positional/relative selector, check membership in the returned set
  2535. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2536. typeof selector === "string" && rneedsContext.test( selector ) ?
  2537. jQuery( selector ) :
  2538. selector || [],
  2539. false
  2540. ).length;
  2541. }
  2542. } );
  2543. // Initialize a jQuery object
  2544. // A central reference to the root jQuery(document)
  2545. var rootjQuery,
  2546. // A simple way to check for HTML strings
  2547. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2548. // Strict HTML recognition (#11290: must start with <)
  2549. // Shortcut simple #id case for speed
  2550. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2551. init = jQuery.fn.init = function( selector, context, root ) {
  2552. var match, elem;
  2553. // HANDLE: $(""), $(null), $(undefined), $(false)
  2554. if ( !selector ) {
  2555. return this;
  2556. }
  2557. // Method init() accepts an alternate rootjQuery
  2558. // so migrate can support jQuery.sub (gh-2101)
  2559. root = root || rootjQuery;
  2560. // Handle HTML strings
  2561. if ( typeof selector === "string" ) {
  2562. if ( selector[ 0 ] === "<" &&
  2563. selector[ selector.length - 1 ] === ">" &&
  2564. selector.length >= 3 ) {
  2565. // Assume that strings that start and end with <> are HTML and skip the regex check
  2566. match = [ null, selector, null ];
  2567. } else {
  2568. match = rquickExpr.exec( selector );
  2569. }
  2570. // Match html or make sure no context is specified for #id
  2571. if ( match && ( match[ 1 ] || !context ) ) {
  2572. // HANDLE: $(html) -> $(array)
  2573. if ( match[ 1 ] ) {
  2574. context = context instanceof jQuery ? context[ 0 ] : context;
  2575. // Option to run scripts is true for back-compat
  2576. // Intentionally let the error be thrown if parseHTML is not present
  2577. jQuery.merge( this, jQuery.parseHTML(
  2578. match[ 1 ],
  2579. context && context.nodeType ? context.ownerDocument || context : document,
  2580. true
  2581. ) );
  2582. // HANDLE: $(html, props)
  2583. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2584. for ( match in context ) {
  2585. // Properties of context are called as methods if possible
  2586. if ( jQuery.isFunction( this[ match ] ) ) {
  2587. this[ match ]( context[ match ] );
  2588. // ...and otherwise set as attributes
  2589. } else {
  2590. this.attr( match, context[ match ] );
  2591. }
  2592. }
  2593. }
  2594. return this;
  2595. // HANDLE: $(#id)
  2596. } else {
  2597. elem = document.getElementById( match[ 2 ] );
  2598. if ( elem ) {
  2599. // Inject the element directly into the jQuery object
  2600. this[ 0 ] = elem;
  2601. this.length = 1;
  2602. }
  2603. return this;
  2604. }
  2605. // HANDLE: $(expr, $(...))
  2606. } else if ( !context || context.jquery ) {
  2607. return ( context || root ).find( selector );
  2608. // HANDLE: $(expr, context)
  2609. // (which is just equivalent to: $(context).find(expr)
  2610. } else {
  2611. return this.constructor( context ).find( selector );
  2612. }
  2613. // HANDLE: $(DOMElement)
  2614. } else if ( selector.nodeType ) {
  2615. this[ 0 ] = selector;
  2616. this.length = 1;
  2617. return this;
  2618. // HANDLE: $(function)
  2619. // Shortcut for document ready
  2620. } else if ( jQuery.isFunction( selector ) ) {
  2621. return root.ready !== undefined ?
  2622. root.ready( selector ) :
  2623. // Execute immediately if ready is not present
  2624. selector( jQuery );
  2625. }
  2626. return jQuery.makeArray( selector, this );
  2627. };
  2628. // Give the init function the jQuery prototype for later instantiation
  2629. init.prototype = jQuery.fn;
  2630. // Initialize central reference
  2631. rootjQuery = jQuery( document );
  2632. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2633. // Methods guaranteed to produce a unique set when starting from a unique set
  2634. guaranteedUnique = {
  2635. children: true,
  2636. contents: true,
  2637. next: true,
  2638. prev: true
  2639. };
  2640. jQuery.fn.extend( {
  2641. has: function( target ) {
  2642. var targets = jQuery( target, this ),
  2643. l = targets.length;
  2644. return this.filter( function() {
  2645. var i = 0;
  2646. for ( ; i < l; i++ ) {
  2647. if ( jQuery.contains( this, targets[ i ] ) ) {
  2648. return true;
  2649. }
  2650. }
  2651. } );
  2652. },
  2653. closest: function( selectors, context ) {
  2654. var cur,
  2655. i = 0,
  2656. l = this.length,
  2657. matched = [],
  2658. targets = typeof selectors !== "string" && jQuery( selectors );
  2659. // Positional selectors never match, since there's no _selection_ context
  2660. if ( !rneedsContext.test( selectors ) ) {
  2661. for ( ; i < l; i++ ) {
  2662. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2663. // Always skip document fragments
  2664. if ( cur.nodeType < 11 && ( targets ?
  2665. targets.index( cur ) > -1 :
  2666. // Don't pass non-elements to Sizzle
  2667. cur.nodeType === 1 &&
  2668. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2669. matched.push( cur );
  2670. break;
  2671. }
  2672. }
  2673. }
  2674. }
  2675. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2676. },
  2677. // Determine the position of an element within the set
  2678. index: function( elem ) {
  2679. // No argument, return index in parent
  2680. if ( !elem ) {
  2681. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2682. }
  2683. // Index in selector
  2684. if ( typeof elem === "string" ) {
  2685. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2686. }
  2687. // Locate the position of the desired element
  2688. return indexOf.call( this,
  2689. // If it receives a jQuery object, the first element is used
  2690. elem.jquery ? elem[ 0 ] : elem
  2691. );
  2692. },
  2693. add: function( selector, context ) {
  2694. return this.pushStack(
  2695. jQuery.uniqueSort(
  2696. jQuery.merge( this.get(), jQuery( selector, context ) )
  2697. )
  2698. );
  2699. },
  2700. addBack: function( selector ) {
  2701. return this.add( selector == null ?
  2702. this.prevObject : this.prevObject.filter( selector )
  2703. );
  2704. }
  2705. } );
  2706. function sibling( cur, dir ) {
  2707. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2708. return cur;
  2709. }
  2710. jQuery.each( {
  2711. parent: function( elem ) {
  2712. var parent = elem.parentNode;
  2713. return parent && parent.nodeType !== 11 ? parent : null;
  2714. },
  2715. parents: function( elem ) {
  2716. return dir( elem, "parentNode" );
  2717. },
  2718. parentsUntil: function( elem, i, until ) {
  2719. return dir( elem, "parentNode", until );
  2720. },
  2721. next: function( elem ) {
  2722. return sibling( elem, "nextSibling" );
  2723. },
  2724. prev: function( elem ) {
  2725. return sibling( elem, "previousSibling" );
  2726. },
  2727. nextAll: function( elem ) {
  2728. return dir( elem, "nextSibling" );
  2729. },
  2730. prevAll: function( elem ) {
  2731. return dir( elem, "previousSibling" );
  2732. },
  2733. nextUntil: function( elem, i, until ) {
  2734. return dir( elem, "nextSibling", until );
  2735. },
  2736. prevUntil: function( elem, i, until ) {
  2737. return dir( elem, "previousSibling", until );
  2738. },
  2739. siblings: function( elem ) {
  2740. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2741. },
  2742. children: function( elem ) {
  2743. return siblings( elem.firstChild );
  2744. },
  2745. contents: function( elem ) {
  2746. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  2747. }
  2748. }, function( name, fn ) {
  2749. jQuery.fn[ name ] = function( until, selector ) {
  2750. var matched = jQuery.map( this, fn, until );
  2751. if ( name.slice( -5 ) !== "Until" ) {
  2752. selector = until;
  2753. }
  2754. if ( selector && typeof selector === "string" ) {
  2755. matched = jQuery.filter( selector, matched );
  2756. }
  2757. if ( this.length > 1 ) {
  2758. // Remove duplicates
  2759. if ( !guaranteedUnique[ name ] ) {
  2760. jQuery.uniqueSort( matched );
  2761. }
  2762. // Reverse order for parents* and prev-derivatives
  2763. if ( rparentsprev.test( name ) ) {
  2764. matched.reverse();
  2765. }
  2766. }
  2767. return this.pushStack( matched );
  2768. };
  2769. } );
  2770. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2771. // Convert String-formatted options into Object-formatted ones
  2772. function createOptions( options ) {
  2773. var object = {};
  2774. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2775. object[ flag ] = true;
  2776. } );
  2777. return object;
  2778. }
  2779. /*
  2780. * Create a callback list using the following parameters:
  2781. *
  2782. * options: an optional list of space-separated options that will change how
  2783. * the callback list behaves or a more traditional option object
  2784. *
  2785. * By default a callback list will act like an event callback list and can be
  2786. * "fired" multiple times.
  2787. *
  2788. * Possible options:
  2789. *
  2790. * once: will ensure the callback list can only be fired once (like a Deferred)
  2791. *
  2792. * memory: will keep track of previous values and will call any callback added
  2793. * after the list has been fired right away with the latest "memorized"
  2794. * values (like a Deferred)
  2795. *
  2796. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2797. *
  2798. * stopOnFalse: interrupt callings when a callback returns false
  2799. *
  2800. */
  2801. jQuery.Callbacks = function( options ) {
  2802. // Convert options from String-formatted to Object-formatted if needed
  2803. // (we check in cache first)
  2804. options = typeof options === "string" ?
  2805. createOptions( options ) :
  2806. jQuery.extend( {}, options );
  2807. var // Flag to know if list is currently firing
  2808. firing,
  2809. // Last fire value for non-forgettable lists
  2810. memory,
  2811. // Flag to know if list was already fired
  2812. fired,
  2813. // Flag to prevent firing
  2814. locked,
  2815. // Actual callback list
  2816. list = [],
  2817. // Queue of execution data for repeatable lists
  2818. queue = [],
  2819. // Index of currently firing callback (modified by add/remove as needed)
  2820. firingIndex = -1,
  2821. // Fire callbacks
  2822. fire = function() {
  2823. // Enforce single-firing
  2824. locked = options.once;
  2825. // Execute callbacks for all pending executions,
  2826. // respecting firingIndex overrides and runtime changes
  2827. fired = firing = true;
  2828. for ( ; queue.length; firingIndex = -1 ) {
  2829. memory = queue.shift();
  2830. while ( ++firingIndex < list.length ) {
  2831. // Run callback and check for early termination
  2832. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2833. options.stopOnFalse ) {
  2834. // Jump to end and forget the data so .add doesn't re-fire
  2835. firingIndex = list.length;
  2836. memory = false;
  2837. }
  2838. }
  2839. }
  2840. // Forget the data if we're done with it
  2841. if ( !options.memory ) {
  2842. memory = false;
  2843. }
  2844. firing = false;
  2845. // Clean up if we're done firing for good
  2846. if ( locked ) {
  2847. // Keep an empty list if we have data for future add calls
  2848. if ( memory ) {
  2849. list = [];
  2850. // Otherwise, this object is spent
  2851. } else {
  2852. list = "";
  2853. }
  2854. }
  2855. },
  2856. // Actual Callbacks object
  2857. self = {
  2858. // Add a callback or a collection of callbacks to the list
  2859. add: function() {
  2860. if ( list ) {
  2861. // If we have memory from a past run, we should fire after adding
  2862. if ( memory && !firing ) {
  2863. firingIndex = list.length - 1;
  2864. queue.push( memory );
  2865. }
  2866. ( function add( args ) {
  2867. jQuery.each( args, function( _, arg ) {
  2868. if ( jQuery.isFunction( arg ) ) {
  2869. if ( !options.unique || !self.has( arg ) ) {
  2870. list.push( arg );
  2871. }
  2872. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  2873. // Inspect recursively
  2874. add( arg );
  2875. }
  2876. } );
  2877. } )( arguments );
  2878. if ( memory && !firing ) {
  2879. fire();
  2880. }
  2881. }
  2882. return this;
  2883. },
  2884. // Remove a callback from the list
  2885. remove: function() {
  2886. jQuery.each( arguments, function( _, arg ) {
  2887. var index;
  2888. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2889. list.splice( index, 1 );
  2890. // Handle firing indexes
  2891. if ( index <= firingIndex ) {
  2892. firingIndex--;
  2893. }
  2894. }
  2895. } );
  2896. return this;
  2897. },
  2898. // Check if a given callback is in the list.
  2899. // If no argument is given, return whether or not list has callbacks attached.
  2900. has: function( fn ) {
  2901. return fn ?
  2902. jQuery.inArray( fn, list ) > -1 :
  2903. list.length > 0;
  2904. },
  2905. // Remove all callbacks from the list
  2906. empty: function() {
  2907. if ( list ) {
  2908. list = [];
  2909. }
  2910. return this;
  2911. },
  2912. // Disable .fire and .add
  2913. // Abort any current/pending executions
  2914. // Clear all callbacks and values
  2915. disable: function() {
  2916. locked = queue = [];
  2917. list = memory = "";
  2918. return this;
  2919. },
  2920. disabled: function() {
  2921. return !list;
  2922. },
  2923. // Disable .fire
  2924. // Also disable .add unless we have memory (since it would have no effect)
  2925. // Abort any pending executions
  2926. lock: function() {
  2927. locked = queue = [];
  2928. if ( !memory && !firing ) {
  2929. list = memory = "";
  2930. }
  2931. return this;
  2932. },
  2933. locked: function() {
  2934. return !!locked;
  2935. },
  2936. // Call all callbacks with the given context and arguments
  2937. fireWith: function( context, args ) {
  2938. if ( !locked ) {
  2939. args = args || [];
  2940. args = [ context, args.slice ? args.slice() : args ];
  2941. queue.push( args );
  2942. if ( !firing ) {
  2943. fire();
  2944. }
  2945. }
  2946. return this;
  2947. },
  2948. // Call all the callbacks with the given arguments
  2949. fire: function() {
  2950. self.fireWith( this, arguments );
  2951. return this;
  2952. },
  2953. // To know if the callbacks have already been called at least once
  2954. fired: function() {
  2955. return !!fired;
  2956. }
  2957. };
  2958. return self;
  2959. };
  2960. function Identity( v ) {
  2961. return v;
  2962. }
  2963. function Thrower( ex ) {
  2964. throw ex;
  2965. }
  2966. function adoptValue( value, resolve, reject ) {
  2967. var method;
  2968. try {
  2969. // Check for promise aspect first to privilege synchronous behavior
  2970. if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
  2971. method.call( value ).done( resolve ).fail( reject );
  2972. // Other thenables
  2973. } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
  2974. method.call( value, resolve, reject );
  2975. // Other non-thenables
  2976. } else {
  2977. // Support: Android 4.0 only
  2978. // Strict mode functions invoked without .call/.apply get global-object context
  2979. resolve.call( undefined, value );
  2980. }
  2981. // For Promises/A+, convert exceptions into rejections
  2982. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  2983. // Deferred#then to conditionally suppress rejection.
  2984. } catch ( value ) {
  2985. // Support: Android 4.0 only
  2986. // Strict mode functions invoked without .call/.apply get global-object context
  2987. reject.call( undefined, value );
  2988. }
  2989. }
  2990. jQuery.extend( {
  2991. Deferred: function( func ) {
  2992. var tuples = [
  2993. // action, add listener, callbacks,
  2994. // ... .then handlers, argument index, [final state]
  2995. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  2996. jQuery.Callbacks( "memory" ), 2 ],
  2997. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  2998. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  2999. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  3000. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  3001. ],
  3002. state = "pending",
  3003. promise = {
  3004. state: function() {
  3005. return state;
  3006. },
  3007. always: function() {
  3008. deferred.done( arguments ).fail( arguments );
  3009. return this;
  3010. },
  3011. "catch": function( fn ) {
  3012. return promise.then( null, fn );
  3013. },
  3014. // Keep pipe for back-compat
  3015. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  3016. var fns = arguments;
  3017. return jQuery.Deferred( function( newDefer ) {
  3018. jQuery.each( tuples, function( i, tuple ) {
  3019. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  3020. var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  3021. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  3022. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  3023. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  3024. deferred[ tuple[ 1 ] ]( function() {
  3025. var returned = fn && fn.apply( this, arguments );
  3026. if ( returned && jQuery.isFunction( returned.promise ) ) {
  3027. returned.promise()
  3028. .progress( newDefer.notify )
  3029. .done( newDefer.resolve )
  3030. .fail( newDefer.reject );
  3031. } else {
  3032. newDefer[ tuple[ 0 ] + "With" ](
  3033. this,
  3034. fn ? [ returned ] : arguments
  3035. );
  3036. }
  3037. } );
  3038. } );
  3039. fns = null;
  3040. } ).promise();
  3041. },
  3042. then: function( onFulfilled, onRejected, onProgress ) {
  3043. var maxDepth = 0;
  3044. function resolve( depth, deferred, handler, special ) {
  3045. return function() {
  3046. var that = this,
  3047. args = arguments,
  3048. mightThrow = function() {
  3049. var returned, then;
  3050. // Support: Promises/A+ section 2.3.3.3.3
  3051. // https://promisesaplus.com/#point-59
  3052. // Ignore double-resolution attempts
  3053. if ( depth < maxDepth ) {
  3054. return;
  3055. }
  3056. returned = handler.apply( that, args );
  3057. // Support: Promises/A+ section 2.3.1
  3058. // https://promisesaplus.com/#point-48
  3059. if ( returned === deferred.promise() ) {
  3060. throw new TypeError( "Thenable self-resolution" );
  3061. }
  3062. // Support: Promises/A+ sections 2.3.3.1, 3.5
  3063. // https://promisesaplus.com/#point-54
  3064. // https://promisesaplus.com/#point-75
  3065. // Retrieve `then` only once
  3066. then = returned &&
  3067. // Support: Promises/A+ section 2.3.4
  3068. // https://promisesaplus.com/#point-64
  3069. // Only check objects and functions for thenability
  3070. ( typeof returned === "object" ||
  3071. typeof returned === "function" ) &&
  3072. returned.then;
  3073. // Handle a returned thenable
  3074. if ( jQuery.isFunction( then ) ) {
  3075. // Special processors (notify) just wait for resolution
  3076. if ( special ) {
  3077. then.call(
  3078. returned,
  3079. resolve( maxDepth, deferred, Identity, special ),
  3080. resolve( maxDepth, deferred, Thrower, special )
  3081. );
  3082. // Normal processors (resolve) also hook into progress
  3083. } else {
  3084. // ...and disregard older resolution values
  3085. maxDepth++;
  3086. then.call(
  3087. returned,
  3088. resolve( maxDepth, deferred, Identity, special ),
  3089. resolve( maxDepth, deferred, Thrower, special ),
  3090. resolve( maxDepth, deferred, Identity,
  3091. deferred.notifyWith )
  3092. );
  3093. }
  3094. // Handle all other returned values
  3095. } else {
  3096. // Only substitute handlers pass on context
  3097. // and multiple values (non-spec behavior)
  3098. if ( handler !== Identity ) {
  3099. that = undefined;
  3100. args = [ returned ];
  3101. }
  3102. // Process the value(s)
  3103. // Default process is resolve
  3104. ( special || deferred.resolveWith )( that, args );
  3105. }
  3106. },
  3107. // Only normal processors (resolve) catch and reject exceptions
  3108. process = special ?
  3109. mightThrow :
  3110. function() {
  3111. try {
  3112. mightThrow();
  3113. } catch ( e ) {
  3114. if ( jQuery.Deferred.exceptionHook ) {
  3115. jQuery.Deferred.exceptionHook( e,
  3116. process.stackTrace );
  3117. }
  3118. // Support: Promises/A+ section 2.3.3.3.4.1
  3119. // https://promisesaplus.com/#point-61
  3120. // Ignore post-resolution exceptions
  3121. if ( depth + 1 >= maxDepth ) {
  3122. // Only substitute handlers pass on context
  3123. // and multiple values (non-spec behavior)
  3124. if ( handler !== Thrower ) {
  3125. that = undefined;
  3126. args = [ e ];
  3127. }
  3128. deferred.rejectWith( that, args );
  3129. }
  3130. }
  3131. };
  3132. // Support: Promises/A+ section 2.3.3.3.1
  3133. // https://promisesaplus.com/#point-57
  3134. // Re-resolve promises immediately to dodge false rejection from
  3135. // subsequent errors
  3136. if ( depth ) {
  3137. process();
  3138. } else {
  3139. // Call an optional hook to record the stack, in case of exception
  3140. // since it's otherwise lost when execution goes async
  3141. if ( jQuery.Deferred.getStackHook ) {
  3142. process.stackTrace = jQuery.Deferred.getStackHook();
  3143. }
  3144. window.setTimeout( process );
  3145. }
  3146. };
  3147. }
  3148. return jQuery.Deferred( function( newDefer ) {
  3149. // progress_handlers.add( ... )
  3150. tuples[ 0 ][ 3 ].add(
  3151. resolve(
  3152. 0,
  3153. newDefer,
  3154. jQuery.isFunction( onProgress ) ?
  3155. onProgress :
  3156. Identity,
  3157. newDefer.notifyWith
  3158. )
  3159. );
  3160. // fulfilled_handlers.add( ... )
  3161. tuples[ 1 ][ 3 ].add(
  3162. resolve(
  3163. 0,
  3164. newDefer,
  3165. jQuery.isFunction( onFulfilled ) ?
  3166. onFulfilled :
  3167. Identity
  3168. )
  3169. );
  3170. // rejected_handlers.add( ... )
  3171. tuples[ 2 ][ 3 ].add(
  3172. resolve(
  3173. 0,
  3174. newDefer,
  3175. jQuery.isFunction( onRejected ) ?
  3176. onRejected :
  3177. Thrower
  3178. )
  3179. );
  3180. } ).promise();
  3181. },
  3182. // Get a promise for this deferred
  3183. // If obj is provided, the promise aspect is added to the object
  3184. promise: function( obj ) {
  3185. return obj != null ? jQuery.extend( obj, promise ) : promise;
  3186. }
  3187. },
  3188. deferred = {};
  3189. // Add list-specific methods
  3190. jQuery.each( tuples, function( i, tuple ) {
  3191. var list = tuple[ 2 ],
  3192. stateString = tuple[ 5 ];
  3193. // promise.progress = list.add
  3194. // promise.done = list.add
  3195. // promise.fail = list.add
  3196. promise[ tuple[ 1 ] ] = list.add;
  3197. // Handle state
  3198. if ( stateString ) {
  3199. list.add(
  3200. function() {
  3201. // state = "resolved" (i.e., fulfilled)
  3202. // state = "rejected"
  3203. state = stateString;
  3204. },
  3205. // rejected_callbacks.disable
  3206. // fulfilled_callbacks.disable
  3207. tuples[ 3 - i ][ 2 ].disable,
  3208. // progress_callbacks.lock
  3209. tuples[ 0 ][ 2 ].lock
  3210. );
  3211. }
  3212. // progress_handlers.fire
  3213. // fulfilled_handlers.fire
  3214. // rejected_handlers.fire
  3215. list.add( tuple[ 3 ].fire );
  3216. // deferred.notify = function() { deferred.notifyWith(...) }
  3217. // deferred.resolve = function() { deferred.resolveWith(...) }
  3218. // deferred.reject = function() { deferred.rejectWith(...) }
  3219. deferred[ tuple[ 0 ] ] = function() {
  3220. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3221. return this;
  3222. };
  3223. // deferred.notifyWith = list.fireWith
  3224. // deferred.resolveWith = list.fireWith
  3225. // deferred.rejectWith = list.fireWith
  3226. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3227. } );
  3228. // Make the deferred a promise
  3229. promise.promise( deferred );
  3230. // Call given func if any
  3231. if ( func ) {
  3232. func.call( deferred, deferred );
  3233. }
  3234. // All done!
  3235. return deferred;
  3236. },
  3237. // Deferred helper
  3238. when: function( singleValue ) {
  3239. var
  3240. // count of uncompleted subordinates
  3241. remaining = arguments.length,
  3242. // count of unprocessed arguments
  3243. i = remaining,
  3244. // subordinate fulfillment data
  3245. resolveContexts = Array( i ),
  3246. resolveValues = slice.call( arguments ),
  3247. // the master Deferred
  3248. master = jQuery.Deferred(),
  3249. // subordinate callback factory
  3250. updateFunc = function( i ) {
  3251. return function( value ) {
  3252. resolveContexts[ i ] = this;
  3253. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3254. if ( !( --remaining ) ) {
  3255. master.resolveWith( resolveContexts, resolveValues );
  3256. }
  3257. };
  3258. };
  3259. // Single- and empty arguments are adopted like Promise.resolve
  3260. if ( remaining <= 1 ) {
  3261. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
  3262. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3263. if ( master.state() === "pending" ||
  3264. jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3265. return master.then();
  3266. }
  3267. }
  3268. // Multiple arguments are aggregated like Promise.all array elements
  3269. while ( i-- ) {
  3270. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  3271. }
  3272. return master.promise();
  3273. }
  3274. } );
  3275. // These usually indicate a programmer mistake during development,
  3276. // warn about them ASAP rather than swallowing them by default.
  3277. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3278. jQuery.Deferred.exceptionHook = function( error, stack ) {
  3279. // Support: IE 8 - 9 only
  3280. // Console exists when dev tools are open, which can happen at any time
  3281. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3282. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  3283. }
  3284. };
  3285. jQuery.readyException = function( error ) {
  3286. window.setTimeout( function() {
  3287. throw error;
  3288. } );
  3289. };
  3290. // The deferred used on DOM ready
  3291. var readyList = jQuery.Deferred();
  3292. jQuery.fn.ready = function( fn ) {
  3293. readyList
  3294. .then( fn )
  3295. // Wrap jQuery.readyException in a function so that the lookup
  3296. // happens at the time of error handling instead of callback
  3297. // registration.
  3298. .catch( function( error ) {
  3299. jQuery.readyException( error );
  3300. } );
  3301. return this;
  3302. };
  3303. jQuery.extend( {
  3304. // Is the DOM ready to be used? Set to true once it occurs.
  3305. isReady: false,
  3306. // A counter to track how many items to wait for before
  3307. // the ready event fires. See #6781
  3308. readyWait: 1,
  3309. // Hold (or release) the ready event
  3310. holdReady: function( hold ) {
  3311. if ( hold ) {
  3312. jQuery.readyWait++;
  3313. } else {
  3314. jQuery.ready( true );
  3315. }
  3316. },
  3317. // Handle when the DOM is ready
  3318. ready: function( wait ) {
  3319. // Abort if there are pending holds or we're already ready
  3320. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3321. return;
  3322. }
  3323. // Remember that the DOM is ready
  3324. jQuery.isReady = true;
  3325. // If a normal DOM Ready event fired, decrement, and wait if need be
  3326. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3327. return;
  3328. }
  3329. // If there are functions bound, to execute
  3330. readyList.resolveWith( document, [ jQuery ] );
  3331. }
  3332. } );
  3333. jQuery.ready.then = readyList.then;
  3334. // The ready event handler and self cleanup method
  3335. function completed() {
  3336. document.removeEventListener( "DOMContentLoaded", completed );
  3337. window.removeEventListener( "load", completed );
  3338. jQuery.ready();
  3339. }
  3340. // Catch cases where $(document).ready() is called
  3341. // after the browser event has already occurred.
  3342. // Support: IE <=9 - 10 only
  3343. // Older IE sometimes signals "interactive" too soon
  3344. if ( document.readyState === "complete" ||
  3345. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3346. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3347. window.setTimeout( jQuery.ready );
  3348. } else {
  3349. // Use the handy event callback
  3350. document.addEventListener( "DOMContentLoaded", completed );
  3351. // A fallback to window.onload, that will always work
  3352. window.addEventListener( "load", completed );
  3353. }
  3354. // Multifunctional method to get and set values of a collection
  3355. // The value/s can optionally be executed if it's a function
  3356. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3357. var i = 0,
  3358. len = elems.length,
  3359. bulk = key == null;
  3360. // Sets many values
  3361. if ( jQuery.type( key ) === "object" ) {
  3362. chainable = true;
  3363. for ( i in key ) {
  3364. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3365. }
  3366. // Sets one value
  3367. } else if ( value !== undefined ) {
  3368. chainable = true;
  3369. if ( !jQuery.isFunction( value ) ) {
  3370. raw = true;
  3371. }
  3372. if ( bulk ) {
  3373. // Bulk operations run against the entire set
  3374. if ( raw ) {
  3375. fn.call( elems, value );
  3376. fn = null;
  3377. // ...except when executing function values
  3378. } else {
  3379. bulk = fn;
  3380. fn = function( elem, key, value ) {
  3381. return bulk.call( jQuery( elem ), value );
  3382. };
  3383. }
  3384. }
  3385. if ( fn ) {
  3386. for ( ; i < len; i++ ) {
  3387. fn(
  3388. elems[ i ], key, raw ?
  3389. value :
  3390. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3391. );
  3392. }
  3393. }
  3394. }
  3395. if ( chainable ) {
  3396. return elems;
  3397. }
  3398. // Gets
  3399. if ( bulk ) {
  3400. return fn.call( elems );
  3401. }
  3402. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3403. };
  3404. var acceptData = function( owner ) {
  3405. // Accepts only:
  3406. // - Node
  3407. // - Node.ELEMENT_NODE
  3408. // - Node.DOCUMENT_NODE
  3409. // - Object
  3410. // - Any
  3411. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3412. };
  3413. function Data() {
  3414. this.expando = jQuery.expando + Data.uid++;
  3415. }
  3416. Data.uid = 1;
  3417. Data.prototype = {
  3418. cache: function( owner ) {
  3419. // Check if the owner object already has a cache
  3420. var value = owner[ this.expando ];
  3421. // If not, create one
  3422. if ( !value ) {
  3423. value = {};
  3424. // We can accept data for non-element nodes in modern browsers,
  3425. // but we should not, see #8335.
  3426. // Always return an empty object.
  3427. if ( acceptData( owner ) ) {
  3428. // If it is a node unlikely to be stringify-ed or looped over
  3429. // use plain assignment
  3430. if ( owner.nodeType ) {
  3431. owner[ this.expando ] = value;
  3432. // Otherwise secure it in a non-enumerable property
  3433. // configurable must be true to allow the property to be
  3434. // deleted when data is removed
  3435. } else {
  3436. Object.defineProperty( owner, this.expando, {
  3437. value: value,
  3438. configurable: true
  3439. } );
  3440. }
  3441. }
  3442. }
  3443. return value;
  3444. },
  3445. set: function( owner, data, value ) {
  3446. var prop,
  3447. cache = this.cache( owner );
  3448. // Handle: [ owner, key, value ] args
  3449. // Always use camelCase key (gh-2257)
  3450. if ( typeof data === "string" ) {
  3451. cache[ jQuery.camelCase( data ) ] = value;
  3452. // Handle: [ owner, { properties } ] args
  3453. } else {
  3454. // Copy the properties one-by-one to the cache object
  3455. for ( prop in data ) {
  3456. cache[ jQuery.camelCase( prop ) ] = data[ prop ];
  3457. }
  3458. }
  3459. return cache;
  3460. },
  3461. get: function( owner, key ) {
  3462. return key === undefined ?
  3463. this.cache( owner ) :
  3464. // Always use camelCase key (gh-2257)
  3465. owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
  3466. },
  3467. access: function( owner, key, value ) {
  3468. // In cases where either:
  3469. //
  3470. // 1. No key was specified
  3471. // 2. A string key was specified, but no value provided
  3472. //
  3473. // Take the "read" path and allow the get method to determine
  3474. // which value to return, respectively either:
  3475. //
  3476. // 1. The entire cache object
  3477. // 2. The data stored at the key
  3478. //
  3479. if ( key === undefined ||
  3480. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3481. return this.get( owner, key );
  3482. }
  3483. // When the key is not a string, or both a key and value
  3484. // are specified, set or extend (existing objects) with either:
  3485. //
  3486. // 1. An object of properties
  3487. // 2. A key and value
  3488. //
  3489. this.set( owner, key, value );
  3490. // Since the "set" path can have two possible entry points
  3491. // return the expected data based on which path was taken[*]
  3492. return value !== undefined ? value : key;
  3493. },
  3494. remove: function( owner, key ) {
  3495. var i,
  3496. cache = owner[ this.expando ];
  3497. if ( cache === undefined ) {
  3498. return;
  3499. }
  3500. if ( key !== undefined ) {
  3501. // Support array or space separated string of keys
  3502. if ( jQuery.isArray( key ) ) {
  3503. // If key is an array of keys...
  3504. // We always set camelCase keys, so remove that.
  3505. key = key.map( jQuery.camelCase );
  3506. } else {
  3507. key = jQuery.camelCase( key );
  3508. // If a key with the spaces exists, use it.
  3509. // Otherwise, create an array by matching non-whitespace
  3510. key = key in cache ?
  3511. [ key ] :
  3512. ( key.match( rnothtmlwhite ) || [] );
  3513. }
  3514. i = key.length;
  3515. while ( i-- ) {
  3516. delete cache[ key[ i ] ];
  3517. }
  3518. }
  3519. // Remove the expando if there's no more data
  3520. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3521. // Support: Chrome <=35 - 45
  3522. // Webkit & Blink performance suffers when deleting properties
  3523. // from DOM nodes, so set to undefined instead
  3524. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3525. if ( owner.nodeType ) {
  3526. owner[ this.expando ] = undefined;
  3527. } else {
  3528. delete owner[ this.expando ];
  3529. }
  3530. }
  3531. },
  3532. hasData: function( owner ) {
  3533. var cache = owner[ this.expando ];
  3534. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3535. }
  3536. };
  3537. var dataPriv = new Data();
  3538. var dataUser = new Data();
  3539. // Implementation Summary
  3540. //
  3541. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3542. // 2. Improve the module's maintainability by reducing the storage
  3543. // paths to a single mechanism.
  3544. // 3. Use the same single mechanism to support "private" and "user" data.
  3545. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3546. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3547. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3548. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3549. rmultiDash = /[A-Z]/g;
  3550. function getData( data ) {
  3551. if ( data === "true" ) {
  3552. return true;
  3553. }
  3554. if ( data === "false" ) {
  3555. return false;
  3556. }
  3557. if ( data === "null" ) {
  3558. return null;
  3559. }
  3560. // Only convert to a number if it doesn't change the string
  3561. if ( data === +data + "" ) {
  3562. return +data;
  3563. }
  3564. if ( rbrace.test( data ) ) {
  3565. return JSON.parse( data );
  3566. }
  3567. return data;
  3568. }
  3569. function dataAttr( elem, key, data ) {
  3570. var name;
  3571. // If nothing was found internally, try to fetch any
  3572. // data from the HTML5 data-* attribute
  3573. if ( data === undefined && elem.nodeType === 1 ) {
  3574. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3575. data = elem.getAttribute( name );
  3576. if ( typeof data === "string" ) {
  3577. try {
  3578. data = getData( data );
  3579. } catch ( e ) {}
  3580. // Make sure we set the data so it isn't changed later
  3581. dataUser.set( elem, key, data );
  3582. } else {
  3583. data = undefined;
  3584. }
  3585. }
  3586. return data;
  3587. }
  3588. jQuery.extend( {
  3589. hasData: function( elem ) {
  3590. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3591. },
  3592. data: function( elem, name, data ) {
  3593. return dataUser.access( elem, name, data );
  3594. },
  3595. removeData: function( elem, name ) {
  3596. dataUser.remove( elem, name );
  3597. },
  3598. // TODO: Now that all calls to _data and _removeData have been replaced
  3599. // with direct calls to dataPriv methods, these can be deprecated.
  3600. _data: function( elem, name, data ) {
  3601. return dataPriv.access( elem, name, data );
  3602. },
  3603. _removeData: function( elem, name ) {
  3604. dataPriv.remove( elem, name );
  3605. }
  3606. } );
  3607. jQuery.fn.extend( {
  3608. data: function( key, value ) {
  3609. var i, name, data,
  3610. elem = this[ 0 ],
  3611. attrs = elem && elem.attributes;
  3612. // Gets all values
  3613. if ( key === undefined ) {
  3614. if ( this.length ) {
  3615. data = dataUser.get( elem );
  3616. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3617. i = attrs.length;
  3618. while ( i-- ) {
  3619. // Support: IE 11 only
  3620. // The attrs elements can be null (#14894)
  3621. if ( attrs[ i ] ) {
  3622. name = attrs[ i ].name;
  3623. if ( name.indexOf( "data-" ) === 0 ) {
  3624. name = jQuery.camelCase( name.slice( 5 ) );
  3625. dataAttr( elem, name, data[ name ] );
  3626. }
  3627. }
  3628. }
  3629. dataPriv.set( elem, "hasDataAttrs", true );
  3630. }
  3631. }
  3632. return data;
  3633. }
  3634. // Sets multiple values
  3635. if ( typeof key === "object" ) {
  3636. return this.each( function() {
  3637. dataUser.set( this, key );
  3638. } );
  3639. }
  3640. return access( this, function( value ) {
  3641. var data;
  3642. // The calling jQuery object (element matches) is not empty
  3643. // (and therefore has an element appears at this[ 0 ]) and the
  3644. // `value` parameter was not undefined. An empty jQuery object
  3645. // will result in `undefined` for elem = this[ 0 ] which will
  3646. // throw an exception if an attempt to read a data cache is made.
  3647. if ( elem && value === undefined ) {
  3648. // Attempt to get data from the cache
  3649. // The key will always be camelCased in Data
  3650. data = dataUser.get( elem, key );
  3651. if ( data !== undefined ) {
  3652. return data;
  3653. }
  3654. // Attempt to "discover" the data in
  3655. // HTML5 custom data-* attrs
  3656. data = dataAttr( elem, key );
  3657. if ( data !== undefined ) {
  3658. return data;
  3659. }
  3660. // We tried really hard, but the data doesn't exist.
  3661. return;
  3662. }
  3663. // Set the data...
  3664. this.each( function() {
  3665. // We always store the camelCased key
  3666. dataUser.set( this, key, value );
  3667. } );
  3668. }, null, value, arguments.length > 1, null, true );
  3669. },
  3670. removeData: function( key ) {
  3671. return this.each( function() {
  3672. dataUser.remove( this, key );
  3673. } );
  3674. }
  3675. } );
  3676. jQuery.extend( {
  3677. queue: function( elem, type, data ) {
  3678. var queue;
  3679. if ( elem ) {
  3680. type = ( type || "fx" ) + "queue";
  3681. queue = dataPriv.get( elem, type );
  3682. // Speed up dequeue by getting out quickly if this is just a lookup
  3683. if ( data ) {
  3684. if ( !queue || jQuery.isArray( data ) ) {
  3685. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3686. } else {
  3687. queue.push( data );
  3688. }
  3689. }
  3690. return queue || [];
  3691. }
  3692. },
  3693. dequeue: function( elem, type ) {
  3694. type = type || "fx";
  3695. var queue = jQuery.queue( elem, type ),
  3696. startLength = queue.length,
  3697. fn = queue.shift(),
  3698. hooks = jQuery._queueHooks( elem, type ),
  3699. next = function() {
  3700. jQuery.dequeue( elem, type );
  3701. };
  3702. // If the fx queue is dequeued, always remove the progress sentinel
  3703. if ( fn === "inprogress" ) {
  3704. fn = queue.shift();
  3705. startLength--;
  3706. }
  3707. if ( fn ) {
  3708. // Add a progress sentinel to prevent the fx queue from being
  3709. // automatically dequeued
  3710. if ( type === "fx" ) {
  3711. queue.unshift( "inprogress" );
  3712. }
  3713. // Clear up the last queue stop function
  3714. delete hooks.stop;
  3715. fn.call( elem, next, hooks );
  3716. }
  3717. if ( !startLength && hooks ) {
  3718. hooks.empty.fire();
  3719. }
  3720. },
  3721. // Not public - generate a queueHooks object, or return the current one
  3722. _queueHooks: function( elem, type ) {
  3723. var key = type + "queueHooks";
  3724. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3725. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3726. dataPriv.remove( elem, [ type + "queue", key ] );
  3727. } )
  3728. } );
  3729. }
  3730. } );
  3731. jQuery.fn.extend( {
  3732. queue: function( type, data ) {
  3733. var setter = 2;
  3734. if ( typeof type !== "string" ) {
  3735. data = type;
  3736. type = "fx";
  3737. setter--;
  3738. }
  3739. if ( arguments.length < setter ) {
  3740. return jQuery.queue( this[ 0 ], type );
  3741. }
  3742. return data === undefined ?
  3743. this :
  3744. this.each( function() {
  3745. var queue = jQuery.queue( this, type, data );
  3746. // Ensure a hooks for this queue
  3747. jQuery._queueHooks( this, type );
  3748. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3749. jQuery.dequeue( this, type );
  3750. }
  3751. } );
  3752. },
  3753. dequeue: function( type ) {
  3754. return this.each( function() {
  3755. jQuery.dequeue( this, type );
  3756. } );
  3757. },
  3758. clearQueue: function( type ) {
  3759. return this.queue( type || "fx", [] );
  3760. },
  3761. // Get a promise resolved when queues of a certain type
  3762. // are emptied (fx is the type by default)
  3763. promise: function( type, obj ) {
  3764. var tmp,
  3765. count = 1,
  3766. defer = jQuery.Deferred(),
  3767. elements = this,
  3768. i = this.length,
  3769. resolve = function() {
  3770. if ( !( --count ) ) {
  3771. defer.resolveWith( elements, [ elements ] );
  3772. }
  3773. };
  3774. if ( typeof type !== "string" ) {
  3775. obj = type;
  3776. type = undefined;
  3777. }
  3778. type = type || "fx";
  3779. while ( i-- ) {
  3780. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3781. if ( tmp && tmp.empty ) {
  3782. count++;
  3783. tmp.empty.add( resolve );
  3784. }
  3785. }
  3786. resolve();
  3787. return defer.promise( obj );
  3788. }
  3789. } );
  3790. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3791. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3792. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3793. var isHiddenWithinTree = function( elem, el ) {
  3794. // isHiddenWithinTree might be called from jQuery#filter function;
  3795. // in that case, element will be second argument
  3796. elem = el || elem;
  3797. // Inline style trumps all
  3798. return elem.style.display === "none" ||
  3799. elem.style.display === "" &&
  3800. // Otherwise, check computed style
  3801. // Support: Firefox <=43 - 45
  3802. // Disconnected elements can have computed display: none, so first confirm that elem is
  3803. // in the document.
  3804. jQuery.contains( elem.ownerDocument, elem ) &&
  3805. jQuery.css( elem, "display" ) === "none";
  3806. };
  3807. var swap = function( elem, options, callback, args ) {
  3808. var ret, name,
  3809. old = {};
  3810. // Remember the old values, and insert the new ones
  3811. for ( name in options ) {
  3812. old[ name ] = elem.style[ name ];
  3813. elem.style[ name ] = options[ name ];
  3814. }
  3815. ret = callback.apply( elem, args || [] );
  3816. // Revert the old values
  3817. for ( name in options ) {
  3818. elem.style[ name ] = old[ name ];
  3819. }
  3820. return ret;
  3821. };
  3822. function adjustCSS( elem, prop, valueParts, tween ) {
  3823. var adjusted,
  3824. scale = 1,
  3825. maxIterations = 20,
  3826. currentValue = tween ?
  3827. function() {
  3828. return tween.cur();
  3829. } :
  3830. function() {
  3831. return jQuery.css( elem, prop, "" );
  3832. },
  3833. initial = currentValue(),
  3834. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3835. // Starting value computation is required for potential unit mismatches
  3836. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3837. rcssNum.exec( jQuery.css( elem, prop ) );
  3838. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3839. // Trust units reported by jQuery.css
  3840. unit = unit || initialInUnit[ 3 ];
  3841. // Make sure we update the tween properties later on
  3842. valueParts = valueParts || [];
  3843. // Iteratively approximate from a nonzero starting point
  3844. initialInUnit = +initial || 1;
  3845. do {
  3846. // If previous iteration zeroed out, double until we get *something*.
  3847. // Use string for doubling so we don't accidentally see scale as unchanged below
  3848. scale = scale || ".5";
  3849. // Adjust and apply
  3850. initialInUnit = initialInUnit / scale;
  3851. jQuery.style( elem, prop, initialInUnit + unit );
  3852. // Update scale, tolerating zero or NaN from tween.cur()
  3853. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  3854. } while (
  3855. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  3856. );
  3857. }
  3858. if ( valueParts ) {
  3859. initialInUnit = +initialInUnit || +initial || 0;
  3860. // Apply relative offset (+=/-=) if specified
  3861. adjusted = valueParts[ 1 ] ?
  3862. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3863. +valueParts[ 2 ];
  3864. if ( tween ) {
  3865. tween.unit = unit;
  3866. tween.start = initialInUnit;
  3867. tween.end = adjusted;
  3868. }
  3869. }
  3870. return adjusted;
  3871. }
  3872. var defaultDisplayMap = {};
  3873. function getDefaultDisplay( elem ) {
  3874. var temp,
  3875. doc = elem.ownerDocument,
  3876. nodeName = elem.nodeName,
  3877. display = defaultDisplayMap[ nodeName ];
  3878. if ( display ) {
  3879. return display;
  3880. }
  3881. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3882. display = jQuery.css( temp, "display" );
  3883. temp.parentNode.removeChild( temp );
  3884. if ( display === "none" ) {
  3885. display = "block";
  3886. }
  3887. defaultDisplayMap[ nodeName ] = display;
  3888. return display;
  3889. }
  3890. function showHide( elements, show ) {
  3891. var display, elem,
  3892. values = [],
  3893. index = 0,
  3894. length = elements.length;
  3895. // Determine new display value for elements that need to change
  3896. for ( ; index < length; index++ ) {
  3897. elem = elements[ index ];
  3898. if ( !elem.style ) {
  3899. continue;
  3900. }
  3901. display = elem.style.display;
  3902. if ( show ) {
  3903. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3904. // check is required in this first loop unless we have a nonempty display value (either
  3905. // inline or about-to-be-restored)
  3906. if ( display === "none" ) {
  3907. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3908. if ( !values[ index ] ) {
  3909. elem.style.display = "";
  3910. }
  3911. }
  3912. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3913. values[ index ] = getDefaultDisplay( elem );
  3914. }
  3915. } else {
  3916. if ( display !== "none" ) {
  3917. values[ index ] = "none";
  3918. // Remember what we're overwriting
  3919. dataPriv.set( elem, "display", display );
  3920. }
  3921. }
  3922. }
  3923. // Set the display of the elements in a second loop to avoid constant reflow
  3924. for ( index = 0; index < length; index++ ) {
  3925. if ( values[ index ] != null ) {
  3926. elements[ index ].style.display = values[ index ];
  3927. }
  3928. }
  3929. return elements;
  3930. }
  3931. jQuery.fn.extend( {
  3932. show: function() {
  3933. return showHide( this, true );
  3934. },
  3935. hide: function() {
  3936. return showHide( this );
  3937. },
  3938. toggle: function( state ) {
  3939. if ( typeof state === "boolean" ) {
  3940. return state ? this.show() : this.hide();
  3941. }
  3942. return this.each( function() {
  3943. if ( isHiddenWithinTree( this ) ) {
  3944. jQuery( this ).show();
  3945. } else {
  3946. jQuery( this ).hide();
  3947. }
  3948. } );
  3949. }
  3950. } );
  3951. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3952. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
  3953. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  3954. // We have to close these tags to support XHTML (#13200)
  3955. var wrapMap = {
  3956. // Support: IE <=9 only
  3957. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  3958. // XHTML parsers do not magically insert elements in the
  3959. // same way that tag soup parsers do. So we cannot shorten
  3960. // this by omitting <tbody> or other required elements.
  3961. thead: [ 1, "<table>", "</table>" ],
  3962. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  3963. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  3964. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  3965. _default: [ 0, "", "" ]
  3966. };
  3967. // Support: IE <=9 only
  3968. wrapMap.optgroup = wrapMap.option;
  3969. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  3970. wrapMap.th = wrapMap.td;
  3971. function getAll( context, tag ) {
  3972. // Support: IE <=9 - 11 only
  3973. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  3974. var ret;
  3975. if ( typeof context.getElementsByTagName !== "undefined" ) {
  3976. ret = context.getElementsByTagName( tag || "*" );
  3977. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  3978. ret = context.querySelectorAll( tag || "*" );
  3979. } else {
  3980. ret = [];
  3981. }
  3982. if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
  3983. return jQuery.merge( [ context ], ret );
  3984. }
  3985. return ret;
  3986. }
  3987. // Mark scripts as having already been evaluated
  3988. function setGlobalEval( elems, refElements ) {
  3989. var i = 0,
  3990. l = elems.length;
  3991. for ( ; i < l; i++ ) {
  3992. dataPriv.set(
  3993. elems[ i ],
  3994. "globalEval",
  3995. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  3996. );
  3997. }
  3998. }
  3999. var rhtml = /<|&#?\w+;/;
  4000. function buildFragment( elems, context, scripts, selection, ignored ) {
  4001. var elem, tmp, tag, wrap, contains, j,
  4002. fragment = context.createDocumentFragment(),
  4003. nodes = [],
  4004. i = 0,
  4005. l = elems.length;
  4006. for ( ; i < l; i++ ) {
  4007. elem = elems[ i ];
  4008. if ( elem || elem === 0 ) {
  4009. // Add nodes directly
  4010. if ( jQuery.type( elem ) === "object" ) {
  4011. // Support: Android <=4.0 only, PhantomJS 1 only
  4012. // push.apply(_, arraylike) throws on ancient WebKit
  4013. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4014. // Convert non-html into a text node
  4015. } else if ( !rhtml.test( elem ) ) {
  4016. nodes.push( context.createTextNode( elem ) );
  4017. // Convert html into DOM nodes
  4018. } else {
  4019. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  4020. // Deserialize a standard representation
  4021. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4022. wrap = wrapMap[ tag ] || wrapMap._default;
  4023. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  4024. // Descend through wrappers to the right content
  4025. j = wrap[ 0 ];
  4026. while ( j-- ) {
  4027. tmp = tmp.lastChild;
  4028. }
  4029. // Support: Android <=4.0 only, PhantomJS 1 only
  4030. // push.apply(_, arraylike) throws on ancient WebKit
  4031. jQuery.merge( nodes, tmp.childNodes );
  4032. // Remember the top-level container
  4033. tmp = fragment.firstChild;
  4034. // Ensure the created nodes are orphaned (#12392)
  4035. tmp.textContent = "";
  4036. }
  4037. }
  4038. }
  4039. // Remove wrapper from fragment
  4040. fragment.textContent = "";
  4041. i = 0;
  4042. while ( ( elem = nodes[ i++ ] ) ) {
  4043. // Skip elements already in the context collection (trac-4087)
  4044. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  4045. if ( ignored ) {
  4046. ignored.push( elem );
  4047. }
  4048. continue;
  4049. }
  4050. contains = jQuery.contains( elem.ownerDocument, elem );
  4051. // Append to fragment
  4052. tmp = getAll( fragment.appendChild( elem ), "script" );
  4053. // Preserve script evaluation history
  4054. if ( contains ) {
  4055. setGlobalEval( tmp );
  4056. }
  4057. // Capture executables
  4058. if ( scripts ) {
  4059. j = 0;
  4060. while ( ( elem = tmp[ j++ ] ) ) {
  4061. if ( rscriptType.test( elem.type || "" ) ) {
  4062. scripts.push( elem );
  4063. }
  4064. }
  4065. }
  4066. }
  4067. return fragment;
  4068. }
  4069. ( function() {
  4070. var fragment = document.createDocumentFragment(),
  4071. div = fragment.appendChild( document.createElement( "div" ) ),
  4072. input = document.createElement( "input" );
  4073. // Support: Android 4.0 - 4.3 only
  4074. // Check state lost if the name is set (#11217)
  4075. // Support: Windows Web Apps (WWA)
  4076. // `name` and `type` must use .setAttribute for WWA (#14901)
  4077. input.setAttribute( "type", "radio" );
  4078. input.setAttribute( "checked", "checked" );
  4079. input.setAttribute( "name", "t" );
  4080. div.appendChild( input );
  4081. // Support: Android <=4.1 only
  4082. // Older WebKit doesn't clone checked state correctly in fragments
  4083. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  4084. // Support: IE <=11 only
  4085. // Make sure textarea (and checkbox) defaultValue is properly cloned
  4086. div.innerHTML = "<textarea>x</textarea>";
  4087. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  4088. } )();
  4089. var documentElement = document.documentElement;
  4090. var
  4091. rkeyEvent = /^key/,
  4092. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  4093. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  4094. function returnTrue() {
  4095. return true;
  4096. }
  4097. function returnFalse() {
  4098. return false;
  4099. }
  4100. // Support: IE <=9 only
  4101. // See #13393 for more info
  4102. function safeActiveElement() {
  4103. try {
  4104. return document.activeElement;
  4105. } catch ( err ) { }
  4106. }
  4107. function on( elem, types, selector, data, fn, one ) {
  4108. var origFn, type;
  4109. // Types can be a map of types/handlers
  4110. if ( typeof types === "object" ) {
  4111. // ( types-Object, selector, data )
  4112. if ( typeof selector !== "string" ) {
  4113. // ( types-Object, data )
  4114. data = data || selector;
  4115. selector = undefined;
  4116. }
  4117. for ( type in types ) {
  4118. on( elem, type, selector, data, types[ type ], one );
  4119. }
  4120. return elem;
  4121. }
  4122. if ( data == null && fn == null ) {
  4123. // ( types, fn )
  4124. fn = selector;
  4125. data = selector = undefined;
  4126. } else if ( fn == null ) {
  4127. if ( typeof selector === "string" ) {
  4128. // ( types, selector, fn )
  4129. fn = data;
  4130. data = undefined;
  4131. } else {
  4132. // ( types, data, fn )
  4133. fn = data;
  4134. data = selector;
  4135. selector = undefined;
  4136. }
  4137. }
  4138. if ( fn === false ) {
  4139. fn = returnFalse;
  4140. } else if ( !fn ) {
  4141. return elem;
  4142. }
  4143. if ( one === 1 ) {
  4144. origFn = fn;
  4145. fn = function( event ) {
  4146. // Can use an empty set, since event contains the info
  4147. jQuery().off( event );
  4148. return origFn.apply( this, arguments );
  4149. };
  4150. // Use same guid so caller can remove using origFn
  4151. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4152. }
  4153. return elem.each( function() {
  4154. jQuery.event.add( this, types, fn, data, selector );
  4155. } );
  4156. }
  4157. /*
  4158. * Helper functions for managing events -- not part of the public interface.
  4159. * Props to Dean Edwards' addEvent library for many of the ideas.
  4160. */
  4161. jQuery.event = {
  4162. global: {},
  4163. add: function( elem, types, handler, data, selector ) {
  4164. var handleObjIn, eventHandle, tmp,
  4165. events, t, handleObj,
  4166. special, handlers, type, namespaces, origType,
  4167. elemData = dataPriv.get( elem );
  4168. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  4169. if ( !elemData ) {
  4170. return;
  4171. }
  4172. // Caller can pass in an object of custom data in lieu of the handler
  4173. if ( handler.handler ) {
  4174. handleObjIn = handler;
  4175. handler = handleObjIn.handler;
  4176. selector = handleObjIn.selector;
  4177. }
  4178. // Ensure that invalid selectors throw exceptions at attach time
  4179. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  4180. if ( selector ) {
  4181. jQuery.find.matchesSelector( documentElement, selector );
  4182. }
  4183. // Make sure that the handler has a unique ID, used to find/remove it later
  4184. if ( !handler.guid ) {
  4185. handler.guid = jQuery.guid++;
  4186. }
  4187. // Init the element's event structure and main handler, if this is the first
  4188. if ( !( events = elemData.events ) ) {
  4189. events = elemData.events = {};
  4190. }
  4191. if ( !( eventHandle = elemData.handle ) ) {
  4192. eventHandle = elemData.handle = function( e ) {
  4193. // Discard the second event of a jQuery.event.trigger() and
  4194. // when an event is called after a page has unloaded
  4195. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  4196. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  4197. };
  4198. }
  4199. // Handle multiple events separated by a space
  4200. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4201. t = types.length;
  4202. while ( t-- ) {
  4203. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4204. type = origType = tmp[ 1 ];
  4205. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4206. // There *must* be a type, no attaching namespace-only handlers
  4207. if ( !type ) {
  4208. continue;
  4209. }
  4210. // If event changes its type, use the special event handlers for the changed type
  4211. special = jQuery.event.special[ type ] || {};
  4212. // If selector defined, determine special event api type, otherwise given type
  4213. type = ( selector ? special.delegateType : special.bindType ) || type;
  4214. // Update special based on newly reset type
  4215. special = jQuery.event.special[ type ] || {};
  4216. // handleObj is passed to all event handlers
  4217. handleObj = jQuery.extend( {
  4218. type: type,
  4219. origType: origType,
  4220. data: data,
  4221. handler: handler,
  4222. guid: handler.guid,
  4223. selector: selector,
  4224. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4225. namespace: namespaces.join( "." )
  4226. }, handleObjIn );
  4227. // Init the event handler queue if we're the first
  4228. if ( !( handlers = events[ type ] ) ) {
  4229. handlers = events[ type ] = [];
  4230. handlers.delegateCount = 0;
  4231. // Only use addEventListener if the special events handler returns false
  4232. if ( !special.setup ||
  4233. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4234. if ( elem.addEventListener ) {
  4235. elem.addEventListener( type, eventHandle );
  4236. }
  4237. }
  4238. }
  4239. if ( special.add ) {
  4240. special.add.call( elem, handleObj );
  4241. if ( !handleObj.handler.guid ) {
  4242. handleObj.handler.guid = handler.guid;
  4243. }
  4244. }
  4245. // Add to the element's handler list, delegates in front
  4246. if ( selector ) {
  4247. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4248. } else {
  4249. handlers.push( handleObj );
  4250. }
  4251. // Keep track of which events have ever been used, for event optimization
  4252. jQuery.event.global[ type ] = true;
  4253. }
  4254. },
  4255. // Detach an event or set of events from an element
  4256. remove: function( elem, types, handler, selector, mappedTypes ) {
  4257. var j, origCount, tmp,
  4258. events, t, handleObj,
  4259. special, handlers, type, namespaces, origType,
  4260. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4261. if ( !elemData || !( events = elemData.events ) ) {
  4262. return;
  4263. }
  4264. // Once for each type.namespace in types; type may be omitted
  4265. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4266. t = types.length;
  4267. while ( t-- ) {
  4268. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4269. type = origType = tmp[ 1 ];
  4270. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4271. // Unbind all events (on this namespace, if provided) for the element
  4272. if ( !type ) {
  4273. for ( type in events ) {
  4274. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4275. }
  4276. continue;
  4277. }
  4278. special = jQuery.event.special[ type ] || {};
  4279. type = ( selector ? special.delegateType : special.bindType ) || type;
  4280. handlers = events[ type ] || [];
  4281. tmp = tmp[ 2 ] &&
  4282. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4283. // Remove matching events
  4284. origCount = j = handlers.length;
  4285. while ( j-- ) {
  4286. handleObj = handlers[ j ];
  4287. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4288. ( !handler || handler.guid === handleObj.guid ) &&
  4289. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4290. ( !selector || selector === handleObj.selector ||
  4291. selector === "**" && handleObj.selector ) ) {
  4292. handlers.splice( j, 1 );
  4293. if ( handleObj.selector ) {
  4294. handlers.delegateCount--;
  4295. }
  4296. if ( special.remove ) {
  4297. special.remove.call( elem, handleObj );
  4298. }
  4299. }
  4300. }
  4301. // Remove generic event handler if we removed something and no more handlers exist
  4302. // (avoids potential for endless recursion during removal of special event handlers)
  4303. if ( origCount && !handlers.length ) {
  4304. if ( !special.teardown ||
  4305. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4306. jQuery.removeEvent( elem, type, elemData.handle );
  4307. }
  4308. delete events[ type ];
  4309. }
  4310. }
  4311. // Remove data and the expando if it's no longer used
  4312. if ( jQuery.isEmptyObject( events ) ) {
  4313. dataPriv.remove( elem, "handle events" );
  4314. }
  4315. },
  4316. dispatch: function( nativeEvent ) {
  4317. // Make a writable jQuery.Event from the native event object
  4318. var event = jQuery.event.fix( nativeEvent );
  4319. var i, j, ret, matched, handleObj, handlerQueue,
  4320. args = new Array( arguments.length ),
  4321. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  4322. special = jQuery.event.special[ event.type ] || {};
  4323. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4324. args[ 0 ] = event;
  4325. for ( i = 1; i < arguments.length; i++ ) {
  4326. args[ i ] = arguments[ i ];
  4327. }
  4328. event.delegateTarget = this;
  4329. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4330. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4331. return;
  4332. }
  4333. // Determine handlers
  4334. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4335. // Run delegates first; they may want to stop propagation beneath us
  4336. i = 0;
  4337. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4338. event.currentTarget = matched.elem;
  4339. j = 0;
  4340. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4341. !event.isImmediatePropagationStopped() ) {
  4342. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  4343. // a subset or equal to those in the bound event (both can have no namespace).
  4344. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  4345. event.handleObj = handleObj;
  4346. event.data = handleObj.data;
  4347. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4348. handleObj.handler ).apply( matched.elem, args );
  4349. if ( ret !== undefined ) {
  4350. if ( ( event.result = ret ) === false ) {
  4351. event.preventDefault();
  4352. event.stopPropagation();
  4353. }
  4354. }
  4355. }
  4356. }
  4357. }
  4358. // Call the postDispatch hook for the mapped type
  4359. if ( special.postDispatch ) {
  4360. special.postDispatch.call( this, event );
  4361. }
  4362. return event.result;
  4363. },
  4364. handlers: function( event, handlers ) {
  4365. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4366. handlerQueue = [],
  4367. delegateCount = handlers.delegateCount,
  4368. cur = event.target;
  4369. // Find delegate handlers
  4370. if ( delegateCount &&
  4371. // Support: IE <=9
  4372. // Black-hole SVG <use> instance trees (trac-13180)
  4373. cur.nodeType &&
  4374. // Support: Firefox <=42
  4375. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4376. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4377. // Support: IE 11 only
  4378. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4379. !( event.type === "click" && event.button >= 1 ) ) {
  4380. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4381. // Don't check non-elements (#13208)
  4382. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  4383. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4384. matchedHandlers = [];
  4385. matchedSelectors = {};
  4386. for ( i = 0; i < delegateCount; i++ ) {
  4387. handleObj = handlers[ i ];
  4388. // Don't conflict with Object.prototype properties (#13203)
  4389. sel = handleObj.selector + " ";
  4390. if ( matchedSelectors[ sel ] === undefined ) {
  4391. matchedSelectors[ sel ] = handleObj.needsContext ?
  4392. jQuery( sel, this ).index( cur ) > -1 :
  4393. jQuery.find( sel, this, null, [ cur ] ).length;
  4394. }
  4395. if ( matchedSelectors[ sel ] ) {
  4396. matchedHandlers.push( handleObj );
  4397. }
  4398. }
  4399. if ( matchedHandlers.length ) {
  4400. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4401. }
  4402. }
  4403. }
  4404. }
  4405. // Add the remaining (directly-bound) handlers
  4406. cur = this;
  4407. if ( delegateCount < handlers.length ) {
  4408. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4409. }
  4410. return handlerQueue;
  4411. },
  4412. addProp: function( name, hook ) {
  4413. Object.defineProperty( jQuery.Event.prototype, name, {
  4414. enumerable: true,
  4415. configurable: true,
  4416. get: jQuery.isFunction( hook ) ?
  4417. function() {
  4418. if ( this.originalEvent ) {
  4419. return hook( this.originalEvent );
  4420. }
  4421. } :
  4422. function() {
  4423. if ( this.originalEvent ) {
  4424. return this.originalEvent[ name ];
  4425. }
  4426. },
  4427. set: function( value ) {
  4428. Object.defineProperty( this, name, {
  4429. enumerable: true,
  4430. configurable: true,
  4431. writable: true,
  4432. value: value
  4433. } );
  4434. }
  4435. } );
  4436. },
  4437. fix: function( originalEvent ) {
  4438. return originalEvent[ jQuery.expando ] ?
  4439. originalEvent :
  4440. new jQuery.Event( originalEvent );
  4441. },
  4442. special: {
  4443. load: {
  4444. // Prevent triggered image.load events from bubbling to window.load
  4445. noBubble: true
  4446. },
  4447. focus: {
  4448. // Fire native event if possible so blur/focus sequence is correct
  4449. trigger: function() {
  4450. if ( this !== safeActiveElement() && this.focus ) {
  4451. this.focus();
  4452. return false;
  4453. }
  4454. },
  4455. delegateType: "focusin"
  4456. },
  4457. blur: {
  4458. trigger: function() {
  4459. if ( this === safeActiveElement() && this.blur ) {
  4460. this.blur();
  4461. return false;
  4462. }
  4463. },
  4464. delegateType: "focusout"
  4465. },
  4466. click: {
  4467. // For checkbox, fire native event so checked state will be right
  4468. trigger: function() {
  4469. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  4470. this.click();
  4471. return false;
  4472. }
  4473. },
  4474. // For cross-browser consistency, don't fire native .click() on links
  4475. _default: function( event ) {
  4476. return jQuery.nodeName( event.target, "a" );
  4477. }
  4478. },
  4479. beforeunload: {
  4480. postDispatch: function( event ) {
  4481. // Support: Firefox 20+
  4482. // Firefox doesn't alert if the returnValue field is not set.
  4483. if ( event.result !== undefined && event.originalEvent ) {
  4484. event.originalEvent.returnValue = event.result;
  4485. }
  4486. }
  4487. }
  4488. }
  4489. };
  4490. jQuery.removeEvent = function( elem, type, handle ) {
  4491. // This "if" is needed for plain objects
  4492. if ( elem.removeEventListener ) {
  4493. elem.removeEventListener( type, handle );
  4494. }
  4495. };
  4496. jQuery.Event = function( src, props ) {
  4497. // Allow instantiation without the 'new' keyword
  4498. if ( !( this instanceof jQuery.Event ) ) {
  4499. return new jQuery.Event( src, props );
  4500. }
  4501. // Event object
  4502. if ( src && src.type ) {
  4503. this.originalEvent = src;
  4504. this.type = src.type;
  4505. // Events bubbling up the document may have been marked as prevented
  4506. // by a handler lower down the tree; reflect the correct value.
  4507. this.isDefaultPrevented = src.defaultPrevented ||
  4508. src.defaultPrevented === undefined &&
  4509. // Support: Android <=2.3 only
  4510. src.returnValue === false ?
  4511. returnTrue :
  4512. returnFalse;
  4513. // Create target properties
  4514. // Support: Safari <=6 - 7 only
  4515. // Target should not be a text node (#504, #13143)
  4516. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4517. src.target.parentNode :
  4518. src.target;
  4519. this.currentTarget = src.currentTarget;
  4520. this.relatedTarget = src.relatedTarget;
  4521. // Event type
  4522. } else {
  4523. this.type = src;
  4524. }
  4525. // Put explicitly provided properties onto the event object
  4526. if ( props ) {
  4527. jQuery.extend( this, props );
  4528. }
  4529. // Create a timestamp if incoming event doesn't have one
  4530. this.timeStamp = src && src.timeStamp || jQuery.now();
  4531. // Mark it as fixed
  4532. this[ jQuery.expando ] = true;
  4533. };
  4534. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4535. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4536. jQuery.Event.prototype = {
  4537. constructor: jQuery.Event,
  4538. isDefaultPrevented: returnFalse,
  4539. isPropagationStopped: returnFalse,
  4540. isImmediatePropagationStopped: returnFalse,
  4541. isSimulated: false,
  4542. preventDefault: function() {
  4543. var e = this.originalEvent;
  4544. this.isDefaultPrevented = returnTrue;
  4545. if ( e && !this.isSimulated ) {
  4546. e.preventDefault();
  4547. }
  4548. },
  4549. stopPropagation: function() {
  4550. var e = this.originalEvent;
  4551. this.isPropagationStopped = returnTrue;
  4552. if ( e && !this.isSimulated ) {
  4553. e.stopPropagation();
  4554. }
  4555. },
  4556. stopImmediatePropagation: function() {
  4557. var e = this.originalEvent;
  4558. this.isImmediatePropagationStopped = returnTrue;
  4559. if ( e && !this.isSimulated ) {
  4560. e.stopImmediatePropagation();
  4561. }
  4562. this.stopPropagation();
  4563. }
  4564. };
  4565. // Includes all common event props including KeyEvent and MouseEvent specific props
  4566. jQuery.each( {
  4567. altKey: true,
  4568. bubbles: true,
  4569. cancelable: true,
  4570. changedTouches: true,
  4571. ctrlKey: true,
  4572. detail: true,
  4573. eventPhase: true,
  4574. metaKey: true,
  4575. pageX: true,
  4576. pageY: true,
  4577. shiftKey: true,
  4578. view: true,
  4579. "char": true,
  4580. charCode: true,
  4581. key: true,
  4582. keyCode: true,
  4583. button: true,
  4584. buttons: true,
  4585. clientX: true,
  4586. clientY: true,
  4587. offsetX: true,
  4588. offsetY: true,
  4589. pointerId: true,
  4590. pointerType: true,
  4591. screenX: true,
  4592. screenY: true,
  4593. targetTouches: true,
  4594. toElement: true,
  4595. touches: true,
  4596. which: function( event ) {
  4597. var button = event.button;
  4598. // Add which for key events
  4599. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  4600. return event.charCode != null ? event.charCode : event.keyCode;
  4601. }
  4602. // Add which for click: 1 === left; 2 === middle; 3 === right
  4603. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  4604. if ( button & 1 ) {
  4605. return 1;
  4606. }
  4607. if ( button & 2 ) {
  4608. return 3;
  4609. }
  4610. if ( button & 4 ) {
  4611. return 2;
  4612. }
  4613. return 0;
  4614. }
  4615. return event.which;
  4616. }
  4617. }, jQuery.event.addProp );
  4618. // Create mouseenter/leave events using mouseover/out and event-time checks
  4619. // so that event delegation works in jQuery.
  4620. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4621. //
  4622. // Support: Safari 7 only
  4623. // Safari sends mouseenter too often; see:
  4624. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4625. // for the description of the bug (it existed in older Chrome versions as well).
  4626. jQuery.each( {
  4627. mouseenter: "mouseover",
  4628. mouseleave: "mouseout",
  4629. pointerenter: "pointerover",
  4630. pointerleave: "pointerout"
  4631. }, function( orig, fix ) {
  4632. jQuery.event.special[ orig ] = {
  4633. delegateType: fix,
  4634. bindType: fix,
  4635. handle: function( event ) {
  4636. var ret,
  4637. target = this,
  4638. related = event.relatedTarget,
  4639. handleObj = event.handleObj;
  4640. // For mouseenter/leave call the handler if related is outside the target.
  4641. // NB: No relatedTarget if the mouse left/entered the browser window
  4642. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4643. event.type = handleObj.origType;
  4644. ret = handleObj.handler.apply( this, arguments );
  4645. event.type = fix;
  4646. }
  4647. return ret;
  4648. }
  4649. };
  4650. } );
  4651. jQuery.fn.extend( {
  4652. on: function( types, selector, data, fn ) {
  4653. return on( this, types, selector, data, fn );
  4654. },
  4655. one: function( types, selector, data, fn ) {
  4656. return on( this, types, selector, data, fn, 1 );
  4657. },
  4658. off: function( types, selector, fn ) {
  4659. var handleObj, type;
  4660. if ( types && types.preventDefault && types.handleObj ) {
  4661. // ( event ) dispatched jQuery.Event
  4662. handleObj = types.handleObj;
  4663. jQuery( types.delegateTarget ).off(
  4664. handleObj.namespace ?
  4665. handleObj.origType + "." + handleObj.namespace :
  4666. handleObj.origType,
  4667. handleObj.selector,
  4668. handleObj.handler
  4669. );
  4670. return this;
  4671. }
  4672. if ( typeof types === "object" ) {
  4673. // ( types-object [, selector] )
  4674. for ( type in types ) {
  4675. this.off( type, selector, types[ type ] );
  4676. }
  4677. return this;
  4678. }
  4679. if ( selector === false || typeof selector === "function" ) {
  4680. // ( types [, fn] )
  4681. fn = selector;
  4682. selector = undefined;
  4683. }
  4684. if ( fn === false ) {
  4685. fn = returnFalse;
  4686. }
  4687. return this.each( function() {
  4688. jQuery.event.remove( this, types, fn, selector );
  4689. } );
  4690. }
  4691. } );
  4692. var
  4693. /* eslint-disable max-len */
  4694. // See https://github.com/eslint/eslint/issues/3229
  4695. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  4696. /* eslint-enable */
  4697. // Support: IE <=10 - 11, Edge 12 - 13
  4698. // In IE/Edge using regex groups here causes severe slowdowns.
  4699. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4700. rnoInnerhtml = /<script|<style|<link/i,
  4701. // checked="checked" or checked
  4702. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4703. rscriptTypeMasked = /^true\/(.*)/,
  4704. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  4705. function manipulationTarget( elem, content ) {
  4706. if ( jQuery.nodeName( elem, "table" ) &&
  4707. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4708. return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
  4709. }
  4710. return elem;
  4711. }
  4712. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4713. function disableScript( elem ) {
  4714. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4715. return elem;
  4716. }
  4717. function restoreScript( elem ) {
  4718. var match = rscriptTypeMasked.exec( elem.type );
  4719. if ( match ) {
  4720. elem.type = match[ 1 ];
  4721. } else {
  4722. elem.removeAttribute( "type" );
  4723. }
  4724. return elem;
  4725. }
  4726. function cloneCopyEvent( src, dest ) {
  4727. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  4728. if ( dest.nodeType !== 1 ) {
  4729. return;
  4730. }
  4731. // 1. Copy private data: events, handlers, etc.
  4732. if ( dataPriv.hasData( src ) ) {
  4733. pdataOld = dataPriv.access( src );
  4734. pdataCur = dataPriv.set( dest, pdataOld );
  4735. events = pdataOld.events;
  4736. if ( events ) {
  4737. delete pdataCur.handle;
  4738. pdataCur.events = {};
  4739. for ( type in events ) {
  4740. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4741. jQuery.event.add( dest, type, events[ type ][ i ] );
  4742. }
  4743. }
  4744. }
  4745. }
  4746. // 2. Copy user data
  4747. if ( dataUser.hasData( src ) ) {
  4748. udataOld = dataUser.access( src );
  4749. udataCur = jQuery.extend( {}, udataOld );
  4750. dataUser.set( dest, udataCur );
  4751. }
  4752. }
  4753. // Fix IE bugs, see support tests
  4754. function fixInput( src, dest ) {
  4755. var nodeName = dest.nodeName.toLowerCase();
  4756. // Fails to persist the checked state of a cloned checkbox or radio button.
  4757. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4758. dest.checked = src.checked;
  4759. // Fails to return the selected option to the default selected state when cloning options
  4760. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4761. dest.defaultValue = src.defaultValue;
  4762. }
  4763. }
  4764. function domManip( collection, args, callback, ignored ) {
  4765. // Flatten any nested arrays
  4766. args = concat.apply( [], args );
  4767. var fragment, first, scripts, hasScripts, node, doc,
  4768. i = 0,
  4769. l = collection.length,
  4770. iNoClone = l - 1,
  4771. value = args[ 0 ],
  4772. isFunction = jQuery.isFunction( value );
  4773. // We can't cloneNode fragments that contain checked, in WebKit
  4774. if ( isFunction ||
  4775. ( l > 1 && typeof value === "string" &&
  4776. !support.checkClone && rchecked.test( value ) ) ) {
  4777. return collection.each( function( index ) {
  4778. var self = collection.eq( index );
  4779. if ( isFunction ) {
  4780. args[ 0 ] = value.call( this, index, self.html() );
  4781. }
  4782. domManip( self, args, callback, ignored );
  4783. } );
  4784. }
  4785. if ( l ) {
  4786. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4787. first = fragment.firstChild;
  4788. if ( fragment.childNodes.length === 1 ) {
  4789. fragment = first;
  4790. }
  4791. // Require either new content or an interest in ignored elements to invoke the callback
  4792. if ( first || ignored ) {
  4793. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4794. hasScripts = scripts.length;
  4795. // Use the original fragment for the last item
  4796. // instead of the first because it can end up
  4797. // being emptied incorrectly in certain situations (#8070).
  4798. for ( ; i < l; i++ ) {
  4799. node = fragment;
  4800. if ( i !== iNoClone ) {
  4801. node = jQuery.clone( node, true, true );
  4802. // Keep references to cloned scripts for later restoration
  4803. if ( hasScripts ) {
  4804. // Support: Android <=4.0 only, PhantomJS 1 only
  4805. // push.apply(_, arraylike) throws on ancient WebKit
  4806. jQuery.merge( scripts, getAll( node, "script" ) );
  4807. }
  4808. }
  4809. callback.call( collection[ i ], node, i );
  4810. }
  4811. if ( hasScripts ) {
  4812. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4813. // Reenable scripts
  4814. jQuery.map( scripts, restoreScript );
  4815. // Evaluate executable scripts on first document insertion
  4816. for ( i = 0; i < hasScripts; i++ ) {
  4817. node = scripts[ i ];
  4818. if ( rscriptType.test( node.type || "" ) &&
  4819. !dataPriv.access( node, "globalEval" ) &&
  4820. jQuery.contains( doc, node ) ) {
  4821. if ( node.src ) {
  4822. // Optional AJAX dependency, but won't run scripts if not present
  4823. if ( jQuery._evalUrl ) {
  4824. jQuery._evalUrl( node.src );
  4825. }
  4826. } else {
  4827. DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
  4828. }
  4829. }
  4830. }
  4831. }
  4832. }
  4833. }
  4834. return collection;
  4835. }
  4836. function remove( elem, selector, keepData ) {
  4837. var node,
  4838. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4839. i = 0;
  4840. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4841. if ( !keepData && node.nodeType === 1 ) {
  4842. jQuery.cleanData( getAll( node ) );
  4843. }
  4844. if ( node.parentNode ) {
  4845. if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
  4846. setGlobalEval( getAll( node, "script" ) );
  4847. }
  4848. node.parentNode.removeChild( node );
  4849. }
  4850. }
  4851. return elem;
  4852. }
  4853. jQuery.extend( {
  4854. htmlPrefilter: function( html ) {
  4855. return html.replace( rxhtmlTag, "<$1></$2>" );
  4856. },
  4857. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4858. var i, l, srcElements, destElements,
  4859. clone = elem.cloneNode( true ),
  4860. inPage = jQuery.contains( elem.ownerDocument, elem );
  4861. // Fix IE cloning issues
  4862. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4863. !jQuery.isXMLDoc( elem ) ) {
  4864. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  4865. destElements = getAll( clone );
  4866. srcElements = getAll( elem );
  4867. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4868. fixInput( srcElements[ i ], destElements[ i ] );
  4869. }
  4870. }
  4871. // Copy the events from the original to the clone
  4872. if ( dataAndEvents ) {
  4873. if ( deepDataAndEvents ) {
  4874. srcElements = srcElements || getAll( elem );
  4875. destElements = destElements || getAll( clone );
  4876. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4877. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4878. }
  4879. } else {
  4880. cloneCopyEvent( elem, clone );
  4881. }
  4882. }
  4883. // Preserve script evaluation history
  4884. destElements = getAll( clone, "script" );
  4885. if ( destElements.length > 0 ) {
  4886. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4887. }
  4888. // Return the cloned set
  4889. return clone;
  4890. },
  4891. cleanData: function( elems ) {
  4892. var data, elem, type,
  4893. special = jQuery.event.special,
  4894. i = 0;
  4895. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  4896. if ( acceptData( elem ) ) {
  4897. if ( ( data = elem[ dataPriv.expando ] ) ) {
  4898. if ( data.events ) {
  4899. for ( type in data.events ) {
  4900. if ( special[ type ] ) {
  4901. jQuery.event.remove( elem, type );
  4902. // This is a shortcut to avoid jQuery.event.remove's overhead
  4903. } else {
  4904. jQuery.removeEvent( elem, type, data.handle );
  4905. }
  4906. }
  4907. }
  4908. // Support: Chrome <=35 - 45+
  4909. // Assign undefined instead of using delete, see Data#remove
  4910. elem[ dataPriv.expando ] = undefined;
  4911. }
  4912. if ( elem[ dataUser.expando ] ) {
  4913. // Support: Chrome <=35 - 45+
  4914. // Assign undefined instead of using delete, see Data#remove
  4915. elem[ dataUser.expando ] = undefined;
  4916. }
  4917. }
  4918. }
  4919. }
  4920. } );
  4921. jQuery.fn.extend( {
  4922. detach: function( selector ) {
  4923. return remove( this, selector, true );
  4924. },
  4925. remove: function( selector ) {
  4926. return remove( this, selector );
  4927. },
  4928. text: function( value ) {
  4929. return access( this, function( value ) {
  4930. return value === undefined ?
  4931. jQuery.text( this ) :
  4932. this.empty().each( function() {
  4933. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4934. this.textContent = value;
  4935. }
  4936. } );
  4937. }, null, value, arguments.length );
  4938. },
  4939. append: function() {
  4940. return domManip( this, arguments, function( elem ) {
  4941. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4942. var target = manipulationTarget( this, elem );
  4943. target.appendChild( elem );
  4944. }
  4945. } );
  4946. },
  4947. prepend: function() {
  4948. return domManip( this, arguments, function( elem ) {
  4949. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4950. var target = manipulationTarget( this, elem );
  4951. target.insertBefore( elem, target.firstChild );
  4952. }
  4953. } );
  4954. },
  4955. before: function() {
  4956. return domManip( this, arguments, function( elem ) {
  4957. if ( this.parentNode ) {
  4958. this.parentNode.insertBefore( elem, this );
  4959. }
  4960. } );
  4961. },
  4962. after: function() {
  4963. return domManip( this, arguments, function( elem ) {
  4964. if ( this.parentNode ) {
  4965. this.parentNode.insertBefore( elem, this.nextSibling );
  4966. }
  4967. } );
  4968. },
  4969. empty: function() {
  4970. var elem,
  4971. i = 0;
  4972. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  4973. if ( elem.nodeType === 1 ) {
  4974. // Prevent memory leaks
  4975. jQuery.cleanData( getAll( elem, false ) );
  4976. // Remove any remaining nodes
  4977. elem.textContent = "";
  4978. }
  4979. }
  4980. return this;
  4981. },
  4982. clone: function( dataAndEvents, deepDataAndEvents ) {
  4983. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4984. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4985. return this.map( function() {
  4986. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4987. } );
  4988. },
  4989. html: function( value ) {
  4990. return access( this, function( value ) {
  4991. var elem = this[ 0 ] || {},
  4992. i = 0,
  4993. l = this.length;
  4994. if ( value === undefined && elem.nodeType === 1 ) {
  4995. return elem.innerHTML;
  4996. }
  4997. // See if we can take a shortcut and just use innerHTML
  4998. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4999. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  5000. value = jQuery.htmlPrefilter( value );
  5001. try {
  5002. for ( ; i < l; i++ ) {
  5003. elem = this[ i ] || {};
  5004. // Remove element nodes and prevent memory leaks
  5005. if ( elem.nodeType === 1 ) {
  5006. jQuery.cleanData( getAll( elem, false ) );
  5007. elem.innerHTML = value;
  5008. }
  5009. }
  5010. elem = 0;
  5011. // If using innerHTML throws an exception, use the fallback method
  5012. } catch ( e ) {}
  5013. }
  5014. if ( elem ) {
  5015. this.empty().append( value );
  5016. }
  5017. }, null, value, arguments.length );
  5018. },
  5019. replaceWith: function() {
  5020. var ignored = [];
  5021. // Make the changes, replacing each non-ignored context element with the new content
  5022. return domManip( this, arguments, function( elem ) {
  5023. var parent = this.parentNode;
  5024. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5025. jQuery.cleanData( getAll( this ) );
  5026. if ( parent ) {
  5027. parent.replaceChild( elem, this );
  5028. }
  5029. }
  5030. // Force callback invocation
  5031. }, ignored );
  5032. }
  5033. } );
  5034. jQuery.each( {
  5035. appendTo: "append",
  5036. prependTo: "prepend",
  5037. insertBefore: "before",
  5038. insertAfter: "after",
  5039. replaceAll: "replaceWith"
  5040. }, function( name, original ) {
  5041. jQuery.fn[ name ] = function( selector ) {
  5042. var elems,
  5043. ret = [],
  5044. insert = jQuery( selector ),
  5045. last = insert.length - 1,
  5046. i = 0;
  5047. for ( ; i <= last; i++ ) {
  5048. elems = i === last ? this : this.clone( true );
  5049. jQuery( insert[ i ] )[ original ]( elems );
  5050. // Support: Android <=4.0 only, PhantomJS 1 only
  5051. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5052. push.apply( ret, elems.get() );
  5053. }
  5054. return this.pushStack( ret );
  5055. };
  5056. } );
  5057. var rmargin = ( /^margin/ );
  5058. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5059. var getStyles = function( elem ) {
  5060. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  5061. // IE throws on elements created in popups
  5062. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5063. var view = elem.ownerDocument.defaultView;
  5064. if ( !view || !view.opener ) {
  5065. view = window;
  5066. }
  5067. return view.getComputedStyle( elem );
  5068. };
  5069. ( function() {
  5070. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5071. // so they're executed at the same time to save the second computation.
  5072. function computeStyleTests() {
  5073. // This is a singleton, we need to execute it only once
  5074. if ( !div ) {
  5075. return;
  5076. }
  5077. div.style.cssText =
  5078. "box-sizing:border-box;" +
  5079. "position:relative;display:block;" +
  5080. "margin:auto;border:1px;padding:1px;" +
  5081. "top:1%;width:50%";
  5082. div.innerHTML = "";
  5083. documentElement.appendChild( container );
  5084. var divStyle = window.getComputedStyle( div );
  5085. pixelPositionVal = divStyle.top !== "1%";
  5086. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5087. reliableMarginLeftVal = divStyle.marginLeft === "2px";
  5088. boxSizingReliableVal = divStyle.width === "4px";
  5089. // Support: Android 4.0 - 4.3 only
  5090. // Some styles come back with percentage values, even though they shouldn't
  5091. div.style.marginRight = "50%";
  5092. pixelMarginRightVal = divStyle.marginRight === "4px";
  5093. documentElement.removeChild( container );
  5094. // Nullify the div so it wouldn't be stored in the memory and
  5095. // it will also be a sign that checks already performed
  5096. div = null;
  5097. }
  5098. var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
  5099. container = document.createElement( "div" ),
  5100. div = document.createElement( "div" );
  5101. // Finish early in limited (non-browser) environments
  5102. if ( !div.style ) {
  5103. return;
  5104. }
  5105. // Support: IE <=9 - 11 only
  5106. // Style of cloned element affects source element cloned (#8908)
  5107. div.style.backgroundClip = "content-box";
  5108. div.cloneNode( true ).style.backgroundClip = "";
  5109. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5110. container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  5111. "padding:0;margin-top:1px;position:absolute";
  5112. container.appendChild( div );
  5113. jQuery.extend( support, {
  5114. pixelPosition: function() {
  5115. computeStyleTests();
  5116. return pixelPositionVal;
  5117. },
  5118. boxSizingReliable: function() {
  5119. computeStyleTests();
  5120. return boxSizingReliableVal;
  5121. },
  5122. pixelMarginRight: function() {
  5123. computeStyleTests();
  5124. return pixelMarginRightVal;
  5125. },
  5126. reliableMarginLeft: function() {
  5127. computeStyleTests();
  5128. return reliableMarginLeftVal;
  5129. }
  5130. } );
  5131. } )();
  5132. function curCSS( elem, name, computed ) {
  5133. var width, minWidth, maxWidth, ret,
  5134. style = elem.style;
  5135. computed = computed || getStyles( elem );
  5136. // Support: IE <=9 only
  5137. // getPropertyValue is only needed for .css('filter') (#12537)
  5138. if ( computed ) {
  5139. ret = computed.getPropertyValue( name ) || computed[ name ];
  5140. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  5141. ret = jQuery.style( elem, name );
  5142. }
  5143. // A tribute to the "awesome hack by Dean Edwards"
  5144. // Android Browser returns percentage for some values,
  5145. // but width seems to be reliably pixels.
  5146. // This is against the CSSOM draft spec:
  5147. // https://drafts.csswg.org/cssom/#resolved-values
  5148. if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  5149. // Remember the original values
  5150. width = style.width;
  5151. minWidth = style.minWidth;
  5152. maxWidth = style.maxWidth;
  5153. // Put in the new values to get a computed value out
  5154. style.minWidth = style.maxWidth = style.width = ret;
  5155. ret = computed.width;
  5156. // Revert the changed values
  5157. style.width = width;
  5158. style.minWidth = minWidth;
  5159. style.maxWidth = maxWidth;
  5160. }
  5161. }
  5162. return ret !== undefined ?
  5163. // Support: IE <=9 - 11 only
  5164. // IE returns zIndex value as an integer.
  5165. ret + "" :
  5166. ret;
  5167. }
  5168. function addGetHookIf( conditionFn, hookFn ) {
  5169. // Define the hook, we'll check on the first run if it's really needed.
  5170. return {
  5171. get: function() {
  5172. if ( conditionFn() ) {
  5173. // Hook not needed (or it's not possible to use it due
  5174. // to missing dependency), remove it.
  5175. delete this.get;
  5176. return;
  5177. }
  5178. // Hook needed; redefine it so that the support test is not executed again.
  5179. return ( this.get = hookFn ).apply( this, arguments );
  5180. }
  5181. };
  5182. }
  5183. var
  5184. // Swappable if display is none or starts with table
  5185. // except "table", "table-cell", or "table-caption"
  5186. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5187. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5188. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5189. cssNormalTransform = {
  5190. letterSpacing: "0",
  5191. fontWeight: "400"
  5192. },
  5193. cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5194. emptyStyle = document.createElement( "div" ).style;
  5195. // Return a css property mapped to a potentially vendor prefixed property
  5196. function vendorPropName( name ) {
  5197. // Shortcut for names that are not vendor prefixed
  5198. if ( name in emptyStyle ) {
  5199. return name;
  5200. }
  5201. // Check for vendor prefixed names
  5202. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5203. i = cssPrefixes.length;
  5204. while ( i-- ) {
  5205. name = cssPrefixes[ i ] + capName;
  5206. if ( name in emptyStyle ) {
  5207. return name;
  5208. }
  5209. }
  5210. }
  5211. function setPositiveNumber( elem, value, subtract ) {
  5212. // Any relative (+/-) values have already been
  5213. // normalized at this point
  5214. var matches = rcssNum.exec( value );
  5215. return matches ?
  5216. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5217. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5218. value;
  5219. }
  5220. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  5221. var i,
  5222. val = 0;
  5223. // If we already have the right measurement, avoid augmentation
  5224. if ( extra === ( isBorderBox ? "border" : "content" ) ) {
  5225. i = 4;
  5226. // Otherwise initialize for horizontal or vertical properties
  5227. } else {
  5228. i = name === "width" ? 1 : 0;
  5229. }
  5230. for ( ; i < 4; i += 2 ) {
  5231. // Both box models exclude margin, so add it if we want it
  5232. if ( extra === "margin" ) {
  5233. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  5234. }
  5235. if ( isBorderBox ) {
  5236. // border-box includes padding, so remove it if we want content
  5237. if ( extra === "content" ) {
  5238. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5239. }
  5240. // At this point, extra isn't border nor margin, so remove border
  5241. if ( extra !== "margin" ) {
  5242. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5243. }
  5244. } else {
  5245. // At this point, extra isn't content, so add padding
  5246. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5247. // At this point, extra isn't content nor padding, so add border
  5248. if ( extra !== "padding" ) {
  5249. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5250. }
  5251. }
  5252. }
  5253. return val;
  5254. }
  5255. function getWidthOrHeight( elem, name, extra ) {
  5256. // Start with offset property, which is equivalent to the border-box value
  5257. var val,
  5258. valueIsBorderBox = true,
  5259. styles = getStyles( elem ),
  5260. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5261. // Support: IE <=11 only
  5262. // Running getBoundingClientRect on a disconnected node
  5263. // in IE throws an error.
  5264. if ( elem.getClientRects().length ) {
  5265. val = elem.getBoundingClientRect()[ name ];
  5266. }
  5267. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  5268. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  5269. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  5270. if ( val <= 0 || val == null ) {
  5271. // Fall back to computed then uncomputed css if necessary
  5272. val = curCSS( elem, name, styles );
  5273. if ( val < 0 || val == null ) {
  5274. val = elem.style[ name ];
  5275. }
  5276. // Computed unit is not pixels. Stop here and return.
  5277. if ( rnumnonpx.test( val ) ) {
  5278. return val;
  5279. }
  5280. // Check for style in case a browser which returns unreliable values
  5281. // for getComputedStyle silently falls back to the reliable elem.style
  5282. valueIsBorderBox = isBorderBox &&
  5283. ( support.boxSizingReliable() || val === elem.style[ name ] );
  5284. // Normalize "", auto, and prepare for extra
  5285. val = parseFloat( val ) || 0;
  5286. }
  5287. // Use the active box-sizing model to add/subtract irrelevant styles
  5288. return ( val +
  5289. augmentWidthOrHeight(
  5290. elem,
  5291. name,
  5292. extra || ( isBorderBox ? "border" : "content" ),
  5293. valueIsBorderBox,
  5294. styles
  5295. )
  5296. ) + "px";
  5297. }
  5298. jQuery.extend( {
  5299. // Add in style property hooks for overriding the default
  5300. // behavior of getting and setting a style property
  5301. cssHooks: {
  5302. opacity: {
  5303. get: function( elem, computed ) {
  5304. if ( computed ) {
  5305. // We should always get a number back from opacity
  5306. var ret = curCSS( elem, "opacity" );
  5307. return ret === "" ? "1" : ret;
  5308. }
  5309. }
  5310. }
  5311. },
  5312. // Don't automatically add "px" to these possibly-unitless properties
  5313. cssNumber: {
  5314. "animationIterationCount": true,
  5315. "columnCount": true,
  5316. "fillOpacity": true,
  5317. "flexGrow": true,
  5318. "flexShrink": true,
  5319. "fontWeight": true,
  5320. "lineHeight": true,
  5321. "opacity": true,
  5322. "order": true,
  5323. "orphans": true,
  5324. "widows": true,
  5325. "zIndex": true,
  5326. "zoom": true
  5327. },
  5328. // Add in properties whose names you wish to fix before
  5329. // setting or getting the value
  5330. cssProps: {
  5331. "float": "cssFloat"
  5332. },
  5333. // Get and set the style property on a DOM Node
  5334. style: function( elem, name, value, extra ) {
  5335. // Don't set styles on text and comment nodes
  5336. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5337. return;
  5338. }
  5339. // Make sure that we're working with the right name
  5340. var ret, type, hooks,
  5341. origName = jQuery.camelCase( name ),
  5342. style = elem.style;
  5343. name = jQuery.cssProps[ origName ] ||
  5344. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  5345. // Gets hook for the prefixed version, then unprefixed version
  5346. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5347. // Check if we're setting a value
  5348. if ( value !== undefined ) {
  5349. type = typeof value;
  5350. // Convert "+=" or "-=" to relative numbers (#7345)
  5351. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5352. value = adjustCSS( elem, name, ret );
  5353. // Fixes bug #9237
  5354. type = "number";
  5355. }
  5356. // Make sure that null and NaN values aren't set (#7116)
  5357. if ( value == null || value !== value ) {
  5358. return;
  5359. }
  5360. // If a number was passed in, add the unit (except for certain CSS properties)
  5361. if ( type === "number" ) {
  5362. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5363. }
  5364. // background-* props affect original clone's values
  5365. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5366. style[ name ] = "inherit";
  5367. }
  5368. // If a hook was provided, use that value, otherwise just set the specified value
  5369. if ( !hooks || !( "set" in hooks ) ||
  5370. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5371. style[ name ] = value;
  5372. }
  5373. } else {
  5374. // If a hook was provided get the non-computed value from there
  5375. if ( hooks && "get" in hooks &&
  5376. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5377. return ret;
  5378. }
  5379. // Otherwise just get the value from the style object
  5380. return style[ name ];
  5381. }
  5382. },
  5383. css: function( elem, name, extra, styles ) {
  5384. var val, num, hooks,
  5385. origName = jQuery.camelCase( name );
  5386. // Make sure that we're working with the right name
  5387. name = jQuery.cssProps[ origName ] ||
  5388. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  5389. // Try prefixed name followed by the unprefixed name
  5390. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5391. // If a hook was provided get the computed value from there
  5392. if ( hooks && "get" in hooks ) {
  5393. val = hooks.get( elem, true, extra );
  5394. }
  5395. // Otherwise, if a way to get the computed value exists, use that
  5396. if ( val === undefined ) {
  5397. val = curCSS( elem, name, styles );
  5398. }
  5399. // Convert "normal" to computed value
  5400. if ( val === "normal" && name in cssNormalTransform ) {
  5401. val = cssNormalTransform[ name ];
  5402. }
  5403. // Make numeric if forced or a qualifier was provided and val looks numeric
  5404. if ( extra === "" || extra ) {
  5405. num = parseFloat( val );
  5406. return extra === true || isFinite( num ) ? num || 0 : val;
  5407. }
  5408. return val;
  5409. }
  5410. } );
  5411. jQuery.each( [ "height", "width" ], function( i, name ) {
  5412. jQuery.cssHooks[ name ] = {
  5413. get: function( elem, computed, extra ) {
  5414. if ( computed ) {
  5415. // Certain elements can have dimension info if we invisibly show them
  5416. // but it must have a current display style that would benefit
  5417. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5418. // Support: Safari 8+
  5419. // Table columns in Safari have non-zero offsetWidth & zero
  5420. // getBoundingClientRect().width unless display is changed.
  5421. // Support: IE <=11 only
  5422. // Running getBoundingClientRect on a disconnected node
  5423. // in IE throws an error.
  5424. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5425. swap( elem, cssShow, function() {
  5426. return getWidthOrHeight( elem, name, extra );
  5427. } ) :
  5428. getWidthOrHeight( elem, name, extra );
  5429. }
  5430. },
  5431. set: function( elem, value, extra ) {
  5432. var matches,
  5433. styles = extra && getStyles( elem ),
  5434. subtract = extra && augmentWidthOrHeight(
  5435. elem,
  5436. name,
  5437. extra,
  5438. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5439. styles
  5440. );
  5441. // Convert to pixels if value adjustment is needed
  5442. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5443. ( matches[ 3 ] || "px" ) !== "px" ) {
  5444. elem.style[ name ] = value;
  5445. value = jQuery.css( elem, name );
  5446. }
  5447. return setPositiveNumber( elem, value, subtract );
  5448. }
  5449. };
  5450. } );
  5451. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5452. function( elem, computed ) {
  5453. if ( computed ) {
  5454. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5455. elem.getBoundingClientRect().left -
  5456. swap( elem, { marginLeft: 0 }, function() {
  5457. return elem.getBoundingClientRect().left;
  5458. } )
  5459. ) + "px";
  5460. }
  5461. }
  5462. );
  5463. // These hooks are used by animate to expand properties
  5464. jQuery.each( {
  5465. margin: "",
  5466. padding: "",
  5467. border: "Width"
  5468. }, function( prefix, suffix ) {
  5469. jQuery.cssHooks[ prefix + suffix ] = {
  5470. expand: function( value ) {
  5471. var i = 0,
  5472. expanded = {},
  5473. // Assumes a single number if not a string
  5474. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5475. for ( ; i < 4; i++ ) {
  5476. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5477. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5478. }
  5479. return expanded;
  5480. }
  5481. };
  5482. if ( !rmargin.test( prefix ) ) {
  5483. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5484. }
  5485. } );
  5486. jQuery.fn.extend( {
  5487. css: function( name, value ) {
  5488. return access( this, function( elem, name, value ) {
  5489. var styles, len,
  5490. map = {},
  5491. i = 0;
  5492. if ( jQuery.isArray( name ) ) {
  5493. styles = getStyles( elem );
  5494. len = name.length;
  5495. for ( ; i < len; i++ ) {
  5496. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5497. }
  5498. return map;
  5499. }
  5500. return value !== undefined ?
  5501. jQuery.style( elem, name, value ) :
  5502. jQuery.css( elem, name );
  5503. }, name, value, arguments.length > 1 );
  5504. }
  5505. } );
  5506. function Tween( elem, options, prop, end, easing ) {
  5507. return new Tween.prototype.init( elem, options, prop, end, easing );
  5508. }
  5509. jQuery.Tween = Tween;
  5510. Tween.prototype = {
  5511. constructor: Tween,
  5512. init: function( elem, options, prop, end, easing, unit ) {
  5513. this.elem = elem;
  5514. this.prop = prop;
  5515. this.easing = easing || jQuery.easing._default;
  5516. this.options = options;
  5517. this.start = this.now = this.cur();
  5518. this.end = end;
  5519. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5520. },
  5521. cur: function() {
  5522. var hooks = Tween.propHooks[ this.prop ];
  5523. return hooks && hooks.get ?
  5524. hooks.get( this ) :
  5525. Tween.propHooks._default.get( this );
  5526. },
  5527. run: function( percent ) {
  5528. var eased,
  5529. hooks = Tween.propHooks[ this.prop ];
  5530. if ( this.options.duration ) {
  5531. this.pos = eased = jQuery.easing[ this.easing ](
  5532. percent, this.options.duration * percent, 0, 1, this.options.duration
  5533. );
  5534. } else {
  5535. this.pos = eased = percent;
  5536. }
  5537. this.now = ( this.end - this.start ) * eased + this.start;
  5538. if ( this.options.step ) {
  5539. this.options.step.call( this.elem, this.now, this );
  5540. }
  5541. if ( hooks && hooks.set ) {
  5542. hooks.set( this );
  5543. } else {
  5544. Tween.propHooks._default.set( this );
  5545. }
  5546. return this;
  5547. }
  5548. };
  5549. Tween.prototype.init.prototype = Tween.prototype;
  5550. Tween.propHooks = {
  5551. _default: {
  5552. get: function( tween ) {
  5553. var result;
  5554. // Use a property on the element directly when it is not a DOM element,
  5555. // or when there is no matching style property that exists.
  5556. if ( tween.elem.nodeType !== 1 ||
  5557. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5558. return tween.elem[ tween.prop ];
  5559. }
  5560. // Passing an empty string as a 3rd parameter to .css will automatically
  5561. // attempt a parseFloat and fallback to a string if the parse fails.
  5562. // Simple values such as "10px" are parsed to Float;
  5563. // complex values such as "rotate(1rad)" are returned as-is.
  5564. result = jQuery.css( tween.elem, tween.prop, "" );
  5565. // Empty strings, null, undefined and "auto" are converted to 0.
  5566. return !result || result === "auto" ? 0 : result;
  5567. },
  5568. set: function( tween ) {
  5569. // Use step hook for back compat.
  5570. // Use cssHook if its there.
  5571. // Use .style if available and use plain properties where available.
  5572. if ( jQuery.fx.step[ tween.prop ] ) {
  5573. jQuery.fx.step[ tween.prop ]( tween );
  5574. } else if ( tween.elem.nodeType === 1 &&
  5575. ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
  5576. jQuery.cssHooks[ tween.prop ] ) ) {
  5577. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5578. } else {
  5579. tween.elem[ tween.prop ] = tween.now;
  5580. }
  5581. }
  5582. }
  5583. };
  5584. // Support: IE <=9 only
  5585. // Panic based approach to setting things on disconnected nodes
  5586. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5587. set: function( tween ) {
  5588. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5589. tween.elem[ tween.prop ] = tween.now;
  5590. }
  5591. }
  5592. };
  5593. jQuery.easing = {
  5594. linear: function( p ) {
  5595. return p;
  5596. },
  5597. swing: function( p ) {
  5598. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5599. },
  5600. _default: "swing"
  5601. };
  5602. jQuery.fx = Tween.prototype.init;
  5603. // Back compat <1.8 extension point
  5604. jQuery.fx.step = {};
  5605. var
  5606. fxNow, timerId,
  5607. rfxtypes = /^(?:toggle|show|hide)$/,
  5608. rrun = /queueHooks$/;
  5609. function raf() {
  5610. if ( timerId ) {
  5611. window.requestAnimationFrame( raf );
  5612. jQuery.fx.tick();
  5613. }
  5614. }
  5615. // Animations created synchronously will run synchronously
  5616. function createFxNow() {
  5617. window.setTimeout( function() {
  5618. fxNow = undefined;
  5619. } );
  5620. return ( fxNow = jQuery.now() );
  5621. }
  5622. // Generate parameters to create a standard animation
  5623. function genFx( type, includeWidth ) {
  5624. var which,
  5625. i = 0,
  5626. attrs = { height: type };
  5627. // If we include width, step value is 1 to do all cssExpand values,
  5628. // otherwise step value is 2 to skip over Left and Right
  5629. includeWidth = includeWidth ? 1 : 0;
  5630. for ( ; i < 4; i += 2 - includeWidth ) {
  5631. which = cssExpand[ i ];
  5632. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5633. }
  5634. if ( includeWidth ) {
  5635. attrs.opacity = attrs.width = type;
  5636. }
  5637. return attrs;
  5638. }
  5639. function createTween( value, prop, animation ) {
  5640. var tween,
  5641. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5642. index = 0,
  5643. length = collection.length;
  5644. for ( ; index < length; index++ ) {
  5645. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5646. // We're done with this property
  5647. return tween;
  5648. }
  5649. }
  5650. }
  5651. function defaultPrefilter( elem, props, opts ) {
  5652. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5653. isBox = "width" in props || "height" in props,
  5654. anim = this,
  5655. orig = {},
  5656. style = elem.style,
  5657. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5658. dataShow = dataPriv.get( elem, "fxshow" );
  5659. // Queue-skipping animations hijack the fx hooks
  5660. if ( !opts.queue ) {
  5661. hooks = jQuery._queueHooks( elem, "fx" );
  5662. if ( hooks.unqueued == null ) {
  5663. hooks.unqueued = 0;
  5664. oldfire = hooks.empty.fire;
  5665. hooks.empty.fire = function() {
  5666. if ( !hooks.unqueued ) {
  5667. oldfire();
  5668. }
  5669. };
  5670. }
  5671. hooks.unqueued++;
  5672. anim.always( function() {
  5673. // Ensure the complete handler is called before this completes
  5674. anim.always( function() {
  5675. hooks.unqueued--;
  5676. if ( !jQuery.queue( elem, "fx" ).length ) {
  5677. hooks.empty.fire();
  5678. }
  5679. } );
  5680. } );
  5681. }
  5682. // Detect show/hide animations
  5683. for ( prop in props ) {
  5684. value = props[ prop ];
  5685. if ( rfxtypes.test( value ) ) {
  5686. delete props[ prop ];
  5687. toggle = toggle || value === "toggle";
  5688. if ( value === ( hidden ? "hide" : "show" ) ) {
  5689. // Pretend to be hidden if this is a "show" and
  5690. // there is still data from a stopped show/hide
  5691. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5692. hidden = true;
  5693. // Ignore all other no-op show/hide data
  5694. } else {
  5695. continue;
  5696. }
  5697. }
  5698. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5699. }
  5700. }
  5701. // Bail out if this is a no-op like .hide().hide()
  5702. propTween = !jQuery.isEmptyObject( props );
  5703. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  5704. return;
  5705. }
  5706. // Restrict "overflow" and "display" styles during box animations
  5707. if ( isBox && elem.nodeType === 1 ) {
  5708. // Support: IE <=9 - 11, Edge 12 - 13
  5709. // Record all 3 overflow attributes because IE does not infer the shorthand
  5710. // from identically-valued overflowX and overflowY
  5711. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5712. // Identify a display type, preferring old show/hide data over the CSS cascade
  5713. restoreDisplay = dataShow && dataShow.display;
  5714. if ( restoreDisplay == null ) {
  5715. restoreDisplay = dataPriv.get( elem, "display" );
  5716. }
  5717. display = jQuery.css( elem, "display" );
  5718. if ( display === "none" ) {
  5719. if ( restoreDisplay ) {
  5720. display = restoreDisplay;
  5721. } else {
  5722. // Get nonempty value(s) by temporarily forcing visibility
  5723. showHide( [ elem ], true );
  5724. restoreDisplay = elem.style.display || restoreDisplay;
  5725. display = jQuery.css( elem, "display" );
  5726. showHide( [ elem ] );
  5727. }
  5728. }
  5729. // Animate inline elements as inline-block
  5730. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  5731. if ( jQuery.css( elem, "float" ) === "none" ) {
  5732. // Restore the original display value at the end of pure show/hide animations
  5733. if ( !propTween ) {
  5734. anim.done( function() {
  5735. style.display = restoreDisplay;
  5736. } );
  5737. if ( restoreDisplay == null ) {
  5738. display = style.display;
  5739. restoreDisplay = display === "none" ? "" : display;
  5740. }
  5741. }
  5742. style.display = "inline-block";
  5743. }
  5744. }
  5745. }
  5746. if ( opts.overflow ) {
  5747. style.overflow = "hidden";
  5748. anim.always( function() {
  5749. style.overflow = opts.overflow[ 0 ];
  5750. style.overflowX = opts.overflow[ 1 ];
  5751. style.overflowY = opts.overflow[ 2 ];
  5752. } );
  5753. }
  5754. // Implement show/hide animations
  5755. propTween = false;
  5756. for ( prop in orig ) {
  5757. // General show/hide setup for this element animation
  5758. if ( !propTween ) {
  5759. if ( dataShow ) {
  5760. if ( "hidden" in dataShow ) {
  5761. hidden = dataShow.hidden;
  5762. }
  5763. } else {
  5764. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  5765. }
  5766. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  5767. if ( toggle ) {
  5768. dataShow.hidden = !hidden;
  5769. }
  5770. // Show elements before animating them
  5771. if ( hidden ) {
  5772. showHide( [ elem ], true );
  5773. }
  5774. /* eslint-disable no-loop-func */
  5775. anim.done( function() {
  5776. /* eslint-enable no-loop-func */
  5777. // The final step of a "hide" animation is actually hiding the element
  5778. if ( !hidden ) {
  5779. showHide( [ elem ] );
  5780. }
  5781. dataPriv.remove( elem, "fxshow" );
  5782. for ( prop in orig ) {
  5783. jQuery.style( elem, prop, orig[ prop ] );
  5784. }
  5785. } );
  5786. }
  5787. // Per-property setup
  5788. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5789. if ( !( prop in dataShow ) ) {
  5790. dataShow[ prop ] = propTween.start;
  5791. if ( hidden ) {
  5792. propTween.end = propTween.start;
  5793. propTween.start = 0;
  5794. }
  5795. }
  5796. }
  5797. }
  5798. function propFilter( props, specialEasing ) {
  5799. var index, name, easing, value, hooks;
  5800. // camelCase, specialEasing and expand cssHook pass
  5801. for ( index in props ) {
  5802. name = jQuery.camelCase( index );
  5803. easing = specialEasing[ name ];
  5804. value = props[ index ];
  5805. if ( jQuery.isArray( value ) ) {
  5806. easing = value[ 1 ];
  5807. value = props[ index ] = value[ 0 ];
  5808. }
  5809. if ( index !== name ) {
  5810. props[ name ] = value;
  5811. delete props[ index ];
  5812. }
  5813. hooks = jQuery.cssHooks[ name ];
  5814. if ( hooks && "expand" in hooks ) {
  5815. value = hooks.expand( value );
  5816. delete props[ name ];
  5817. // Not quite $.extend, this won't overwrite existing keys.
  5818. // Reusing 'index' because we have the correct "name"
  5819. for ( index in value ) {
  5820. if ( !( index in props ) ) {
  5821. props[ index ] = value[ index ];
  5822. specialEasing[ index ] = easing;
  5823. }
  5824. }
  5825. } else {
  5826. specialEasing[ name ] = easing;
  5827. }
  5828. }
  5829. }
  5830. function Animation( elem, properties, options ) {
  5831. var result,
  5832. stopped,
  5833. index = 0,
  5834. length = Animation.prefilters.length,
  5835. deferred = jQuery.Deferred().always( function() {
  5836. // Don't match elem in the :animated selector
  5837. delete tick.elem;
  5838. } ),
  5839. tick = function() {
  5840. if ( stopped ) {
  5841. return false;
  5842. }
  5843. var currentTime = fxNow || createFxNow(),
  5844. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  5845. // Support: Android 2.3 only
  5846. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  5847. temp = remaining / animation.duration || 0,
  5848. percent = 1 - temp,
  5849. index = 0,
  5850. length = animation.tweens.length;
  5851. for ( ; index < length; index++ ) {
  5852. animation.tweens[ index ].run( percent );
  5853. }
  5854. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  5855. if ( percent < 1 && length ) {
  5856. return remaining;
  5857. } else {
  5858. deferred.resolveWith( elem, [ animation ] );
  5859. return false;
  5860. }
  5861. },
  5862. animation = deferred.promise( {
  5863. elem: elem,
  5864. props: jQuery.extend( {}, properties ),
  5865. opts: jQuery.extend( true, {
  5866. specialEasing: {},
  5867. easing: jQuery.easing._default
  5868. }, options ),
  5869. originalProperties: properties,
  5870. originalOptions: options,
  5871. startTime: fxNow || createFxNow(),
  5872. duration: options.duration,
  5873. tweens: [],
  5874. createTween: function( prop, end ) {
  5875. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  5876. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  5877. animation.tweens.push( tween );
  5878. return tween;
  5879. },
  5880. stop: function( gotoEnd ) {
  5881. var index = 0,
  5882. // If we are going to the end, we want to run all the tweens
  5883. // otherwise we skip this part
  5884. length = gotoEnd ? animation.tweens.length : 0;
  5885. if ( stopped ) {
  5886. return this;
  5887. }
  5888. stopped = true;
  5889. for ( ; index < length; index++ ) {
  5890. animation.tweens[ index ].run( 1 );
  5891. }
  5892. // Resolve when we played the last frame; otherwise, reject
  5893. if ( gotoEnd ) {
  5894. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  5895. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  5896. } else {
  5897. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  5898. }
  5899. return this;
  5900. }
  5901. } ),
  5902. props = animation.props;
  5903. propFilter( props, animation.opts.specialEasing );
  5904. for ( ; index < length; index++ ) {
  5905. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  5906. if ( result ) {
  5907. if ( jQuery.isFunction( result.stop ) ) {
  5908. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  5909. jQuery.proxy( result.stop, result );
  5910. }
  5911. return result;
  5912. }
  5913. }
  5914. jQuery.map( props, createTween, animation );
  5915. if ( jQuery.isFunction( animation.opts.start ) ) {
  5916. animation.opts.start.call( elem, animation );
  5917. }
  5918. jQuery.fx.timer(
  5919. jQuery.extend( tick, {
  5920. elem: elem,
  5921. anim: animation,
  5922. queue: animation.opts.queue
  5923. } )
  5924. );
  5925. // attach callbacks from options
  5926. return animation.progress( animation.opts.progress )
  5927. .done( animation.opts.done, animation.opts.complete )
  5928. .fail( animation.opts.fail )
  5929. .always( animation.opts.always );
  5930. }
  5931. jQuery.Animation = jQuery.extend( Animation, {
  5932. tweeners: {
  5933. "*": [ function( prop, value ) {
  5934. var tween = this.createTween( prop, value );
  5935. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  5936. return tween;
  5937. } ]
  5938. },
  5939. tweener: function( props, callback ) {
  5940. if ( jQuery.isFunction( props ) ) {
  5941. callback = props;
  5942. props = [ "*" ];
  5943. } else {
  5944. props = props.match( rnothtmlwhite );
  5945. }
  5946. var prop,
  5947. index = 0,
  5948. length = props.length;
  5949. for ( ; index < length; index++ ) {
  5950. prop = props[ index ];
  5951. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  5952. Animation.tweeners[ prop ].unshift( callback );
  5953. }
  5954. },
  5955. prefilters: [ defaultPrefilter ],
  5956. prefilter: function( callback, prepend ) {
  5957. if ( prepend ) {
  5958. Animation.prefilters.unshift( callback );
  5959. } else {
  5960. Animation.prefilters.push( callback );
  5961. }
  5962. }
  5963. } );
  5964. jQuery.speed = function( speed, easing, fn ) {
  5965. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  5966. complete: fn || !fn && easing ||
  5967. jQuery.isFunction( speed ) && speed,
  5968. duration: speed,
  5969. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  5970. };
  5971. // Go to the end state if fx are off or if document is hidden
  5972. if ( jQuery.fx.off || document.hidden ) {
  5973. opt.duration = 0;
  5974. } else {
  5975. if ( typeof opt.duration !== "number" ) {
  5976. if ( opt.duration in jQuery.fx.speeds ) {
  5977. opt.duration = jQuery.fx.speeds[ opt.duration ];
  5978. } else {
  5979. opt.duration = jQuery.fx.speeds._default;
  5980. }
  5981. }
  5982. }
  5983. // Normalize opt.queue - true/undefined/null -> "fx"
  5984. if ( opt.queue == null || opt.queue === true ) {
  5985. opt.queue = "fx";
  5986. }
  5987. // Queueing
  5988. opt.old = opt.complete;
  5989. opt.complete = function() {
  5990. if ( jQuery.isFunction( opt.old ) ) {
  5991. opt.old.call( this );
  5992. }
  5993. if ( opt.queue ) {
  5994. jQuery.dequeue( this, opt.queue );
  5995. }
  5996. };
  5997. return opt;
  5998. };
  5999. jQuery.fn.extend( {
  6000. fadeTo: function( speed, to, easing, callback ) {
  6001. // Show any hidden elements after setting opacity to 0
  6002. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6003. // Animate to the value specified
  6004. .end().animate( { opacity: to }, speed, easing, callback );
  6005. },
  6006. animate: function( prop, speed, easing, callback ) {
  6007. var empty = jQuery.isEmptyObject( prop ),
  6008. optall = jQuery.speed( speed, easing, callback ),
  6009. doAnimation = function() {
  6010. // Operate on a copy of prop so per-property easing won't be lost
  6011. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6012. // Empty animations, or finishing resolves immediately
  6013. if ( empty || dataPriv.get( this, "finish" ) ) {
  6014. anim.stop( true );
  6015. }
  6016. };
  6017. doAnimation.finish = doAnimation;
  6018. return empty || optall.queue === false ?
  6019. this.each( doAnimation ) :
  6020. this.queue( optall.queue, doAnimation );
  6021. },
  6022. stop: function( type, clearQueue, gotoEnd ) {
  6023. var stopQueue = function( hooks ) {
  6024. var stop = hooks.stop;
  6025. delete hooks.stop;
  6026. stop( gotoEnd );
  6027. };
  6028. if ( typeof type !== "string" ) {
  6029. gotoEnd = clearQueue;
  6030. clearQueue = type;
  6031. type = undefined;
  6032. }
  6033. if ( clearQueue && type !== false ) {
  6034. this.queue( type || "fx", [] );
  6035. }
  6036. return this.each( function() {
  6037. var dequeue = true,
  6038. index = type != null && type + "queueHooks",
  6039. timers = jQuery.timers,
  6040. data = dataPriv.get( this );
  6041. if ( index ) {
  6042. if ( data[ index ] && data[ index ].stop ) {
  6043. stopQueue( data[ index ] );
  6044. }
  6045. } else {
  6046. for ( index in data ) {
  6047. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6048. stopQueue( data[ index ] );
  6049. }
  6050. }
  6051. }
  6052. for ( index = timers.length; index--; ) {
  6053. if ( timers[ index ].elem === this &&
  6054. ( type == null || timers[ index ].queue === type ) ) {
  6055. timers[ index ].anim.stop( gotoEnd );
  6056. dequeue = false;
  6057. timers.splice( index, 1 );
  6058. }
  6059. }
  6060. // Start the next in the queue if the last step wasn't forced.
  6061. // Timers currently will call their complete callbacks, which
  6062. // will dequeue but only if they were gotoEnd.
  6063. if ( dequeue || !gotoEnd ) {
  6064. jQuery.dequeue( this, type );
  6065. }
  6066. } );
  6067. },
  6068. finish: function( type ) {
  6069. if ( type !== false ) {
  6070. type = type || "fx";
  6071. }
  6072. return this.each( function() {
  6073. var index,
  6074. data = dataPriv.get( this ),
  6075. queue = data[ type + "queue" ],
  6076. hooks = data[ type + "queueHooks" ],
  6077. timers = jQuery.timers,
  6078. length = queue ? queue.length : 0;
  6079. // Enable finishing flag on private data
  6080. data.finish = true;
  6081. // Empty the queue first
  6082. jQuery.queue( this, type, [] );
  6083. if ( hooks && hooks.stop ) {
  6084. hooks.stop.call( this, true );
  6085. }
  6086. // Look for any active animations, and finish them
  6087. for ( index = timers.length; index--; ) {
  6088. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6089. timers[ index ].anim.stop( true );
  6090. timers.splice( index, 1 );
  6091. }
  6092. }
  6093. // Look for any animations in the old queue and finish them
  6094. for ( index = 0; index < length; index++ ) {
  6095. if ( queue[ index ] && queue[ index ].finish ) {
  6096. queue[ index ].finish.call( this );
  6097. }
  6098. }
  6099. // Turn off finishing flag
  6100. delete data.finish;
  6101. } );
  6102. }
  6103. } );
  6104. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  6105. var cssFn = jQuery.fn[ name ];
  6106. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6107. return speed == null || typeof speed === "boolean" ?
  6108. cssFn.apply( this, arguments ) :
  6109. this.animate( genFx( name, true ), speed, easing, callback );
  6110. };
  6111. } );
  6112. // Generate shortcuts for custom animations
  6113. jQuery.each( {
  6114. slideDown: genFx( "show" ),
  6115. slideUp: genFx( "hide" ),
  6116. slideToggle: genFx( "toggle" ),
  6117. fadeIn: { opacity: "show" },
  6118. fadeOut: { opacity: "hide" },
  6119. fadeToggle: { opacity: "toggle" }
  6120. }, function( name, props ) {
  6121. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6122. return this.animate( props, speed, easing, callback );
  6123. };
  6124. } );
  6125. jQuery.timers = [];
  6126. jQuery.fx.tick = function() {
  6127. var timer,
  6128. i = 0,
  6129. timers = jQuery.timers;
  6130. fxNow = jQuery.now();
  6131. for ( ; i < timers.length; i++ ) {
  6132. timer = timers[ i ];
  6133. // Checks the timer has not already been removed
  6134. if ( !timer() && timers[ i ] === timer ) {
  6135. timers.splice( i--, 1 );
  6136. }
  6137. }
  6138. if ( !timers.length ) {
  6139. jQuery.fx.stop();
  6140. }
  6141. fxNow = undefined;
  6142. };
  6143. jQuery.fx.timer = function( timer ) {
  6144. jQuery.timers.push( timer );
  6145. if ( timer() ) {
  6146. jQuery.fx.start();
  6147. } else {
  6148. jQuery.timers.pop();
  6149. }
  6150. };
  6151. jQuery.fx.interval = 13;
  6152. jQuery.fx.start = function() {
  6153. if ( !timerId ) {
  6154. timerId = window.requestAnimationFrame ?
  6155. window.requestAnimationFrame( raf ) :
  6156. window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
  6157. }
  6158. };
  6159. jQuery.fx.stop = function() {
  6160. if ( window.cancelAnimationFrame ) {
  6161. window.cancelAnimationFrame( timerId );
  6162. } else {
  6163. window.clearInterval( timerId );
  6164. }
  6165. timerId = null;
  6166. };
  6167. jQuery.fx.speeds = {
  6168. slow: 600,
  6169. fast: 200,
  6170. // Default speed
  6171. _default: 400
  6172. };
  6173. // Based off of the plugin by Clint Helfers, with permission.
  6174. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  6175. jQuery.fn.delay = function( time, type ) {
  6176. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6177. type = type || "fx";
  6178. return this.queue( type, function( next, hooks ) {
  6179. var timeout = window.setTimeout( next, time );
  6180. hooks.stop = function() {
  6181. window.clearTimeout( timeout );
  6182. };
  6183. } );
  6184. };
  6185. ( function() {
  6186. var input = document.createElement( "input" ),
  6187. select = document.createElement( "select" ),
  6188. opt = select.appendChild( document.createElement( "option" ) );
  6189. input.type = "checkbox";
  6190. // Support: Android <=4.3 only
  6191. // Default value for a checkbox should be "on"
  6192. support.checkOn = input.value !== "";
  6193. // Support: IE <=11 only
  6194. // Must access selectedIndex to make default options select
  6195. support.optSelected = opt.selected;
  6196. // Support: IE <=11 only
  6197. // An input loses its value after becoming a radio
  6198. input = document.createElement( "input" );
  6199. input.value = "t";
  6200. input.type = "radio";
  6201. support.radioValue = input.value === "t";
  6202. } )();
  6203. var boolHook,
  6204. attrHandle = jQuery.expr.attrHandle;
  6205. jQuery.fn.extend( {
  6206. attr: function( name, value ) {
  6207. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6208. },
  6209. removeAttr: function( name ) {
  6210. return this.each( function() {
  6211. jQuery.removeAttr( this, name );
  6212. } );
  6213. }
  6214. } );
  6215. jQuery.extend( {
  6216. attr: function( elem, name, value ) {
  6217. var ret, hooks,
  6218. nType = elem.nodeType;
  6219. // Don't get/set attributes on text, comment and attribute nodes
  6220. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6221. return;
  6222. }
  6223. // Fallback to prop when attributes are not supported
  6224. if ( typeof elem.getAttribute === "undefined" ) {
  6225. return jQuery.prop( elem, name, value );
  6226. }
  6227. // Attribute hooks are determined by the lowercase version
  6228. // Grab necessary hook if one is defined
  6229. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6230. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6231. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6232. }
  6233. if ( value !== undefined ) {
  6234. if ( value === null ) {
  6235. jQuery.removeAttr( elem, name );
  6236. return;
  6237. }
  6238. if ( hooks && "set" in hooks &&
  6239. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6240. return ret;
  6241. }
  6242. elem.setAttribute( name, value + "" );
  6243. return value;
  6244. }
  6245. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6246. return ret;
  6247. }
  6248. ret = jQuery.find.attr( elem, name );
  6249. // Non-existent attributes return null, we normalize to undefined
  6250. return ret == null ? undefined : ret;
  6251. },
  6252. attrHooks: {
  6253. type: {
  6254. set: function( elem, value ) {
  6255. if ( !support.radioValue && value === "radio" &&
  6256. jQuery.nodeName( elem, "input" ) ) {
  6257. var val = elem.value;
  6258. elem.setAttribute( "type", value );
  6259. if ( val ) {
  6260. elem.value = val;
  6261. }
  6262. return value;
  6263. }
  6264. }
  6265. }
  6266. },
  6267. removeAttr: function( elem, value ) {
  6268. var name,
  6269. i = 0,
  6270. // Attribute names can contain non-HTML whitespace characters
  6271. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6272. attrNames = value && value.match( rnothtmlwhite );
  6273. if ( attrNames && elem.nodeType === 1 ) {
  6274. while ( ( name = attrNames[ i++ ] ) ) {
  6275. elem.removeAttribute( name );
  6276. }
  6277. }
  6278. }
  6279. } );
  6280. // Hooks for boolean attributes
  6281. boolHook = {
  6282. set: function( elem, value, name ) {
  6283. if ( value === false ) {
  6284. // Remove boolean attributes when set to false
  6285. jQuery.removeAttr( elem, name );
  6286. } else {
  6287. elem.setAttribute( name, name );
  6288. }
  6289. return name;
  6290. }
  6291. };
  6292. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  6293. var getter = attrHandle[ name ] || jQuery.find.attr;
  6294. attrHandle[ name ] = function( elem, name, isXML ) {
  6295. var ret, handle,
  6296. lowercaseName = name.toLowerCase();
  6297. if ( !isXML ) {
  6298. // Avoid an infinite loop by temporarily removing this function from the getter
  6299. handle = attrHandle[ lowercaseName ];
  6300. attrHandle[ lowercaseName ] = ret;
  6301. ret = getter( elem, name, isXML ) != null ?
  6302. lowercaseName :
  6303. null;
  6304. attrHandle[ lowercaseName ] = handle;
  6305. }
  6306. return ret;
  6307. };
  6308. } );
  6309. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6310. rclickable = /^(?:a|area)$/i;
  6311. jQuery.fn.extend( {
  6312. prop: function( name, value ) {
  6313. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6314. },
  6315. removeProp: function( name ) {
  6316. return this.each( function() {
  6317. delete this[ jQuery.propFix[ name ] || name ];
  6318. } );
  6319. }
  6320. } );
  6321. jQuery.extend( {
  6322. prop: function( elem, name, value ) {
  6323. var ret, hooks,
  6324. nType = elem.nodeType;
  6325. // Don't get/set properties on text, comment and attribute nodes
  6326. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6327. return;
  6328. }
  6329. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6330. // Fix name and attach hooks
  6331. name = jQuery.propFix[ name ] || name;
  6332. hooks = jQuery.propHooks[ name ];
  6333. }
  6334. if ( value !== undefined ) {
  6335. if ( hooks && "set" in hooks &&
  6336. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6337. return ret;
  6338. }
  6339. return ( elem[ name ] = value );
  6340. }
  6341. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6342. return ret;
  6343. }
  6344. return elem[ name ];
  6345. },
  6346. propHooks: {
  6347. tabIndex: {
  6348. get: function( elem ) {
  6349. // Support: IE <=9 - 11 only
  6350. // elem.tabIndex doesn't always return the
  6351. // correct value when it hasn't been explicitly set
  6352. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  6353. // Use proper attribute retrieval(#12072)
  6354. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6355. if ( tabindex ) {
  6356. return parseInt( tabindex, 10 );
  6357. }
  6358. if (
  6359. rfocusable.test( elem.nodeName ) ||
  6360. rclickable.test( elem.nodeName ) &&
  6361. elem.href
  6362. ) {
  6363. return 0;
  6364. }
  6365. return -1;
  6366. }
  6367. }
  6368. },
  6369. propFix: {
  6370. "for": "htmlFor",
  6371. "class": "className"
  6372. }
  6373. } );
  6374. // Support: IE <=11 only
  6375. // Accessing the selectedIndex property
  6376. // forces the browser to respect setting selected
  6377. // on the option
  6378. // The getter ensures a default option is selected
  6379. // when in an optgroup
  6380. // eslint rule "no-unused-expressions" is disabled for this code
  6381. // since it considers such accessions noop
  6382. if ( !support.optSelected ) {
  6383. jQuery.propHooks.selected = {
  6384. get: function( elem ) {
  6385. /* eslint no-unused-expressions: "off" */
  6386. var parent = elem.parentNode;
  6387. if ( parent && parent.parentNode ) {
  6388. parent.parentNode.selectedIndex;
  6389. }
  6390. return null;
  6391. },
  6392. set: function( elem ) {
  6393. /* eslint no-unused-expressions: "off" */
  6394. var parent = elem.parentNode;
  6395. if ( parent ) {
  6396. parent.selectedIndex;
  6397. if ( parent.parentNode ) {
  6398. parent.parentNode.selectedIndex;
  6399. }
  6400. }
  6401. }
  6402. };
  6403. }
  6404. jQuery.each( [
  6405. "tabIndex",
  6406. "readOnly",
  6407. "maxLength",
  6408. "cellSpacing",
  6409. "cellPadding",
  6410. "rowSpan",
  6411. "colSpan",
  6412. "useMap",
  6413. "frameBorder",
  6414. "contentEditable"
  6415. ], function() {
  6416. jQuery.propFix[ this.toLowerCase() ] = this;
  6417. } );
  6418. // Strip and collapse whitespace according to HTML spec
  6419. // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
  6420. function stripAndCollapse( value ) {
  6421. var tokens = value.match( rnothtmlwhite ) || [];
  6422. return tokens.join( " " );
  6423. }
  6424. function getClass( elem ) {
  6425. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6426. }
  6427. jQuery.fn.extend( {
  6428. addClass: function( value ) {
  6429. var classes, elem, cur, curValue, clazz, j, finalValue,
  6430. i = 0;
  6431. if ( jQuery.isFunction( value ) ) {
  6432. return this.each( function( j ) {
  6433. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6434. } );
  6435. }
  6436. if ( typeof value === "string" && value ) {
  6437. classes = value.match( rnothtmlwhite ) || [];
  6438. while ( ( elem = this[ i++ ] ) ) {
  6439. curValue = getClass( elem );
  6440. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6441. if ( cur ) {
  6442. j = 0;
  6443. while ( ( clazz = classes[ j++ ] ) ) {
  6444. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6445. cur += clazz + " ";
  6446. }
  6447. }
  6448. // Only assign if different to avoid unneeded rendering.
  6449. finalValue = stripAndCollapse( cur );
  6450. if ( curValue !== finalValue ) {
  6451. elem.setAttribute( "class", finalValue );
  6452. }
  6453. }
  6454. }
  6455. }
  6456. return this;
  6457. },
  6458. removeClass: function( value ) {
  6459. var classes, elem, cur, curValue, clazz, j, finalValue,
  6460. i = 0;
  6461. if ( jQuery.isFunction( value ) ) {
  6462. return this.each( function( j ) {
  6463. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6464. } );
  6465. }
  6466. if ( !arguments.length ) {
  6467. return this.attr( "class", "" );
  6468. }
  6469. if ( typeof value === "string" && value ) {
  6470. classes = value.match( rnothtmlwhite ) || [];
  6471. while ( ( elem = this[ i++ ] ) ) {
  6472. curValue = getClass( elem );
  6473. // This expression is here for better compressibility (see addClass)
  6474. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6475. if ( cur ) {
  6476. j = 0;
  6477. while ( ( clazz = classes[ j++ ] ) ) {
  6478. // Remove *all* instances
  6479. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  6480. cur = cur.replace( " " + clazz + " ", " " );
  6481. }
  6482. }
  6483. // Only assign if different to avoid unneeded rendering.
  6484. finalValue = stripAndCollapse( cur );
  6485. if ( curValue !== finalValue ) {
  6486. elem.setAttribute( "class", finalValue );
  6487. }
  6488. }
  6489. }
  6490. }
  6491. return this;
  6492. },
  6493. toggleClass: function( value, stateVal ) {
  6494. var type = typeof value;
  6495. if ( typeof stateVal === "boolean" && type === "string" ) {
  6496. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6497. }
  6498. if ( jQuery.isFunction( value ) ) {
  6499. return this.each( function( i ) {
  6500. jQuery( this ).toggleClass(
  6501. value.call( this, i, getClass( this ), stateVal ),
  6502. stateVal
  6503. );
  6504. } );
  6505. }
  6506. return this.each( function() {
  6507. var className, i, self, classNames;
  6508. if ( type === "string" ) {
  6509. // Toggle individual class names
  6510. i = 0;
  6511. self = jQuery( this );
  6512. classNames = value.match( rnothtmlwhite ) || [];
  6513. while ( ( className = classNames[ i++ ] ) ) {
  6514. // Check each className given, space separated list
  6515. if ( self.hasClass( className ) ) {
  6516. self.removeClass( className );
  6517. } else {
  6518. self.addClass( className );
  6519. }
  6520. }
  6521. // Toggle whole class name
  6522. } else if ( value === undefined || type === "boolean" ) {
  6523. className = getClass( this );
  6524. if ( className ) {
  6525. // Store className if set
  6526. dataPriv.set( this, "__className__", className );
  6527. }
  6528. // If the element has a class name or if we're passed `false`,
  6529. // then remove the whole classname (if there was one, the above saved it).
  6530. // Otherwise bring back whatever was previously saved (if anything),
  6531. // falling back to the empty string if nothing was stored.
  6532. if ( this.setAttribute ) {
  6533. this.setAttribute( "class",
  6534. className || value === false ?
  6535. "" :
  6536. dataPriv.get( this, "__className__" ) || ""
  6537. );
  6538. }
  6539. }
  6540. } );
  6541. },
  6542. hasClass: function( selector ) {
  6543. var className, elem,
  6544. i = 0;
  6545. className = " " + selector + " ";
  6546. while ( ( elem = this[ i++ ] ) ) {
  6547. if ( elem.nodeType === 1 &&
  6548. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6549. return true;
  6550. }
  6551. }
  6552. return false;
  6553. }
  6554. } );
  6555. var rreturn = /\r/g;
  6556. jQuery.fn.extend( {
  6557. val: function( value ) {
  6558. var hooks, ret, isFunction,
  6559. elem = this[ 0 ];
  6560. if ( !arguments.length ) {
  6561. if ( elem ) {
  6562. hooks = jQuery.valHooks[ elem.type ] ||
  6563. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6564. if ( hooks &&
  6565. "get" in hooks &&
  6566. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6567. ) {
  6568. return ret;
  6569. }
  6570. ret = elem.value;
  6571. // Handle most common string cases
  6572. if ( typeof ret === "string" ) {
  6573. return ret.replace( rreturn, "" );
  6574. }
  6575. // Handle cases where value is null/undef or number
  6576. return ret == null ? "" : ret;
  6577. }
  6578. return;
  6579. }
  6580. isFunction = jQuery.isFunction( value );
  6581. return this.each( function( i ) {
  6582. var val;
  6583. if ( this.nodeType !== 1 ) {
  6584. return;
  6585. }
  6586. if ( isFunction ) {
  6587. val = value.call( this, i, jQuery( this ).val() );
  6588. } else {
  6589. val = value;
  6590. }
  6591. // Treat null/undefined as ""; convert numbers to string
  6592. if ( val == null ) {
  6593. val = "";
  6594. } else if ( typeof val === "number" ) {
  6595. val += "";
  6596. } else if ( jQuery.isArray( val ) ) {
  6597. val = jQuery.map( val, function( value ) {
  6598. return value == null ? "" : value + "";
  6599. } );
  6600. }
  6601. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6602. // If set returns undefined, fall back to normal setting
  6603. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6604. this.value = val;
  6605. }
  6606. } );
  6607. }
  6608. } );
  6609. jQuery.extend( {
  6610. valHooks: {
  6611. option: {
  6612. get: function( elem ) {
  6613. var val = jQuery.find.attr( elem, "value" );
  6614. return val != null ?
  6615. val :
  6616. // Support: IE <=10 - 11 only
  6617. // option.text throws exceptions (#14686, #14858)
  6618. // Strip and collapse whitespace
  6619. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6620. stripAndCollapse( jQuery.text( elem ) );
  6621. }
  6622. },
  6623. select: {
  6624. get: function( elem ) {
  6625. var value, option, i,
  6626. options = elem.options,
  6627. index = elem.selectedIndex,
  6628. one = elem.type === "select-one",
  6629. values = one ? null : [],
  6630. max = one ? index + 1 : options.length;
  6631. if ( index < 0 ) {
  6632. i = max;
  6633. } else {
  6634. i = one ? index : 0;
  6635. }
  6636. // Loop through all the selected options
  6637. for ( ; i < max; i++ ) {
  6638. option = options[ i ];
  6639. // Support: IE <=9 only
  6640. // IE8-9 doesn't update selected after form reset (#2551)
  6641. if ( ( option.selected || i === index ) &&
  6642. // Don't return options that are disabled or in a disabled optgroup
  6643. !option.disabled &&
  6644. ( !option.parentNode.disabled ||
  6645. !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6646. // Get the specific value for the option
  6647. value = jQuery( option ).val();
  6648. // We don't need an array for one selects
  6649. if ( one ) {
  6650. return value;
  6651. }
  6652. // Multi-Selects return an array
  6653. values.push( value );
  6654. }
  6655. }
  6656. return values;
  6657. },
  6658. set: function( elem, value ) {
  6659. var optionSet, option,
  6660. options = elem.options,
  6661. values = jQuery.makeArray( value ),
  6662. i = options.length;
  6663. while ( i-- ) {
  6664. option = options[ i ];
  6665. /* eslint-disable no-cond-assign */
  6666. if ( option.selected =
  6667. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6668. ) {
  6669. optionSet = true;
  6670. }
  6671. /* eslint-enable no-cond-assign */
  6672. }
  6673. // Force browsers to behave consistently when non-matching value is set
  6674. if ( !optionSet ) {
  6675. elem.selectedIndex = -1;
  6676. }
  6677. return values;
  6678. }
  6679. }
  6680. }
  6681. } );
  6682. // Radios and checkboxes getter/setter
  6683. jQuery.each( [ "radio", "checkbox" ], function() {
  6684. jQuery.valHooks[ this ] = {
  6685. set: function( elem, value ) {
  6686. if ( jQuery.isArray( value ) ) {
  6687. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6688. }
  6689. }
  6690. };
  6691. if ( !support.checkOn ) {
  6692. jQuery.valHooks[ this ].get = function( elem ) {
  6693. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  6694. };
  6695. }
  6696. } );
  6697. // Return jQuery for attributes-only inclusion
  6698. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
  6699. jQuery.extend( jQuery.event, {
  6700. trigger: function( event, data, elem, onlyHandlers ) {
  6701. var i, cur, tmp, bubbleType, ontype, handle, special,
  6702. eventPath = [ elem || document ],
  6703. type = hasOwn.call( event, "type" ) ? event.type : event,
  6704. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  6705. cur = tmp = elem = elem || document;
  6706. // Don't do events on text and comment nodes
  6707. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  6708. return;
  6709. }
  6710. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  6711. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  6712. return;
  6713. }
  6714. if ( type.indexOf( "." ) > -1 ) {
  6715. // Namespaced trigger; create a regexp to match event type in handle()
  6716. namespaces = type.split( "." );
  6717. type = namespaces.shift();
  6718. namespaces.sort();
  6719. }
  6720. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  6721. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  6722. event = event[ jQuery.expando ] ?
  6723. event :
  6724. new jQuery.Event( type, typeof event === "object" && event );
  6725. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  6726. event.isTrigger = onlyHandlers ? 2 : 3;
  6727. event.namespace = namespaces.join( "." );
  6728. event.rnamespace = event.namespace ?
  6729. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  6730. null;
  6731. // Clean up the event in case it is being reused
  6732. event.result = undefined;
  6733. if ( !event.target ) {
  6734. event.target = elem;
  6735. }
  6736. // Clone any incoming data and prepend the event, creating the handler arg list
  6737. data = data == null ?
  6738. [ event ] :
  6739. jQuery.makeArray( data, [ event ] );
  6740. // Allow special events to draw outside the lines
  6741. special = jQuery.event.special[ type ] || {};
  6742. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  6743. return;
  6744. }
  6745. // Determine event propagation path in advance, per W3C events spec (#9951)
  6746. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  6747. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  6748. bubbleType = special.delegateType || type;
  6749. if ( !rfocusMorph.test( bubbleType + type ) ) {
  6750. cur = cur.parentNode;
  6751. }
  6752. for ( ; cur; cur = cur.parentNode ) {
  6753. eventPath.push( cur );
  6754. tmp = cur;
  6755. }
  6756. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  6757. if ( tmp === ( elem.ownerDocument || document ) ) {
  6758. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  6759. }
  6760. }
  6761. // Fire handlers on the event path
  6762. i = 0;
  6763. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  6764. event.type = i > 1 ?
  6765. bubbleType :
  6766. special.bindType || type;
  6767. // jQuery handler
  6768. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  6769. dataPriv.get( cur, "handle" );
  6770. if ( handle ) {
  6771. handle.apply( cur, data );
  6772. }
  6773. // Native handler
  6774. handle = ontype && cur[ ontype ];
  6775. if ( handle && handle.apply && acceptData( cur ) ) {
  6776. event.result = handle.apply( cur, data );
  6777. if ( event.result === false ) {
  6778. event.preventDefault();
  6779. }
  6780. }
  6781. }
  6782. event.type = type;
  6783. // If nobody prevented the default action, do it now
  6784. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  6785. if ( ( !special._default ||
  6786. special._default.apply( eventPath.pop(), data ) === false ) &&
  6787. acceptData( elem ) ) {
  6788. // Call a native DOM method on the target with the same name as the event.
  6789. // Don't do default actions on window, that's where global variables be (#6170)
  6790. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  6791. // Don't re-trigger an onFOO event when we call its FOO() method
  6792. tmp = elem[ ontype ];
  6793. if ( tmp ) {
  6794. elem[ ontype ] = null;
  6795. }
  6796. // Prevent re-triggering of the same event, since we already bubbled it above
  6797. jQuery.event.triggered = type;
  6798. elem[ type ]();
  6799. jQuery.event.triggered = undefined;
  6800. if ( tmp ) {
  6801. elem[ ontype ] = tmp;
  6802. }
  6803. }
  6804. }
  6805. }
  6806. return event.result;
  6807. },
  6808. // Piggyback on a donor event to simulate a different one
  6809. // Used only for `focus(in | out)` events
  6810. simulate: function( type, elem, event ) {
  6811. var e = jQuery.extend(
  6812. new jQuery.Event(),
  6813. event,
  6814. {
  6815. type: type,
  6816. isSimulated: true
  6817. }
  6818. );
  6819. jQuery.event.trigger( e, null, elem );
  6820. }
  6821. } );
  6822. jQuery.fn.extend( {
  6823. trigger: function( type, data ) {
  6824. return this.each( function() {
  6825. jQuery.event.trigger( type, data, this );
  6826. } );
  6827. },
  6828. triggerHandler: function( type, data ) {
  6829. var elem = this[ 0 ];
  6830. if ( elem ) {
  6831. return jQuery.event.trigger( type, data, elem, true );
  6832. }
  6833. }
  6834. } );
  6835. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  6836. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  6837. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  6838. function( i, name ) {
  6839. // Handle event binding
  6840. jQuery.fn[ name ] = function( data, fn ) {
  6841. return arguments.length > 0 ?
  6842. this.on( name, null, data, fn ) :
  6843. this.trigger( name );
  6844. };
  6845. } );
  6846. jQuery.fn.extend( {
  6847. hover: function( fnOver, fnOut ) {
  6848. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  6849. }
  6850. } );
  6851. support.focusin = "onfocusin" in window;
  6852. // Support: Firefox <=44
  6853. // Firefox doesn't have focus(in | out) events
  6854. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  6855. //
  6856. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  6857. // focus(in | out) events fire after focus & blur events,
  6858. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  6859. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  6860. if ( !support.focusin ) {
  6861. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  6862. // Attach a single capturing handler on the document while someone wants focusin/focusout
  6863. var handler = function( event ) {
  6864. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  6865. };
  6866. jQuery.event.special[ fix ] = {
  6867. setup: function() {
  6868. var doc = this.ownerDocument || this,
  6869. attaches = dataPriv.access( doc, fix );
  6870. if ( !attaches ) {
  6871. doc.addEventListener( orig, handler, true );
  6872. }
  6873. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  6874. },
  6875. teardown: function() {
  6876. var doc = this.ownerDocument || this,
  6877. attaches = dataPriv.access( doc, fix ) - 1;
  6878. if ( !attaches ) {
  6879. doc.removeEventListener( orig, handler, true );
  6880. dataPriv.remove( doc, fix );
  6881. } else {
  6882. dataPriv.access( doc, fix, attaches );
  6883. }
  6884. }
  6885. };
  6886. } );
  6887. }
  6888. var location = window.location;
  6889. var nonce = jQuery.now();
  6890. var rquery = ( /\?/ );
  6891. // Cross-browser xml parsing
  6892. jQuery.parseXML = function( data ) {
  6893. var xml;
  6894. if ( !data || typeof data !== "string" ) {
  6895. return null;
  6896. }
  6897. // Support: IE 9 - 11 only
  6898. // IE throws on parseFromString with invalid input.
  6899. try {
  6900. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  6901. } catch ( e ) {
  6902. xml = undefined;
  6903. }
  6904. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  6905. jQuery.error( "Invalid XML: " + data );
  6906. }
  6907. return xml;
  6908. };
  6909. var
  6910. rbracket = /\[\]$/,
  6911. rCRLF = /\r?\n/g,
  6912. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  6913. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  6914. function buildParams( prefix, obj, traditional, add ) {
  6915. var name;
  6916. if ( jQuery.isArray( obj ) ) {
  6917. // Serialize array item.
  6918. jQuery.each( obj, function( i, v ) {
  6919. if ( traditional || rbracket.test( prefix ) ) {
  6920. // Treat each array item as a scalar.
  6921. add( prefix, v );
  6922. } else {
  6923. // Item is non-scalar (array or object), encode its numeric index.
  6924. buildParams(
  6925. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  6926. v,
  6927. traditional,
  6928. add
  6929. );
  6930. }
  6931. } );
  6932. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  6933. // Serialize object item.
  6934. for ( name in obj ) {
  6935. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  6936. }
  6937. } else {
  6938. // Serialize scalar item.
  6939. add( prefix, obj );
  6940. }
  6941. }
  6942. // Serialize an array of form elements or a set of
  6943. // key/values into a query string
  6944. jQuery.param = function( a, traditional ) {
  6945. var prefix,
  6946. s = [],
  6947. add = function( key, valueOrFunction ) {
  6948. // If value is a function, invoke it and use its return value
  6949. var value = jQuery.isFunction( valueOrFunction ) ?
  6950. valueOrFunction() :
  6951. valueOrFunction;
  6952. s[ s.length ] = encodeURIComponent( key ) + "=" +
  6953. encodeURIComponent( value == null ? "" : value );
  6954. };
  6955. // If an array was passed in, assume that it is an array of form elements.
  6956. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  6957. // Serialize the form elements
  6958. jQuery.each( a, function() {
  6959. add( this.name, this.value );
  6960. } );
  6961. } else {
  6962. // If traditional, encode the "old" way (the way 1.3.2 or older
  6963. // did it), otherwise encode params recursively.
  6964. for ( prefix in a ) {
  6965. buildParams( prefix, a[ prefix ], traditional, add );
  6966. }
  6967. }
  6968. // Return the resulting serialization
  6969. return s.join( "&" );
  6970. };
  6971. jQuery.fn.extend( {
  6972. serialize: function() {
  6973. return jQuery.param( this.serializeArray() );
  6974. },
  6975. serializeArray: function() {
  6976. return this.map( function() {
  6977. // Can add propHook for "elements" to filter or add form elements
  6978. var elements = jQuery.prop( this, "elements" );
  6979. return elements ? jQuery.makeArray( elements ) : this;
  6980. } )
  6981. .filter( function() {
  6982. var type = this.type;
  6983. // Use .is( ":disabled" ) so that fieldset[disabled] works
  6984. return this.name && !jQuery( this ).is( ":disabled" ) &&
  6985. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  6986. ( this.checked || !rcheckableType.test( type ) );
  6987. } )
  6988. .map( function( i, elem ) {
  6989. var val = jQuery( this ).val();
  6990. if ( val == null ) {
  6991. return null;
  6992. }
  6993. if ( jQuery.isArray( val ) ) {
  6994. return jQuery.map( val, function( val ) {
  6995. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  6996. } );
  6997. }
  6998. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  6999. } ).get();
  7000. }
  7001. } );
  7002. var
  7003. r20 = /%20/g,
  7004. rhash = /#.*$/,
  7005. rantiCache = /([?&])_=[^&]*/,
  7006. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7007. // #7653, #8125, #8152: local protocol detection
  7008. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7009. rnoContent = /^(?:GET|HEAD)$/,
  7010. rprotocol = /^\/\//,
  7011. /* Prefilters
  7012. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7013. * 2) These are called:
  7014. * - BEFORE asking for a transport
  7015. * - AFTER param serialization (s.data is a string if s.processData is true)
  7016. * 3) key is the dataType
  7017. * 4) the catchall symbol "*" can be used
  7018. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7019. */
  7020. prefilters = {},
  7021. /* Transports bindings
  7022. * 1) key is the dataType
  7023. * 2) the catchall symbol "*" can be used
  7024. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7025. */
  7026. transports = {},
  7027. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  7028. allTypes = "*/".concat( "*" ),
  7029. // Anchor tag for parsing the document origin
  7030. originAnchor = document.createElement( "a" );
  7031. originAnchor.href = location.href;
  7032. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7033. function addToPrefiltersOrTransports( structure ) {
  7034. // dataTypeExpression is optional and defaults to "*"
  7035. return function( dataTypeExpression, func ) {
  7036. if ( typeof dataTypeExpression !== "string" ) {
  7037. func = dataTypeExpression;
  7038. dataTypeExpression = "*";
  7039. }
  7040. var dataType,
  7041. i = 0,
  7042. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7043. if ( jQuery.isFunction( func ) ) {
  7044. // For each dataType in the dataTypeExpression
  7045. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7046. // Prepend if requested
  7047. if ( dataType[ 0 ] === "+" ) {
  7048. dataType = dataType.slice( 1 ) || "*";
  7049. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7050. // Otherwise append
  7051. } else {
  7052. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7053. }
  7054. }
  7055. }
  7056. };
  7057. }
  7058. // Base inspection function for prefilters and transports
  7059. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7060. var inspected = {},
  7061. seekingTransport = ( structure === transports );
  7062. function inspect( dataType ) {
  7063. var selected;
  7064. inspected[ dataType ] = true;
  7065. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7066. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7067. if ( typeof dataTypeOrTransport === "string" &&
  7068. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7069. options.dataTypes.unshift( dataTypeOrTransport );
  7070. inspect( dataTypeOrTransport );
  7071. return false;
  7072. } else if ( seekingTransport ) {
  7073. return !( selected = dataTypeOrTransport );
  7074. }
  7075. } );
  7076. return selected;
  7077. }
  7078. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7079. }
  7080. // A special extend for ajax options
  7081. // that takes "flat" options (not to be deep extended)
  7082. // Fixes #9887
  7083. function ajaxExtend( target, src ) {
  7084. var key, deep,
  7085. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7086. for ( key in src ) {
  7087. if ( src[ key ] !== undefined ) {
  7088. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7089. }
  7090. }
  7091. if ( deep ) {
  7092. jQuery.extend( true, target, deep );
  7093. }
  7094. return target;
  7095. }
  7096. /* Handles responses to an ajax request:
  7097. * - finds the right dataType (mediates between content-type and expected dataType)
  7098. * - returns the corresponding response
  7099. */
  7100. function ajaxHandleResponses( s, jqXHR, responses ) {
  7101. var ct, type, finalDataType, firstDataType,
  7102. contents = s.contents,
  7103. dataTypes = s.dataTypes;
  7104. // Remove auto dataType and get content-type in the process
  7105. while ( dataTypes[ 0 ] === "*" ) {
  7106. dataTypes.shift();
  7107. if ( ct === undefined ) {
  7108. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7109. }
  7110. }
  7111. // Check if we're dealing with a known content-type
  7112. if ( ct ) {
  7113. for ( type in contents ) {
  7114. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7115. dataTypes.unshift( type );
  7116. break;
  7117. }
  7118. }
  7119. }
  7120. // Check to see if we have a response for the expected dataType
  7121. if ( dataTypes[ 0 ] in responses ) {
  7122. finalDataType = dataTypes[ 0 ];
  7123. } else {
  7124. // Try convertible dataTypes
  7125. for ( type in responses ) {
  7126. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7127. finalDataType = type;
  7128. break;
  7129. }
  7130. if ( !firstDataType ) {
  7131. firstDataType = type;
  7132. }
  7133. }
  7134. // Or just use first one
  7135. finalDataType = finalDataType || firstDataType;
  7136. }
  7137. // If we found a dataType
  7138. // We add the dataType to the list if needed
  7139. // and return the corresponding response
  7140. if ( finalDataType ) {
  7141. if ( finalDataType !== dataTypes[ 0 ] ) {
  7142. dataTypes.unshift( finalDataType );
  7143. }
  7144. return responses[ finalDataType ];
  7145. }
  7146. }
  7147. /* Chain conversions given the request and the original response
  7148. * Also sets the responseXXX fields on the jqXHR instance
  7149. */
  7150. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7151. var conv2, current, conv, tmp, prev,
  7152. converters = {},
  7153. // Work with a copy of dataTypes in case we need to modify it for conversion
  7154. dataTypes = s.dataTypes.slice();
  7155. // Create converters map with lowercased keys
  7156. if ( dataTypes[ 1 ] ) {
  7157. for ( conv in s.converters ) {
  7158. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7159. }
  7160. }
  7161. current = dataTypes.shift();
  7162. // Convert to each sequential dataType
  7163. while ( current ) {
  7164. if ( s.responseFields[ current ] ) {
  7165. jqXHR[ s.responseFields[ current ] ] = response;
  7166. }
  7167. // Apply the dataFilter if provided
  7168. if ( !prev && isSuccess && s.dataFilter ) {
  7169. response = s.dataFilter( response, s.dataType );
  7170. }
  7171. prev = current;
  7172. current = dataTypes.shift();
  7173. if ( current ) {
  7174. // There's only work to do if current dataType is non-auto
  7175. if ( current === "*" ) {
  7176. current = prev;
  7177. // Convert response if prev dataType is non-auto and differs from current
  7178. } else if ( prev !== "*" && prev !== current ) {
  7179. // Seek a direct converter
  7180. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7181. // If none found, seek a pair
  7182. if ( !conv ) {
  7183. for ( conv2 in converters ) {
  7184. // If conv2 outputs current
  7185. tmp = conv2.split( " " );
  7186. if ( tmp[ 1 ] === current ) {
  7187. // If prev can be converted to accepted input
  7188. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7189. converters[ "* " + tmp[ 0 ] ];
  7190. if ( conv ) {
  7191. // Condense equivalence converters
  7192. if ( conv === true ) {
  7193. conv = converters[ conv2 ];
  7194. // Otherwise, insert the intermediate dataType
  7195. } else if ( converters[ conv2 ] !== true ) {
  7196. current = tmp[ 0 ];
  7197. dataTypes.unshift( tmp[ 1 ] );
  7198. }
  7199. break;
  7200. }
  7201. }
  7202. }
  7203. }
  7204. // Apply converter (if not an equivalence)
  7205. if ( conv !== true ) {
  7206. // Unless errors are allowed to bubble, catch and return them
  7207. if ( conv && s.throws ) {
  7208. response = conv( response );
  7209. } else {
  7210. try {
  7211. response = conv( response );
  7212. } catch ( e ) {
  7213. return {
  7214. state: "parsererror",
  7215. error: conv ? e : "No conversion from " + prev + " to " + current
  7216. };
  7217. }
  7218. }
  7219. }
  7220. }
  7221. }
  7222. }
  7223. return { state: "success", data: response };
  7224. }
  7225. jQuery.extend( {
  7226. // Counter for holding the number of active queries
  7227. active: 0,
  7228. // Last-Modified header cache for next request
  7229. lastModified: {},
  7230. etag: {},
  7231. ajaxSettings: {
  7232. url: location.href,
  7233. type: "GET",
  7234. isLocal: rlocalProtocol.test( location.protocol ),
  7235. global: true,
  7236. processData: true,
  7237. async: true,
  7238. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7239. /*
  7240. timeout: 0,
  7241. data: null,
  7242. dataType: null,
  7243. username: null,
  7244. password: null,
  7245. cache: null,
  7246. throws: false,
  7247. traditional: false,
  7248. headers: {},
  7249. */
  7250. accepts: {
  7251. "*": allTypes,
  7252. text: "text/plain",
  7253. html: "text/html",
  7254. xml: "application/xml, text/xml",
  7255. json: "application/json, text/javascript"
  7256. },
  7257. contents: {
  7258. xml: /\bxml\b/,
  7259. html: /\bhtml/,
  7260. json: /\bjson\b/
  7261. },
  7262. responseFields: {
  7263. xml: "responseXML",
  7264. text: "responseText",
  7265. json: "responseJSON"
  7266. },
  7267. // Data converters
  7268. // Keys separate source (or catchall "*") and destination types with a single space
  7269. converters: {
  7270. // Convert anything to text
  7271. "* text": String,
  7272. // Text to html (true = no transformation)
  7273. "text html": true,
  7274. // Evaluate text as a json expression
  7275. "text json": JSON.parse,
  7276. // Parse text as xml
  7277. "text xml": jQuery.parseXML
  7278. },
  7279. // For options that shouldn't be deep extended:
  7280. // you can add your own custom options here if
  7281. // and when you create one that shouldn't be
  7282. // deep extended (see ajaxExtend)
  7283. flatOptions: {
  7284. url: true,
  7285. context: true
  7286. }
  7287. },
  7288. // Creates a full fledged settings object into target
  7289. // with both ajaxSettings and settings fields.
  7290. // If target is omitted, writes into ajaxSettings.
  7291. ajaxSetup: function( target, settings ) {
  7292. return settings ?
  7293. // Building a settings object
  7294. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7295. // Extending ajaxSettings
  7296. ajaxExtend( jQuery.ajaxSettings, target );
  7297. },
  7298. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7299. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7300. // Main method
  7301. ajax: function( url, options ) {
  7302. // If url is an object, simulate pre-1.5 signature
  7303. if ( typeof url === "object" ) {
  7304. options = url;
  7305. url = undefined;
  7306. }
  7307. // Force options to be an object
  7308. options = options || {};
  7309. var transport,
  7310. // URL without anti-cache param
  7311. cacheURL,
  7312. // Response headers
  7313. responseHeadersString,
  7314. responseHeaders,
  7315. // timeout handle
  7316. timeoutTimer,
  7317. // Url cleanup var
  7318. urlAnchor,
  7319. // Request state (becomes false upon send and true upon completion)
  7320. completed,
  7321. // To know if global events are to be dispatched
  7322. fireGlobals,
  7323. // Loop variable
  7324. i,
  7325. // uncached part of the url
  7326. uncached,
  7327. // Create the final options object
  7328. s = jQuery.ajaxSetup( {}, options ),
  7329. // Callbacks context
  7330. callbackContext = s.context || s,
  7331. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7332. globalEventContext = s.context &&
  7333. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7334. jQuery( callbackContext ) :
  7335. jQuery.event,
  7336. // Deferreds
  7337. deferred = jQuery.Deferred(),
  7338. completeDeferred = jQuery.Callbacks( "once memory" ),
  7339. // Status-dependent callbacks
  7340. statusCode = s.statusCode || {},
  7341. // Headers (they are sent all at once)
  7342. requestHeaders = {},
  7343. requestHeadersNames = {},
  7344. // Default abort message
  7345. strAbort = "canceled",
  7346. // Fake xhr
  7347. jqXHR = {
  7348. readyState: 0,
  7349. // Builds headers hashtable if needed
  7350. getResponseHeader: function( key ) {
  7351. var match;
  7352. if ( completed ) {
  7353. if ( !responseHeaders ) {
  7354. responseHeaders = {};
  7355. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7356. responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
  7357. }
  7358. }
  7359. match = responseHeaders[ key.toLowerCase() ];
  7360. }
  7361. return match == null ? null : match;
  7362. },
  7363. // Raw string
  7364. getAllResponseHeaders: function() {
  7365. return completed ? responseHeadersString : null;
  7366. },
  7367. // Caches the header
  7368. setRequestHeader: function( name, value ) {
  7369. if ( completed == null ) {
  7370. name = requestHeadersNames[ name.toLowerCase() ] =
  7371. requestHeadersNames[ name.toLowerCase() ] || name;
  7372. requestHeaders[ name ] = value;
  7373. }
  7374. return this;
  7375. },
  7376. // Overrides response content-type header
  7377. overrideMimeType: function( type ) {
  7378. if ( completed == null ) {
  7379. s.mimeType = type;
  7380. }
  7381. return this;
  7382. },
  7383. // Status-dependent callbacks
  7384. statusCode: function( map ) {
  7385. var code;
  7386. if ( map ) {
  7387. if ( completed ) {
  7388. // Execute the appropriate callbacks
  7389. jqXHR.always( map[ jqXHR.status ] );
  7390. } else {
  7391. // Lazy-add the new callbacks in a way that preserves old ones
  7392. for ( code in map ) {
  7393. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7394. }
  7395. }
  7396. }
  7397. return this;
  7398. },
  7399. // Cancel the request
  7400. abort: function( statusText ) {
  7401. var finalText = statusText || strAbort;
  7402. if ( transport ) {
  7403. transport.abort( finalText );
  7404. }
  7405. done( 0, finalText );
  7406. return this;
  7407. }
  7408. };
  7409. // Attach deferreds
  7410. deferred.promise( jqXHR );
  7411. // Add protocol if not provided (prefilters might expect it)
  7412. // Handle falsy url in the settings object (#10093: consistency with old signature)
  7413. // We also use the url parameter if available
  7414. s.url = ( ( url || s.url || location.href ) + "" )
  7415. .replace( rprotocol, location.protocol + "//" );
  7416. // Alias method option to type as per ticket #12004
  7417. s.type = options.method || options.type || s.method || s.type;
  7418. // Extract dataTypes list
  7419. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7420. // A cross-domain request is in order when the origin doesn't match the current origin.
  7421. if ( s.crossDomain == null ) {
  7422. urlAnchor = document.createElement( "a" );
  7423. // Support: IE <=8 - 11, Edge 12 - 13
  7424. // IE throws exception on accessing the href property if url is malformed,
  7425. // e.g. http://example.com:80x/
  7426. try {
  7427. urlAnchor.href = s.url;
  7428. // Support: IE <=8 - 11 only
  7429. // Anchor's host property isn't correctly set when s.url is relative
  7430. urlAnchor.href = urlAnchor.href;
  7431. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7432. urlAnchor.protocol + "//" + urlAnchor.host;
  7433. } catch ( e ) {
  7434. // If there is an error parsing the URL, assume it is crossDomain,
  7435. // it can be rejected by the transport if it is invalid
  7436. s.crossDomain = true;
  7437. }
  7438. }
  7439. // Convert data if not already a string
  7440. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7441. s.data = jQuery.param( s.data, s.traditional );
  7442. }
  7443. // Apply prefilters
  7444. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7445. // If request was aborted inside a prefilter, stop there
  7446. if ( completed ) {
  7447. return jqXHR;
  7448. }
  7449. // We can fire global events as of now if asked to
  7450. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  7451. fireGlobals = jQuery.event && s.global;
  7452. // Watch for a new set of requests
  7453. if ( fireGlobals && jQuery.active++ === 0 ) {
  7454. jQuery.event.trigger( "ajaxStart" );
  7455. }
  7456. // Uppercase the type
  7457. s.type = s.type.toUpperCase();
  7458. // Determine if request has content
  7459. s.hasContent = !rnoContent.test( s.type );
  7460. // Save the URL in case we're toying with the If-Modified-Since
  7461. // and/or If-None-Match header later on
  7462. // Remove hash to simplify url manipulation
  7463. cacheURL = s.url.replace( rhash, "" );
  7464. // More options handling for requests with no content
  7465. if ( !s.hasContent ) {
  7466. // Remember the hash so we can put it back
  7467. uncached = s.url.slice( cacheURL.length );
  7468. // If data is available, append data to url
  7469. if ( s.data ) {
  7470. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7471. // #9682: remove data so that it's not used in an eventual retry
  7472. delete s.data;
  7473. }
  7474. // Add or update anti-cache param if needed
  7475. if ( s.cache === false ) {
  7476. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7477. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  7478. }
  7479. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7480. s.url = cacheURL + uncached;
  7481. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7482. } else if ( s.data && s.processData &&
  7483. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7484. s.data = s.data.replace( r20, "+" );
  7485. }
  7486. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7487. if ( s.ifModified ) {
  7488. if ( jQuery.lastModified[ cacheURL ] ) {
  7489. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7490. }
  7491. if ( jQuery.etag[ cacheURL ] ) {
  7492. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7493. }
  7494. }
  7495. // Set the correct header, if data is being sent
  7496. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7497. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7498. }
  7499. // Set the Accepts header for the server, depending on the dataType
  7500. jqXHR.setRequestHeader(
  7501. "Accept",
  7502. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7503. s.accepts[ s.dataTypes[ 0 ] ] +
  7504. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7505. s.accepts[ "*" ]
  7506. );
  7507. // Check for headers option
  7508. for ( i in s.headers ) {
  7509. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7510. }
  7511. // Allow custom headers/mimetypes and early abort
  7512. if ( s.beforeSend &&
  7513. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7514. // Abort if not done already and return
  7515. return jqXHR.abort();
  7516. }
  7517. // Aborting is no longer a cancellation
  7518. strAbort = "abort";
  7519. // Install callbacks on deferreds
  7520. completeDeferred.add( s.complete );
  7521. jqXHR.done( s.success );
  7522. jqXHR.fail( s.error );
  7523. // Get transport
  7524. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7525. // If no transport, we auto-abort
  7526. if ( !transport ) {
  7527. done( -1, "No Transport" );
  7528. } else {
  7529. jqXHR.readyState = 1;
  7530. // Send global event
  7531. if ( fireGlobals ) {
  7532. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7533. }
  7534. // If request was aborted inside ajaxSend, stop there
  7535. if ( completed ) {
  7536. return jqXHR;
  7537. }
  7538. // Timeout
  7539. if ( s.async && s.timeout > 0 ) {
  7540. timeoutTimer = window.setTimeout( function() {
  7541. jqXHR.abort( "timeout" );
  7542. }, s.timeout );
  7543. }
  7544. try {
  7545. completed = false;
  7546. transport.send( requestHeaders, done );
  7547. } catch ( e ) {
  7548. // Rethrow post-completion exceptions
  7549. if ( completed ) {
  7550. throw e;
  7551. }
  7552. // Propagate others as results
  7553. done( -1, e );
  7554. }
  7555. }
  7556. // Callback for when everything is done
  7557. function done( status, nativeStatusText, responses, headers ) {
  7558. var isSuccess, success, error, response, modified,
  7559. statusText = nativeStatusText;
  7560. // Ignore repeat invocations
  7561. if ( completed ) {
  7562. return;
  7563. }
  7564. completed = true;
  7565. // Clear timeout if it exists
  7566. if ( timeoutTimer ) {
  7567. window.clearTimeout( timeoutTimer );
  7568. }
  7569. // Dereference transport for early garbage collection
  7570. // (no matter how long the jqXHR object will be used)
  7571. transport = undefined;
  7572. // Cache response headers
  7573. responseHeadersString = headers || "";
  7574. // Set readyState
  7575. jqXHR.readyState = status > 0 ? 4 : 0;
  7576. // Determine if successful
  7577. isSuccess = status >= 200 && status < 300 || status === 304;
  7578. // Get response data
  7579. if ( responses ) {
  7580. response = ajaxHandleResponses( s, jqXHR, responses );
  7581. }
  7582. // Convert no matter what (that way responseXXX fields are always set)
  7583. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7584. // If successful, handle type chaining
  7585. if ( isSuccess ) {
  7586. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7587. if ( s.ifModified ) {
  7588. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7589. if ( modified ) {
  7590. jQuery.lastModified[ cacheURL ] = modified;
  7591. }
  7592. modified = jqXHR.getResponseHeader( "etag" );
  7593. if ( modified ) {
  7594. jQuery.etag[ cacheURL ] = modified;
  7595. }
  7596. }
  7597. // if no content
  7598. if ( status === 204 || s.type === "HEAD" ) {
  7599. statusText = "nocontent";
  7600. // if not modified
  7601. } else if ( status === 304 ) {
  7602. statusText = "notmodified";
  7603. // If we have data, let's convert it
  7604. } else {
  7605. statusText = response.state;
  7606. success = response.data;
  7607. error = response.error;
  7608. isSuccess = !error;
  7609. }
  7610. } else {
  7611. // Extract error from statusText and normalize for non-aborts
  7612. error = statusText;
  7613. if ( status || !statusText ) {
  7614. statusText = "error";
  7615. if ( status < 0 ) {
  7616. status = 0;
  7617. }
  7618. }
  7619. }
  7620. // Set data for the fake xhr object
  7621. jqXHR.status = status;
  7622. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7623. // Success/Error
  7624. if ( isSuccess ) {
  7625. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7626. } else {
  7627. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7628. }
  7629. // Status-dependent callbacks
  7630. jqXHR.statusCode( statusCode );
  7631. statusCode = undefined;
  7632. if ( fireGlobals ) {
  7633. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7634. [ jqXHR, s, isSuccess ? success : error ] );
  7635. }
  7636. // Complete
  7637. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7638. if ( fireGlobals ) {
  7639. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7640. // Handle the global AJAX counter
  7641. if ( !( --jQuery.active ) ) {
  7642. jQuery.event.trigger( "ajaxStop" );
  7643. }
  7644. }
  7645. }
  7646. return jqXHR;
  7647. },
  7648. getJSON: function( url, data, callback ) {
  7649. return jQuery.get( url, data, callback, "json" );
  7650. },
  7651. getScript: function( url, callback ) {
  7652. return jQuery.get( url, undefined, callback, "script" );
  7653. }
  7654. } );
  7655. jQuery.each( [ "get", "post" ], function( i, method ) {
  7656. jQuery[ method ] = function( url, data, callback, type ) {
  7657. // Shift arguments if data argument was omitted
  7658. if ( jQuery.isFunction( data ) ) {
  7659. type = type || callback;
  7660. callback = data;
  7661. data = undefined;
  7662. }
  7663. // The url can be an options object (which then must have .url)
  7664. return jQuery.ajax( jQuery.extend( {
  7665. url: url,
  7666. type: method,
  7667. dataType: type,
  7668. data: data,
  7669. success: callback
  7670. }, jQuery.isPlainObject( url ) && url ) );
  7671. };
  7672. } );
  7673. jQuery._evalUrl = function( url ) {
  7674. return jQuery.ajax( {
  7675. url: url,
  7676. // Make this explicit, since user can override this through ajaxSetup (#11264)
  7677. type: "GET",
  7678. dataType: "script",
  7679. cache: true,
  7680. async: false,
  7681. global: false,
  7682. "throws": true
  7683. } );
  7684. };
  7685. jQuery.fn.extend( {
  7686. wrapAll: function( html ) {
  7687. var wrap;
  7688. if ( this[ 0 ] ) {
  7689. if ( jQuery.isFunction( html ) ) {
  7690. html = html.call( this[ 0 ] );
  7691. }
  7692. // The elements to wrap the target around
  7693. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7694. if ( this[ 0 ].parentNode ) {
  7695. wrap.insertBefore( this[ 0 ] );
  7696. }
  7697. wrap.map( function() {
  7698. var elem = this;
  7699. while ( elem.firstElementChild ) {
  7700. elem = elem.firstElementChild;
  7701. }
  7702. return elem;
  7703. } ).append( this );
  7704. }
  7705. return this;
  7706. },
  7707. wrapInner: function( html ) {
  7708. if ( jQuery.isFunction( html ) ) {
  7709. return this.each( function( i ) {
  7710. jQuery( this ).wrapInner( html.call( this, i ) );
  7711. } );
  7712. }
  7713. return this.each( function() {
  7714. var self = jQuery( this ),
  7715. contents = self.contents();
  7716. if ( contents.length ) {
  7717. contents.wrapAll( html );
  7718. } else {
  7719. self.append( html );
  7720. }
  7721. } );
  7722. },
  7723. wrap: function( html ) {
  7724. var isFunction = jQuery.isFunction( html );
  7725. return this.each( function( i ) {
  7726. jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
  7727. } );
  7728. },
  7729. unwrap: function( selector ) {
  7730. this.parent( selector ).not( "body" ).each( function() {
  7731. jQuery( this ).replaceWith( this.childNodes );
  7732. } );
  7733. return this;
  7734. }
  7735. } );
  7736. jQuery.expr.pseudos.hidden = function( elem ) {
  7737. return !jQuery.expr.pseudos.visible( elem );
  7738. };
  7739. jQuery.expr.pseudos.visible = function( elem ) {
  7740. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  7741. };
  7742. jQuery.ajaxSettings.xhr = function() {
  7743. try {
  7744. return new window.XMLHttpRequest();
  7745. } catch ( e ) {}
  7746. };
  7747. var xhrSuccessStatus = {
  7748. // File protocol always yields status code 0, assume 200
  7749. 0: 200,
  7750. // Support: IE <=9 only
  7751. // #1450: sometimes IE returns 1223 when it should be 204
  7752. 1223: 204
  7753. },
  7754. xhrSupported = jQuery.ajaxSettings.xhr();
  7755. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7756. support.ajax = xhrSupported = !!xhrSupported;
  7757. jQuery.ajaxTransport( function( options ) {
  7758. var callback, errorCallback;
  7759. // Cross domain only allowed if supported through XMLHttpRequest
  7760. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7761. return {
  7762. send: function( headers, complete ) {
  7763. var i,
  7764. xhr = options.xhr();
  7765. xhr.open(
  7766. options.type,
  7767. options.url,
  7768. options.async,
  7769. options.username,
  7770. options.password
  7771. );
  7772. // Apply custom fields if provided
  7773. if ( options.xhrFields ) {
  7774. for ( i in options.xhrFields ) {
  7775. xhr[ i ] = options.xhrFields[ i ];
  7776. }
  7777. }
  7778. // Override mime type if needed
  7779. if ( options.mimeType && xhr.overrideMimeType ) {
  7780. xhr.overrideMimeType( options.mimeType );
  7781. }
  7782. // X-Requested-With header
  7783. // For cross-domain requests, seeing as conditions for a preflight are
  7784. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7785. // (it can always be set on a per-request basis or even using ajaxSetup)
  7786. // For same-domain requests, won't change header if already provided.
  7787. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  7788. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  7789. }
  7790. // Set headers
  7791. for ( i in headers ) {
  7792. xhr.setRequestHeader( i, headers[ i ] );
  7793. }
  7794. // Callback
  7795. callback = function( type ) {
  7796. return function() {
  7797. if ( callback ) {
  7798. callback = errorCallback = xhr.onload =
  7799. xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
  7800. if ( type === "abort" ) {
  7801. xhr.abort();
  7802. } else if ( type === "error" ) {
  7803. // Support: IE <=9 only
  7804. // On a manual native abort, IE9 throws
  7805. // errors on any property access that is not readyState
  7806. if ( typeof xhr.status !== "number" ) {
  7807. complete( 0, "error" );
  7808. } else {
  7809. complete(
  7810. // File: protocol always yields status 0; see #8605, #14207
  7811. xhr.status,
  7812. xhr.statusText
  7813. );
  7814. }
  7815. } else {
  7816. complete(
  7817. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7818. xhr.statusText,
  7819. // Support: IE <=9 only
  7820. // IE9 has no XHR2 but throws on binary (trac-11426)
  7821. // For XHR2 non-text, let the caller handle it (gh-2498)
  7822. ( xhr.responseType || "text" ) !== "text" ||
  7823. typeof xhr.responseText !== "string" ?
  7824. { binary: xhr.response } :
  7825. { text: xhr.responseText },
  7826. xhr.getAllResponseHeaders()
  7827. );
  7828. }
  7829. }
  7830. };
  7831. };
  7832. // Listen to events
  7833. xhr.onload = callback();
  7834. errorCallback = xhr.onerror = callback( "error" );
  7835. // Support: IE 9 only
  7836. // Use onreadystatechange to replace onabort
  7837. // to handle uncaught aborts
  7838. if ( xhr.onabort !== undefined ) {
  7839. xhr.onabort = errorCallback;
  7840. } else {
  7841. xhr.onreadystatechange = function() {
  7842. // Check readyState before timeout as it changes
  7843. if ( xhr.readyState === 4 ) {
  7844. // Allow onerror to be called first,
  7845. // but that will not handle a native abort
  7846. // Also, save errorCallback to a variable
  7847. // as xhr.onerror cannot be accessed
  7848. window.setTimeout( function() {
  7849. if ( callback ) {
  7850. errorCallback();
  7851. }
  7852. } );
  7853. }
  7854. };
  7855. }
  7856. // Create the abort callback
  7857. callback = callback( "abort" );
  7858. try {
  7859. // Do send the request (this may raise an exception)
  7860. xhr.send( options.hasContent && options.data || null );
  7861. } catch ( e ) {
  7862. // #14683: Only rethrow if this hasn't been notified as an error yet
  7863. if ( callback ) {
  7864. throw e;
  7865. }
  7866. }
  7867. },
  7868. abort: function() {
  7869. if ( callback ) {
  7870. callback();
  7871. }
  7872. }
  7873. };
  7874. }
  7875. } );
  7876. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  7877. jQuery.ajaxPrefilter( function( s ) {
  7878. if ( s.crossDomain ) {
  7879. s.contents.script = false;
  7880. }
  7881. } );
  7882. // Install script dataType
  7883. jQuery.ajaxSetup( {
  7884. accepts: {
  7885. script: "text/javascript, application/javascript, " +
  7886. "application/ecmascript, application/x-ecmascript"
  7887. },
  7888. contents: {
  7889. script: /\b(?:java|ecma)script\b/
  7890. },
  7891. converters: {
  7892. "text script": function( text ) {
  7893. jQuery.globalEval( text );
  7894. return text;
  7895. }
  7896. }
  7897. } );
  7898. // Handle cache's special case and crossDomain
  7899. jQuery.ajaxPrefilter( "script", function( s ) {
  7900. if ( s.cache === undefined ) {
  7901. s.cache = false;
  7902. }
  7903. if ( s.crossDomain ) {
  7904. s.type = "GET";
  7905. }
  7906. } );
  7907. // Bind script tag hack transport
  7908. jQuery.ajaxTransport( "script", function( s ) {
  7909. // This transport only deals with cross domain requests
  7910. if ( s.crossDomain ) {
  7911. var script, callback;
  7912. return {
  7913. send: function( _, complete ) {
  7914. script = jQuery( "<script>" ).prop( {
  7915. charset: s.scriptCharset,
  7916. src: s.url
  7917. } ).on(
  7918. "load error",
  7919. callback = function( evt ) {
  7920. script.remove();
  7921. callback = null;
  7922. if ( evt ) {
  7923. complete( evt.type === "error" ? 404 : 200, evt.type );
  7924. }
  7925. }
  7926. );
  7927. // Use native DOM manipulation to avoid our domManip AJAX trickery
  7928. document.head.appendChild( script[ 0 ] );
  7929. },
  7930. abort: function() {
  7931. if ( callback ) {
  7932. callback();
  7933. }
  7934. }
  7935. };
  7936. }
  7937. } );
  7938. var oldCallbacks = [],
  7939. rjsonp = /(=)\?(?=&|$)|\?\?/;
  7940. // Default jsonp settings
  7941. jQuery.ajaxSetup( {
  7942. jsonp: "callback",
  7943. jsonpCallback: function() {
  7944. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  7945. this[ callback ] = true;
  7946. return callback;
  7947. }
  7948. } );
  7949. // Detect, normalize options and install callbacks for jsonp requests
  7950. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7951. var callbackName, overwritten, responseContainer,
  7952. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  7953. "url" :
  7954. typeof s.data === "string" &&
  7955. ( s.contentType || "" )
  7956. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  7957. rjsonp.test( s.data ) && "data"
  7958. );
  7959. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  7960. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  7961. // Get callback name, remembering preexisting value associated with it
  7962. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  7963. s.jsonpCallback() :
  7964. s.jsonpCallback;
  7965. // Insert callback into url or form data
  7966. if ( jsonProp ) {
  7967. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  7968. } else if ( s.jsonp !== false ) {
  7969. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  7970. }
  7971. // Use data converter to retrieve json after script execution
  7972. s.converters[ "script json" ] = function() {
  7973. if ( !responseContainer ) {
  7974. jQuery.error( callbackName + " was not called" );
  7975. }
  7976. return responseContainer[ 0 ];
  7977. };
  7978. // Force json dataType
  7979. s.dataTypes[ 0 ] = "json";
  7980. // Install callback
  7981. overwritten = window[ callbackName ];
  7982. window[ callbackName ] = function() {
  7983. responseContainer = arguments;
  7984. };
  7985. // Clean-up function (fires after converters)
  7986. jqXHR.always( function() {
  7987. // If previous value didn't exist - remove it
  7988. if ( overwritten === undefined ) {
  7989. jQuery( window ).removeProp( callbackName );
  7990. // Otherwise restore preexisting value
  7991. } else {
  7992. window[ callbackName ] = overwritten;
  7993. }
  7994. // Save back as free
  7995. if ( s[ callbackName ] ) {
  7996. // Make sure that re-using the options doesn't screw things around
  7997. s.jsonpCallback = originalSettings.jsonpCallback;
  7998. // Save the callback name for future use
  7999. oldCallbacks.push( callbackName );
  8000. }
  8001. // Call if it was a function and we have a response
  8002. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  8003. overwritten( responseContainer[ 0 ] );
  8004. }
  8005. responseContainer = overwritten = undefined;
  8006. } );
  8007. // Delegate to script
  8008. return "script";
  8009. }
  8010. } );
  8011. // Support: Safari 8 only
  8012. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8013. // collapse sibling forms: the second one becomes a child of the first one.
  8014. // Because of that, this security measure has to be disabled in Safari 8.
  8015. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8016. support.createHTMLDocument = ( function() {
  8017. var body = document.implementation.createHTMLDocument( "" ).body;
  8018. body.innerHTML = "<form></form><form></form>";
  8019. return body.childNodes.length === 2;
  8020. } )();
  8021. // Argument "data" should be string of html
  8022. // context (optional): If specified, the fragment will be created in this context,
  8023. // defaults to document
  8024. // keepScripts (optional): If true, will include scripts passed in the html string
  8025. jQuery.parseHTML = function( data, context, keepScripts ) {
  8026. if ( typeof data !== "string" ) {
  8027. return [];
  8028. }
  8029. if ( typeof context === "boolean" ) {
  8030. keepScripts = context;
  8031. context = false;
  8032. }
  8033. var base, parsed, scripts;
  8034. if ( !context ) {
  8035. // Stop scripts or inline event handlers from being executed immediately
  8036. // by using document.implementation
  8037. if ( support.createHTMLDocument ) {
  8038. context = document.implementation.createHTMLDocument( "" );
  8039. // Set the base href for the created document
  8040. // so any parsed elements with URLs
  8041. // are based on the document's URL (gh-2965)
  8042. base = context.createElement( "base" );
  8043. base.href = document.location.href;
  8044. context.head.appendChild( base );
  8045. } else {
  8046. context = document;
  8047. }
  8048. }
  8049. parsed = rsingleTag.exec( data );
  8050. scripts = !keepScripts && [];
  8051. // Single tag
  8052. if ( parsed ) {
  8053. return [ context.createElement( parsed[ 1 ] ) ];
  8054. }
  8055. parsed = buildFragment( [ data ], context, scripts );
  8056. if ( scripts && scripts.length ) {
  8057. jQuery( scripts ).remove();
  8058. }
  8059. return jQuery.merge( [], parsed.childNodes );
  8060. };
  8061. /**
  8062. * Load a url into a page
  8063. */
  8064. jQuery.fn.load = function( url, params, callback ) {
  8065. var selector, type, response,
  8066. self = this,
  8067. off = url.indexOf( " " );
  8068. if ( off > -1 ) {
  8069. selector = stripAndCollapse( url.slice( off ) );
  8070. url = url.slice( 0, off );
  8071. }
  8072. // If it's a function
  8073. if ( jQuery.isFunction( params ) ) {
  8074. // We assume that it's the callback
  8075. callback = params;
  8076. params = undefined;
  8077. // Otherwise, build a param string
  8078. } else if ( params && typeof params === "object" ) {
  8079. type = "POST";
  8080. }
  8081. // If we have elements to modify, make the request
  8082. if ( self.length > 0 ) {
  8083. jQuery.ajax( {
  8084. url: url,
  8085. // If "type" variable is undefined, then "GET" method will be used.
  8086. // Make value of this field explicit since
  8087. // user can override it through ajaxSetup method
  8088. type: type || "GET",
  8089. dataType: "html",
  8090. data: params
  8091. } ).done( function( responseText ) {
  8092. // Save response for use in complete callback
  8093. response = arguments;
  8094. self.html( selector ?
  8095. // If a selector was specified, locate the right elements in a dummy div
  8096. // Exclude scripts to avoid IE 'Permission Denied' errors
  8097. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8098. // Otherwise use the full result
  8099. responseText );
  8100. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8101. // but they are ignored because response was set above.
  8102. // If it fails, this function gets "jqXHR", "status", "error"
  8103. } ).always( callback && function( jqXHR, status ) {
  8104. self.each( function() {
  8105. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8106. } );
  8107. } );
  8108. }
  8109. return this;
  8110. };
  8111. // Attach a bunch of functions for handling common AJAX events
  8112. jQuery.each( [
  8113. "ajaxStart",
  8114. "ajaxStop",
  8115. "ajaxComplete",
  8116. "ajaxError",
  8117. "ajaxSuccess",
  8118. "ajaxSend"
  8119. ], function( i, type ) {
  8120. jQuery.fn[ type ] = function( fn ) {
  8121. return this.on( type, fn );
  8122. };
  8123. } );
  8124. jQuery.expr.pseudos.animated = function( elem ) {
  8125. return jQuery.grep( jQuery.timers, function( fn ) {
  8126. return elem === fn.elem;
  8127. } ).length;
  8128. };
  8129. /**
  8130. * Gets a window from an element
  8131. */
  8132. function getWindow( elem ) {
  8133. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  8134. }
  8135. jQuery.offset = {
  8136. setOffset: function( elem, options, i ) {
  8137. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8138. position = jQuery.css( elem, "position" ),
  8139. curElem = jQuery( elem ),
  8140. props = {};
  8141. // Set position first, in-case top/left are set even on static elem
  8142. if ( position === "static" ) {
  8143. elem.style.position = "relative";
  8144. }
  8145. curOffset = curElem.offset();
  8146. curCSSTop = jQuery.css( elem, "top" );
  8147. curCSSLeft = jQuery.css( elem, "left" );
  8148. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8149. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8150. // Need to be able to calculate position if either
  8151. // top or left is auto and position is either absolute or fixed
  8152. if ( calculatePosition ) {
  8153. curPosition = curElem.position();
  8154. curTop = curPosition.top;
  8155. curLeft = curPosition.left;
  8156. } else {
  8157. curTop = parseFloat( curCSSTop ) || 0;
  8158. curLeft = parseFloat( curCSSLeft ) || 0;
  8159. }
  8160. if ( jQuery.isFunction( options ) ) {
  8161. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8162. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8163. }
  8164. if ( options.top != null ) {
  8165. props.top = ( options.top - curOffset.top ) + curTop;
  8166. }
  8167. if ( options.left != null ) {
  8168. props.left = ( options.left - curOffset.left ) + curLeft;
  8169. }
  8170. if ( "using" in options ) {
  8171. options.using.call( elem, props );
  8172. } else {
  8173. curElem.css( props );
  8174. }
  8175. }
  8176. };
  8177. jQuery.fn.extend( {
  8178. offset: function( options ) {
  8179. // Preserve chaining for setter
  8180. if ( arguments.length ) {
  8181. return options === undefined ?
  8182. this :
  8183. this.each( function( i ) {
  8184. jQuery.offset.setOffset( this, options, i );
  8185. } );
  8186. }
  8187. var docElem, win, rect, doc,
  8188. elem = this[ 0 ];
  8189. if ( !elem ) {
  8190. return;
  8191. }
  8192. // Support: IE <=11 only
  8193. // Running getBoundingClientRect on a
  8194. // disconnected node in IE throws an error
  8195. if ( !elem.getClientRects().length ) {
  8196. return { top: 0, left: 0 };
  8197. }
  8198. rect = elem.getBoundingClientRect();
  8199. // Make sure element is not hidden (display: none)
  8200. if ( rect.width || rect.height ) {
  8201. doc = elem.ownerDocument;
  8202. win = getWindow( doc );
  8203. docElem = doc.documentElement;
  8204. return {
  8205. top: rect.top + win.pageYOffset - docElem.clientTop,
  8206. left: rect.left + win.pageXOffset - docElem.clientLeft
  8207. };
  8208. }
  8209. // Return zeros for disconnected and hidden elements (gh-2310)
  8210. return rect;
  8211. },
  8212. position: function() {
  8213. if ( !this[ 0 ] ) {
  8214. return;
  8215. }
  8216. var offsetParent, offset,
  8217. elem = this[ 0 ],
  8218. parentOffset = { top: 0, left: 0 };
  8219. // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
  8220. // because it is its only offset parent
  8221. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8222. // Assume getBoundingClientRect is there when computed position is fixed
  8223. offset = elem.getBoundingClientRect();
  8224. } else {
  8225. // Get *real* offsetParent
  8226. offsetParent = this.offsetParent();
  8227. // Get correct offsets
  8228. offset = this.offset();
  8229. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  8230. parentOffset = offsetParent.offset();
  8231. }
  8232. // Add offsetParent borders
  8233. parentOffset = {
  8234. top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
  8235. left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
  8236. };
  8237. }
  8238. // Subtract parent offsets and element margins
  8239. return {
  8240. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8241. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8242. };
  8243. },
  8244. // This method will return documentElement in the following cases:
  8245. // 1) For the element inside the iframe without offsetParent, this method will return
  8246. // documentElement of the parent window
  8247. // 2) For the hidden or detached element
  8248. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8249. //
  8250. // but those exceptions were never presented as a real life use-cases
  8251. // and might be considered as more preferable results.
  8252. //
  8253. // This logic, however, is not guaranteed and can change at any point in the future
  8254. offsetParent: function() {
  8255. return this.map( function() {
  8256. var offsetParent = this.offsetParent;
  8257. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8258. offsetParent = offsetParent.offsetParent;
  8259. }
  8260. return offsetParent || documentElement;
  8261. } );
  8262. }
  8263. } );
  8264. // Create scrollLeft and scrollTop methods
  8265. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8266. var top = "pageYOffset" === prop;
  8267. jQuery.fn[ method ] = function( val ) {
  8268. return access( this, function( elem, method, val ) {
  8269. var win = getWindow( elem );
  8270. if ( val === undefined ) {
  8271. return win ? win[ prop ] : elem[ method ];
  8272. }
  8273. if ( win ) {
  8274. win.scrollTo(
  8275. !top ? val : win.pageXOffset,
  8276. top ? val : win.pageYOffset
  8277. );
  8278. } else {
  8279. elem[ method ] = val;
  8280. }
  8281. }, method, val, arguments.length );
  8282. };
  8283. } );
  8284. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8285. // Add the top/left cssHooks using jQuery.fn.position
  8286. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8287. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8288. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8289. // rather than make the css module depend on the offset module, just check for it here
  8290. jQuery.each( [ "top", "left" ], function( i, prop ) {
  8291. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8292. function( elem, computed ) {
  8293. if ( computed ) {
  8294. computed = curCSS( elem, prop );
  8295. // If curCSS returns percentage, fallback to offset
  8296. return rnumnonpx.test( computed ) ?
  8297. jQuery( elem ).position()[ prop ] + "px" :
  8298. computed;
  8299. }
  8300. }
  8301. );
  8302. } );
  8303. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8304. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8305. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  8306. function( defaultExtra, funcName ) {
  8307. // Margin is only for outerHeight, outerWidth
  8308. jQuery.fn[ funcName ] = function( margin, value ) {
  8309. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8310. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8311. return access( this, function( elem, type, value ) {
  8312. var doc;
  8313. if ( jQuery.isWindow( elem ) ) {
  8314. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8315. return funcName.indexOf( "outer" ) === 0 ?
  8316. elem[ "inner" + name ] :
  8317. elem.document.documentElement[ "client" + name ];
  8318. }
  8319. // Get document width or height
  8320. if ( elem.nodeType === 9 ) {
  8321. doc = elem.documentElement;
  8322. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8323. // whichever is greatest
  8324. return Math.max(
  8325. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8326. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8327. doc[ "client" + name ]
  8328. );
  8329. }
  8330. return value === undefined ?
  8331. // Get width or height on the element, requesting but not forcing parseFloat
  8332. jQuery.css( elem, type, extra ) :
  8333. // Set width or height on the element
  8334. jQuery.style( elem, type, value, extra );
  8335. }, type, chainable ? margin : undefined, chainable );
  8336. };
  8337. } );
  8338. } );
  8339. jQuery.fn.extend( {
  8340. bind: function( types, data, fn ) {
  8341. return this.on( types, null, data, fn );
  8342. },
  8343. unbind: function( types, fn ) {
  8344. return this.off( types, null, fn );
  8345. },
  8346. delegate: function( selector, types, data, fn ) {
  8347. return this.on( types, selector, data, fn );
  8348. },
  8349. undelegate: function( selector, types, fn ) {
  8350. // ( namespace ) or ( selector, types [, fn] )
  8351. return arguments.length === 1 ?
  8352. this.off( selector, "**" ) :
  8353. this.off( types, selector || "**", fn );
  8354. }
  8355. } );
  8356. jQuery.parseJSON = JSON.parse;
  8357. // Register as a named AMD module, since jQuery can be concatenated with other
  8358. // files that may use define, but not via a proper concatenation script that
  8359. // understands anonymous AMD modules. A named AMD is safest and most robust
  8360. // way to register. Lowercase jquery is used because AMD module names are
  8361. // derived from file names, and jQuery is normally delivered in a lowercase
  8362. // file name. Do this after creating the global so that if an AMD module wants
  8363. // to call noConflict to hide this version of jQuery, it will work.
  8364. // Note that for maximum portability, libraries that are not jQuery should
  8365. // declare themselves as anonymous modules, and avoid setting a global if an
  8366. // AMD loader is present. jQuery is a special case. For more information, see
  8367. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  8368. if ( true ) {
  8369. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  8370. return jQuery;
  8371. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  8372. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8373. }
  8374. var
  8375. // Map over jQuery in case of overwrite
  8376. _jQuery = window.jQuery,
  8377. // Map over the $ in case of overwrite
  8378. _$ = window.$;
  8379. jQuery.noConflict = function( deep ) {
  8380. if ( window.$ === jQuery ) {
  8381. window.$ = _$;
  8382. }
  8383. if ( deep && window.jQuery === jQuery ) {
  8384. window.jQuery = _jQuery;
  8385. }
  8386. return jQuery;
  8387. };
  8388. // Expose jQuery and $ identifiers, even in AMD
  8389. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8390. // and CommonJS for browser emulators (#13566)
  8391. if ( !noGlobal ) {
  8392. window.jQuery = window.$ = jQuery;
  8393. }
  8394. return jQuery;
  8395. } );
  8396. /***/ }),
  8397. /* 2 */
  8398. /***/ (function(module, exports, __webpack_require__) {
  8399. /*!
  8400. * sweetalert2 v6.4.2
  8401. * Released under the MIT License.
  8402. */
  8403. (function (global, factory) {
  8404. true ? module.exports = factory() :
  8405. typeof define === 'function' && define.amd ? define(factory) :
  8406. (global.Sweetalert2 = factory());
  8407. }(this, (function () { 'use strict';
  8408. var defaultParams = {
  8409. title: '',
  8410. titleText: '',
  8411. text: '',
  8412. html: '',
  8413. type: null,
  8414. customClass: '',
  8415. target: 'body',
  8416. animation: true,
  8417. allowOutsideClick: true,
  8418. allowEscapeKey: true,
  8419. allowEnterKey: true,
  8420. showConfirmButton: true,
  8421. showCancelButton: false,
  8422. preConfirm: null,
  8423. confirmButtonText: 'OK',
  8424. confirmButtonColor: '#3085d6',
  8425. confirmButtonClass: null,
  8426. cancelButtonText: 'Cancel',
  8427. cancelButtonColor: '#aaa',
  8428. cancelButtonClass: null,
  8429. buttonsStyling: true,
  8430. reverseButtons: false,
  8431. focusCancel: false,
  8432. showCloseButton: false,
  8433. showLoaderOnConfirm: false,
  8434. imageUrl: null,
  8435. imageWidth: null,
  8436. imageHeight: null,
  8437. imageClass: null,
  8438. timer: null,
  8439. width: 500,
  8440. padding: 20,
  8441. background: '#fff',
  8442. input: null,
  8443. inputPlaceholder: '',
  8444. inputValue: '',
  8445. inputOptions: {},
  8446. inputAutoTrim: true,
  8447. inputClass: null,
  8448. inputAttributes: {},
  8449. inputValidator: null,
  8450. progressSteps: [],
  8451. currentProgressStep: null,
  8452. progressStepsDistance: '40px',
  8453. onOpen: null,
  8454. onClose: null
  8455. };
  8456. var swalPrefix = 'swal2-';
  8457. var prefix = function prefix(items) {
  8458. var result = {};
  8459. for (var i in items) {
  8460. result[items[i]] = swalPrefix + items[i];
  8461. }
  8462. return result;
  8463. };
  8464. var swalClasses = prefix(['container', 'shown', 'iosfix', 'modal', 'overlay', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'content', 'spacer', 'confirm', 'cancel', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea', 'inputerror', 'validationerror', 'progresssteps', 'activeprogressstep', 'progresscircle', 'progressline', 'loading', 'styled']);
  8465. var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);
  8466. /*
  8467. * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
  8468. */
  8469. var colorLuminance = function colorLuminance(hex, lum) {
  8470. // Validate hex string
  8471. hex = String(hex).replace(/[^0-9a-f]/gi, '');
  8472. if (hex.length < 6) {
  8473. hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
  8474. }
  8475. lum = lum || 0;
  8476. // Convert to decimal and change luminosity
  8477. var rgb = '#';
  8478. for (var i = 0; i < 3; i++) {
  8479. var c = parseInt(hex.substr(i * 2, 2), 16);
  8480. c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
  8481. rgb += ('00' + c).substr(c.length);
  8482. }
  8483. return rgb;
  8484. };
  8485. /* global MouseEvent */
  8486. // Remember state in cases where opening and handling a modal will fiddle with it.
  8487. var states = {
  8488. previousWindowKeyDown: null,
  8489. previousActiveElement: null,
  8490. previousBodyPadding: null
  8491. };
  8492. /*
  8493. * Add modal + overlay to DOM
  8494. */
  8495. var init = function init(params) {
  8496. if (typeof document === 'undefined') {
  8497. console.error('SweetAlert2 requires document to initialize');
  8498. return;
  8499. }
  8500. var container = document.createElement('div');
  8501. container.className = swalClasses.container;
  8502. container.innerHTML = sweetHTML;
  8503. var targetElement = document.querySelector(params.target);
  8504. if (!targetElement) {
  8505. console.warn('SweetAlert2: Can\'t find the target "' + params.target + '"');
  8506. targetElement = document.body;
  8507. }
  8508. targetElement.appendChild(container);
  8509. var modal = getModal();
  8510. var input = getChildByClass(modal, swalClasses.input);
  8511. var file = getChildByClass(modal, swalClasses.file);
  8512. var range = modal.querySelector('.' + swalClasses.range + ' input');
  8513. var rangeOutput = modal.querySelector('.' + swalClasses.range + ' output');
  8514. var select = getChildByClass(modal, swalClasses.select);
  8515. var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input');
  8516. var textarea = getChildByClass(modal, swalClasses.textarea);
  8517. input.oninput = function () {
  8518. sweetAlert.resetValidationError();
  8519. };
  8520. input.onkeydown = function (event) {
  8521. setTimeout(function () {
  8522. if (event.keyCode === 13 && params.allowEnterKey) {
  8523. event.stopPropagation();
  8524. sweetAlert.clickConfirm();
  8525. }
  8526. }, 0);
  8527. };
  8528. file.onchange = function () {
  8529. sweetAlert.resetValidationError();
  8530. };
  8531. range.oninput = function () {
  8532. sweetAlert.resetValidationError();
  8533. rangeOutput.value = range.value;
  8534. };
  8535. range.onchange = function () {
  8536. sweetAlert.resetValidationError();
  8537. range.previousSibling.value = range.value;
  8538. };
  8539. select.onchange = function () {
  8540. sweetAlert.resetValidationError();
  8541. };
  8542. checkbox.onchange = function () {
  8543. sweetAlert.resetValidationError();
  8544. };
  8545. textarea.oninput = function () {
  8546. sweetAlert.resetValidationError();
  8547. };
  8548. return modal;
  8549. };
  8550. /*
  8551. * Manipulate DOM
  8552. */
  8553. var sweetHTML = ('\n <div role="dialog" aria-labelledby="modalTitleId" aria-describedby="modalContentId" class="' + swalClasses.modal + '" tabIndex="-1" >\n <ul class="' + swalClasses.progresssteps + '"></ul>\n <div class="' + swalClasses.icon + ' ' + iconTypes.error + '">\n <span class="x-mark"><span class="line left"></span><span class="line right"></span></span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.question + '">?</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">!</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.info + '">i</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.success + '">\n <span class="line tip"></span> <span class="line long"></span>\n <div class="placeholder"></div> <div class="fix"></div>\n </div>\n <img class="' + swalClasses.image + '">\n <h2 class="' + swalClasses.title + '" id="modalTitleId"></h2>\n <div id="modalContentId" class="' + swalClasses.content + '"></div>\n <input class="' + swalClasses.input + '">\n <input type="file" class="' + swalClasses.file + '">\n <div class="' + swalClasses.range + '">\n <output></output>\n <input type="range">\n </div>\n <select class="' + swalClasses.select + '"></select>\n <div class="' + swalClasses.radio + '"></div>\n <label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">\n <input type="checkbox">\n </label>\n <textarea class="' + swalClasses.textarea + '"></textarea>\n <div class="' + swalClasses.validationerror + '"></div>\n <hr class="' + swalClasses.spacer + '">\n <button type="button" role="button" tabIndex="0" class="' + swalClasses.confirm + '">OK</button>\n <button type="button" role="button" tabIndex="0" class="' + swalClasses.cancel + '">Cancel</button>\n <span class="' + swalClasses.close + '">&times;</span>\n </div>\n').replace(/(^|\n)\s*/g, '');
  8554. var getContainer = function getContainer() {
  8555. return document.body.querySelector('.' + swalClasses.container);
  8556. };
  8557. var getModal = function getModal() {
  8558. return getContainer() ? getContainer().querySelector('.' + swalClasses.modal) : null;
  8559. };
  8560. var getIcons = function getIcons() {
  8561. var modal = getModal();
  8562. return modal.querySelectorAll('.' + swalClasses.icon);
  8563. };
  8564. var elementByClass = function elementByClass(className) {
  8565. return getContainer() ? getContainer().querySelector('.' + className) : null;
  8566. };
  8567. var getTitle = function getTitle() {
  8568. return elementByClass(swalClasses.title);
  8569. };
  8570. var getContent = function getContent() {
  8571. return elementByClass(swalClasses.content);
  8572. };
  8573. var getImage = function getImage() {
  8574. return elementByClass(swalClasses.image);
  8575. };
  8576. var getSpacer = function getSpacer() {
  8577. return elementByClass(swalClasses.spacer);
  8578. };
  8579. var getProgressSteps = function getProgressSteps() {
  8580. return elementByClass(swalClasses.progresssteps);
  8581. };
  8582. var getValidationError = function getValidationError() {
  8583. return elementByClass(swalClasses.validationerror);
  8584. };
  8585. var getConfirmButton = function getConfirmButton() {
  8586. return elementByClass(swalClasses.confirm);
  8587. };
  8588. var getCancelButton = function getCancelButton() {
  8589. return elementByClass(swalClasses.cancel);
  8590. };
  8591. var getCloseButton = function getCloseButton() {
  8592. return elementByClass(swalClasses.close);
  8593. };
  8594. var getFocusableElements = function getFocusableElements(focusCancel) {
  8595. var buttons = [getConfirmButton(), getCancelButton()];
  8596. if (focusCancel) {
  8597. buttons.reverse();
  8598. }
  8599. return buttons.concat(Array.prototype.slice.call(getModal().querySelectorAll('button:not([class^=' + swalPrefix + ']), input:not([type=hidden]), textarea, select')));
  8600. };
  8601. var hasClass = function hasClass(elem, className) {
  8602. if (elem.classList) {
  8603. return elem.classList.contains(className);
  8604. }
  8605. return false;
  8606. };
  8607. var focusInput = function focusInput(input) {
  8608. input.focus();
  8609. // place cursor at end of text in text input
  8610. if (input.type !== 'file') {
  8611. // http://stackoverflow.com/a/2345915/1331425
  8612. var val = input.value;
  8613. input.value = '';
  8614. input.value = val;
  8615. }
  8616. };
  8617. var addClass = function addClass(elem, className) {
  8618. if (!elem || !className) {
  8619. return;
  8620. }
  8621. var classes = className.split(/\s+/).filter(Boolean);
  8622. classes.forEach(function (className) {
  8623. elem.classList.add(className);
  8624. });
  8625. };
  8626. var removeClass = function removeClass(elem, className) {
  8627. if (!elem || !className) {
  8628. return;
  8629. }
  8630. var classes = className.split(/\s+/).filter(Boolean);
  8631. classes.forEach(function (className) {
  8632. elem.classList.remove(className);
  8633. });
  8634. };
  8635. var getChildByClass = function getChildByClass(elem, className) {
  8636. for (var i = 0; i < elem.childNodes.length; i++) {
  8637. if (hasClass(elem.childNodes[i], className)) {
  8638. return elem.childNodes[i];
  8639. }
  8640. }
  8641. };
  8642. var show = function show(elem, display) {
  8643. if (!display) {
  8644. display = 'block';
  8645. }
  8646. elem.style.opacity = '';
  8647. elem.style.display = display;
  8648. };
  8649. var hide = function hide(elem) {
  8650. elem.style.opacity = '';
  8651. elem.style.display = 'none';
  8652. };
  8653. var empty = function empty(elem) {
  8654. while (elem.firstChild) {
  8655. elem.removeChild(elem.firstChild);
  8656. }
  8657. };
  8658. // borrowed from jqeury $(elem).is(':visible') implementation
  8659. var isVisible = function isVisible(elem) {
  8660. return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length;
  8661. };
  8662. var removeStyleProperty = function removeStyleProperty(elem, property) {
  8663. if (elem.style.removeProperty) {
  8664. elem.style.removeProperty(property);
  8665. } else {
  8666. elem.style.removeAttribute(property);
  8667. }
  8668. };
  8669. var fireClick = function fireClick(node) {
  8670. if (!isVisible(node)) {
  8671. return false;
  8672. }
  8673. // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/
  8674. // Then fixed for today's Chrome browser.
  8675. if (typeof MouseEvent === 'function') {
  8676. // Up-to-date approach
  8677. var mevt = new MouseEvent('click', {
  8678. view: window,
  8679. bubbles: false,
  8680. cancelable: true
  8681. });
  8682. node.dispatchEvent(mevt);
  8683. } else if (document.createEvent) {
  8684. // Fallback
  8685. var evt = document.createEvent('MouseEvents');
  8686. evt.initEvent('click', false, false);
  8687. node.dispatchEvent(evt);
  8688. } else if (document.createEventObject) {
  8689. node.fireEvent('onclick');
  8690. } else if (typeof node.onclick === 'function') {
  8691. node.onclick();
  8692. }
  8693. };
  8694. var animationEndEvent = function () {
  8695. var testEl = document.createElement('div');
  8696. var transEndEventNames = {
  8697. 'WebkitAnimation': 'webkitAnimationEnd',
  8698. 'OAnimation': 'oAnimationEnd oanimationend',
  8699. 'msAnimation': 'MSAnimationEnd',
  8700. 'animation': 'animationend'
  8701. };
  8702. for (var i in transEndEventNames) {
  8703. if (transEndEventNames.hasOwnProperty(i) && testEl.style[i] !== undefined) {
  8704. return transEndEventNames[i];
  8705. }
  8706. }
  8707. return false;
  8708. }();
  8709. // Reset previous window keydown handler and focued element
  8710. var resetPrevState = function resetPrevState() {
  8711. window.onkeydown = states.previousWindowKeyDown;
  8712. if (states.previousActiveElement && states.previousActiveElement.focus) {
  8713. var x = window.scrollX;
  8714. var y = window.scrollY;
  8715. states.previousActiveElement.focus();
  8716. if (x && y) {
  8717. // IE has no scrollX/scrollY support
  8718. window.scrollTo(x, y);
  8719. }
  8720. }
  8721. };
  8722. // Measure width of scrollbar
  8723. // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
  8724. var measureScrollbar = function measureScrollbar() {
  8725. var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
  8726. if (supportsTouch) {
  8727. return 0;
  8728. }
  8729. var scrollDiv = document.createElement('div');
  8730. scrollDiv.style.width = '50px';
  8731. scrollDiv.style.height = '50px';
  8732. scrollDiv.style.overflow = 'scroll';
  8733. document.body.appendChild(scrollDiv);
  8734. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  8735. document.body.removeChild(scrollDiv);
  8736. return scrollbarWidth;
  8737. };
  8738. // JavaScript Debounce Function
  8739. // Simplivied version of https://davidwalsh.name/javascript-debounce-function
  8740. var debounce = function debounce(func, wait) {
  8741. var timeout = void 0;
  8742. return function () {
  8743. var later = function later() {
  8744. timeout = null;
  8745. func();
  8746. };
  8747. clearTimeout(timeout);
  8748. timeout = setTimeout(later, wait);
  8749. };
  8750. };
  8751. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  8752. return typeof obj;
  8753. } : function (obj) {
  8754. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  8755. };
  8756. var _extends = Object.assign || function (target) {
  8757. for (var i = 1; i < arguments.length; i++) {
  8758. var source = arguments[i];
  8759. for (var key in source) {
  8760. if (Object.prototype.hasOwnProperty.call(source, key)) {
  8761. target[key] = source[key];
  8762. }
  8763. }
  8764. }
  8765. return target;
  8766. };
  8767. var modalParams = _extends({}, defaultParams);
  8768. var queue = [];
  8769. var swal2Observer = void 0;
  8770. /*
  8771. * Set type, text and actions on modal
  8772. */
  8773. var setParameters = function setParameters(params) {
  8774. var modal = getModal() || init(params);
  8775. for (var param in params) {
  8776. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  8777. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  8778. }
  8779. }
  8780. // set modal width and margin-left
  8781. modal.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
  8782. modal.style.padding = params.padding + 'px';
  8783. modal.style.background = params.background;
  8784. var title = getTitle();
  8785. var content = getContent();
  8786. var confirmButton = getConfirmButton();
  8787. var cancelButton = getCancelButton();
  8788. var closeButton = getCloseButton();
  8789. // Title
  8790. if (params.titleText) {
  8791. title.innerText = params.titleText;
  8792. } else {
  8793. title.innerHTML = params.title.split('\n').join('<br>');
  8794. }
  8795. // Content
  8796. if (params.text || params.html) {
  8797. if (_typeof(params.html) === 'object') {
  8798. content.innerHTML = '';
  8799. if (0 in params.html) {
  8800. for (var i = 0; i in params.html; i++) {
  8801. content.appendChild(params.html[i].cloneNode(true));
  8802. }
  8803. } else {
  8804. content.appendChild(params.html.cloneNode(true));
  8805. }
  8806. } else if (params.html) {
  8807. content.innerHTML = params.html;
  8808. } else if (params.text) {
  8809. content.textContent = params.text;
  8810. }
  8811. show(content);
  8812. } else {
  8813. hide(content);
  8814. }
  8815. // Close button
  8816. if (params.showCloseButton) {
  8817. show(closeButton);
  8818. } else {
  8819. hide(closeButton);
  8820. }
  8821. // Custom Class
  8822. modal.className = swalClasses.modal;
  8823. if (params.customClass) {
  8824. addClass(modal, params.customClass);
  8825. }
  8826. // Progress steps
  8827. var progressStepsContainer = getProgressSteps();
  8828. var currentProgressStep = parseInt(params.currentProgressStep === null ? sweetAlert.getQueueStep() : params.currentProgressStep, 10);
  8829. if (params.progressSteps.length) {
  8830. show(progressStepsContainer);
  8831. empty(progressStepsContainer);
  8832. if (currentProgressStep >= params.progressSteps.length) {
  8833. console.warn('SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
  8834. }
  8835. params.progressSteps.forEach(function (step, index) {
  8836. var circle = document.createElement('li');
  8837. addClass(circle, swalClasses.progresscircle);
  8838. circle.innerHTML = step;
  8839. if (index === currentProgressStep) {
  8840. addClass(circle, swalClasses.activeprogressstep);
  8841. }
  8842. progressStepsContainer.appendChild(circle);
  8843. if (index !== params.progressSteps.length - 1) {
  8844. var line = document.createElement('li');
  8845. addClass(line, swalClasses.progressline);
  8846. line.style.width = params.progressStepsDistance;
  8847. progressStepsContainer.appendChild(line);
  8848. }
  8849. });
  8850. } else {
  8851. hide(progressStepsContainer);
  8852. }
  8853. // Icon
  8854. var icons = getIcons();
  8855. for (var _i = 0; _i < icons.length; _i++) {
  8856. hide(icons[_i]);
  8857. }
  8858. if (params.type) {
  8859. var validType = false;
  8860. for (var iconType in iconTypes) {
  8861. if (params.type === iconType) {
  8862. validType = true;
  8863. break;
  8864. }
  8865. }
  8866. if (!validType) {
  8867. console.error('SweetAlert2: Unknown alert type: ' + params.type);
  8868. return false;
  8869. }
  8870. var icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]);
  8871. show(icon);
  8872. // Animate icon
  8873. switch (params.type) {
  8874. case 'success':
  8875. addClass(icon, 'animate');
  8876. addClass(icon.querySelector('.tip'), 'animate-success-tip');
  8877. addClass(icon.querySelector('.long'), 'animate-success-long');
  8878. break;
  8879. case 'error':
  8880. addClass(icon, 'animate-error-icon');
  8881. addClass(icon.querySelector('.x-mark'), 'animate-x-mark');
  8882. break;
  8883. case 'warning':
  8884. addClass(icon, 'pulse-warning');
  8885. break;
  8886. default:
  8887. break;
  8888. }
  8889. }
  8890. // Custom image
  8891. var image = getImage();
  8892. if (params.imageUrl) {
  8893. image.setAttribute('src', params.imageUrl);
  8894. show(image);
  8895. if (params.imageWidth) {
  8896. image.setAttribute('width', params.imageWidth);
  8897. } else {
  8898. image.removeAttribute('width');
  8899. }
  8900. if (params.imageHeight) {
  8901. image.setAttribute('height', params.imageHeight);
  8902. } else {
  8903. image.removeAttribute('height');
  8904. }
  8905. image.className = swalClasses.image;
  8906. if (params.imageClass) {
  8907. addClass(image, params.imageClass);
  8908. }
  8909. } else {
  8910. hide(image);
  8911. }
  8912. // Cancel button
  8913. if (params.showCancelButton) {
  8914. cancelButton.style.display = 'inline-block';
  8915. } else {
  8916. hide(cancelButton);
  8917. }
  8918. // Confirm button
  8919. if (params.showConfirmButton) {
  8920. removeStyleProperty(confirmButton, 'display');
  8921. } else {
  8922. hide(confirmButton);
  8923. }
  8924. // Buttons spacer
  8925. var spacer = getSpacer();
  8926. if (!params.showConfirmButton && !params.showCancelButton) {
  8927. hide(spacer);
  8928. } else {
  8929. show(spacer);
  8930. }
  8931. // Edit text on cancel and confirm buttons
  8932. confirmButton.innerHTML = params.confirmButtonText;
  8933. cancelButton.innerHTML = params.cancelButtonText;
  8934. // Set buttons to selected background colors
  8935. if (params.buttonsStyling) {
  8936. confirmButton.style.backgroundColor = params.confirmButtonColor;
  8937. cancelButton.style.backgroundColor = params.cancelButtonColor;
  8938. }
  8939. // Add buttons custom classes
  8940. confirmButton.className = swalClasses.confirm;
  8941. addClass(confirmButton, params.confirmButtonClass);
  8942. cancelButton.className = swalClasses.cancel;
  8943. addClass(cancelButton, params.cancelButtonClass);
  8944. // Buttons styling
  8945. if (params.buttonsStyling) {
  8946. addClass(confirmButton, swalClasses.styled);
  8947. addClass(cancelButton, swalClasses.styled);
  8948. } else {
  8949. removeClass(confirmButton, swalClasses.styled);
  8950. removeClass(cancelButton, swalClasses.styled);
  8951. confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
  8952. cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
  8953. }
  8954. // CSS animation
  8955. if (params.animation === true) {
  8956. removeClass(modal, swalClasses.noanimation);
  8957. } else {
  8958. addClass(modal, swalClasses.noanimation);
  8959. }
  8960. };
  8961. /*
  8962. * Animations
  8963. */
  8964. var openModal = function openModal(animation, onComplete) {
  8965. var container = getContainer();
  8966. var modal = getModal();
  8967. if (animation) {
  8968. addClass(modal, swalClasses.show);
  8969. addClass(container, swalClasses.fade);
  8970. removeClass(modal, swalClasses.hide);
  8971. } else {
  8972. removeClass(modal, swalClasses.fade);
  8973. }
  8974. show(modal);
  8975. // scrolling is 'hidden' until animation is done, after that 'auto'
  8976. container.style.overflowY = 'hidden';
  8977. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  8978. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  8979. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  8980. container.style.overflowY = 'auto';
  8981. });
  8982. } else {
  8983. container.style.overflowY = 'auto';
  8984. }
  8985. addClass(document.documentElement, swalClasses.shown);
  8986. addClass(document.body, swalClasses.shown);
  8987. addClass(container, swalClasses.shown);
  8988. fixScrollbar();
  8989. iOSfix();
  8990. states.previousActiveElement = document.activeElement;
  8991. if (onComplete !== null && typeof onComplete === 'function') {
  8992. setTimeout(function () {
  8993. onComplete(modal);
  8994. });
  8995. }
  8996. };
  8997. var fixScrollbar = function fixScrollbar() {
  8998. // for queues, do not do this more than once
  8999. if (states.previousBodyPadding !== null) {
  9000. return;
  9001. }
  9002. // if the body has overflow
  9003. if (document.body.scrollHeight > window.innerHeight) {
  9004. // add padding so the content doesn't shift after removal of scrollbar
  9005. states.previousBodyPadding = document.body.style.paddingRight;
  9006. document.body.style.paddingRight = measureScrollbar() + 'px';
  9007. }
  9008. };
  9009. var undoScrollbar = function undoScrollbar() {
  9010. if (states.previousBodyPadding !== null) {
  9011. document.body.style.paddingRight = states.previousBodyPadding;
  9012. states.previousBodyPadding = null;
  9013. }
  9014. };
  9015. // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425
  9016. var iOSfix = function iOSfix() {
  9017. var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
  9018. if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
  9019. var offset = document.body.scrollTop;
  9020. document.body.style.top = offset * -1 + 'px';
  9021. addClass(document.body, swalClasses.iosfix);
  9022. }
  9023. };
  9024. var undoIOSfix = function undoIOSfix() {
  9025. if (hasClass(document.body, swalClasses.iosfix)) {
  9026. var offset = parseInt(document.body.style.top, 10);
  9027. removeClass(document.body, swalClasses.iosfix);
  9028. document.body.style.top = '';
  9029. document.body.scrollTop = offset * -1;
  9030. }
  9031. };
  9032. // SweetAlert entry point
  9033. var sweetAlert = function sweetAlert() {
  9034. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9035. args[_key] = arguments[_key];
  9036. }
  9037. if (args[0] === undefined) {
  9038. console.error('SweetAlert2 expects at least 1 attribute!');
  9039. return false;
  9040. }
  9041. var params = _extends({}, modalParams);
  9042. switch (_typeof(args[0])) {
  9043. case 'string':
  9044. params.title = args[0];
  9045. params.html = args[1];
  9046. params.type = args[2];
  9047. break;
  9048. case 'object':
  9049. _extends(params, args[0]);
  9050. params.extraParams = args[0].extraParams;
  9051. if (params.input === 'email' && params.inputValidator === null) {
  9052. params.inputValidator = function (email) {
  9053. return new Promise(function (resolve, reject) {
  9054. var emailRegex = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
  9055. if (emailRegex.test(email)) {
  9056. resolve();
  9057. } else {
  9058. reject('Invalid email address');
  9059. }
  9060. });
  9061. };
  9062. }
  9063. break;
  9064. default:
  9065. console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0]));
  9066. return false;
  9067. }
  9068. setParameters(params);
  9069. var container = getContainer();
  9070. var modal = getModal();
  9071. return new Promise(function (resolve, reject) {
  9072. // Close on timer
  9073. if (params.timer) {
  9074. modal.timeout = setTimeout(function () {
  9075. sweetAlert.closeModal(params.onClose);
  9076. reject('timer');
  9077. }, params.timer);
  9078. }
  9079. // Get input element by specified type or, if type isn't specified, by params.input
  9080. var getInput = function getInput(inputType) {
  9081. inputType = inputType || params.input;
  9082. if (!inputType) {
  9083. return null;
  9084. }
  9085. switch (inputType) {
  9086. case 'select':
  9087. case 'textarea':
  9088. case 'file':
  9089. return getChildByClass(modal, swalClasses[inputType]);
  9090. case 'checkbox':
  9091. return modal.querySelector('.' + swalClasses.checkbox + ' input');
  9092. case 'radio':
  9093. return modal.querySelector('.' + swalClasses.radio + ' input:checked') || modal.querySelector('.' + swalClasses.radio + ' input:first-child');
  9094. case 'range':
  9095. return modal.querySelector('.' + swalClasses.range + ' input');
  9096. default:
  9097. return getChildByClass(modal, swalClasses.input);
  9098. }
  9099. };
  9100. // Get the value of the modal input
  9101. var getInputValue = function getInputValue() {
  9102. var input = getInput();
  9103. if (!input) {
  9104. return null;
  9105. }
  9106. switch (params.input) {
  9107. case 'checkbox':
  9108. return input.checked ? 1 : 0;
  9109. case 'radio':
  9110. return input.checked ? input.value : null;
  9111. case 'file':
  9112. return input.files.length ? input.files[0] : null;
  9113. default:
  9114. return params.inputAutoTrim ? input.value.trim() : input.value;
  9115. }
  9116. };
  9117. // input autofocus
  9118. if (params.input) {
  9119. setTimeout(function () {
  9120. var input = getInput();
  9121. if (input) {
  9122. focusInput(input);
  9123. }
  9124. }, 0);
  9125. }
  9126. var confirm = function confirm(value) {
  9127. if (params.showLoaderOnConfirm) {
  9128. sweetAlert.showLoading();
  9129. }
  9130. if (params.preConfirm) {
  9131. params.preConfirm(value, params.extraParams).then(function (preConfirmValue) {
  9132. sweetAlert.closeModal(params.onClose);
  9133. resolve(preConfirmValue || value);
  9134. }, function (error) {
  9135. sweetAlert.hideLoading();
  9136. if (error) {
  9137. sweetAlert.showValidationError(error);
  9138. }
  9139. });
  9140. } else {
  9141. sweetAlert.closeModal(params.onClose);
  9142. resolve(value);
  9143. }
  9144. };
  9145. // Mouse interactions
  9146. var onButtonEvent = function onButtonEvent(event) {
  9147. var e = event || window.event;
  9148. var target = e.target || e.srcElement;
  9149. var confirmButton = getConfirmButton();
  9150. var cancelButton = getCancelButton();
  9151. var targetedConfirm = confirmButton === target || confirmButton.contains(target);
  9152. var targetedCancel = cancelButton === target || cancelButton.contains(target);
  9153. switch (e.type) {
  9154. case 'mouseover':
  9155. case 'mouseup':
  9156. if (params.buttonsStyling) {
  9157. if (targetedConfirm) {
  9158. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1);
  9159. } else if (targetedCancel) {
  9160. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1);
  9161. }
  9162. }
  9163. break;
  9164. case 'mouseout':
  9165. if (params.buttonsStyling) {
  9166. if (targetedConfirm) {
  9167. confirmButton.style.backgroundColor = params.confirmButtonColor;
  9168. } else if (targetedCancel) {
  9169. cancelButton.style.backgroundColor = params.cancelButtonColor;
  9170. }
  9171. }
  9172. break;
  9173. case 'mousedown':
  9174. if (params.buttonsStyling) {
  9175. if (targetedConfirm) {
  9176. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2);
  9177. } else if (targetedCancel) {
  9178. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2);
  9179. }
  9180. }
  9181. break;
  9182. case 'click':
  9183. // Clicked 'confirm'
  9184. if (targetedConfirm && sweetAlert.isVisible()) {
  9185. sweetAlert.disableButtons();
  9186. if (params.input) {
  9187. (function () {
  9188. var inputValue = getInputValue();
  9189. if (params.inputValidator) {
  9190. sweetAlert.disableInput();
  9191. params.inputValidator(inputValue, params.extraParams).then(function () {
  9192. sweetAlert.enableButtons();
  9193. sweetAlert.enableInput();
  9194. confirm(inputValue);
  9195. }, function (error) {
  9196. sweetAlert.enableButtons();
  9197. sweetAlert.enableInput();
  9198. if (error) {
  9199. sweetAlert.showValidationError(error);
  9200. }
  9201. });
  9202. } else {
  9203. confirm(inputValue);
  9204. }
  9205. })();
  9206. } else {
  9207. confirm(true);
  9208. }
  9209. // Clicked 'cancel'
  9210. } else if (targetedCancel && sweetAlert.isVisible()) {
  9211. sweetAlert.disableButtons();
  9212. sweetAlert.closeModal(params.onClose);
  9213. reject('cancel');
  9214. }
  9215. break;
  9216. default:
  9217. }
  9218. };
  9219. var buttons = modal.querySelectorAll('button');
  9220. for (var i = 0; i < buttons.length; i++) {
  9221. buttons[i].onclick = onButtonEvent;
  9222. buttons[i].onmouseover = onButtonEvent;
  9223. buttons[i].onmouseout = onButtonEvent;
  9224. buttons[i].onmousedown = onButtonEvent;
  9225. }
  9226. // Closing modal by close button
  9227. getCloseButton().onclick = function () {
  9228. sweetAlert.closeModal(params.onClose);
  9229. reject('close');
  9230. };
  9231. // Closing modal by overlay click
  9232. container.onclick = function (e) {
  9233. if (e.target !== container) {
  9234. return;
  9235. }
  9236. if (params.allowOutsideClick) {
  9237. sweetAlert.closeModal(params.onClose);
  9238. reject('overlay');
  9239. }
  9240. };
  9241. var confirmButton = getConfirmButton();
  9242. var cancelButton = getCancelButton();
  9243. // Reverse buttons (Confirm on the right side)
  9244. if (params.reverseButtons) {
  9245. confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
  9246. } else {
  9247. confirmButton.parentNode.insertBefore(confirmButton, cancelButton);
  9248. }
  9249. // Focus handling
  9250. var setFocus = function setFocus(index, increment) {
  9251. var focusableElements = getFocusableElements(params.focusCancel);
  9252. // search for visible elements and select the next possible match
  9253. for (var _i2 = 0; _i2 < focusableElements.length; _i2++) {
  9254. index = index + increment;
  9255. // rollover to first item
  9256. if (index === focusableElements.length) {
  9257. index = 0;
  9258. // go to last item
  9259. } else if (index === -1) {
  9260. index = focusableElements.length - 1;
  9261. }
  9262. // determine if element is visible
  9263. var el = focusableElements[index];
  9264. if (isVisible(el)) {
  9265. return el.focus();
  9266. }
  9267. }
  9268. };
  9269. var handleKeyDown = function handleKeyDown(event) {
  9270. var e = event || window.event;
  9271. var keyCode = e.keyCode || e.which;
  9272. if ([9, 13, 32, 27].indexOf(keyCode) === -1) {
  9273. // Don't do work on keys we don't care about.
  9274. return;
  9275. }
  9276. var targetElement = e.target || e.srcElement;
  9277. var focusableElements = getFocusableElements(params.focusCancel);
  9278. var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
  9279. for (var _i3 = 0; _i3 < focusableElements.length; _i3++) {
  9280. if (targetElement === focusableElements[_i3]) {
  9281. btnIndex = _i3;
  9282. break;
  9283. }
  9284. }
  9285. // TAB
  9286. if (keyCode === 9) {
  9287. if (!e.shiftKey) {
  9288. // Cycle to the next button
  9289. setFocus(btnIndex, 1);
  9290. } else {
  9291. // Cycle to the prev button
  9292. setFocus(btnIndex, -1);
  9293. }
  9294. e.stopPropagation();
  9295. e.preventDefault();
  9296. // ENTER/SPACE
  9297. } else if (keyCode === 13 || keyCode === 32) {
  9298. if (btnIndex === -1 && params.allowEnterKey) {
  9299. // ENTER/SPACE clicked outside of a button.
  9300. if (params.focusCancel) {
  9301. fireClick(cancelButton, e);
  9302. } else {
  9303. fireClick(confirmButton, e);
  9304. }
  9305. }
  9306. // ESC
  9307. } else if (keyCode === 27 && params.allowEscapeKey === true) {
  9308. sweetAlert.closeModal(params.onClose);
  9309. reject('esc');
  9310. }
  9311. };
  9312. states.previousWindowKeyDown = window.onkeydown;
  9313. window.onkeydown = handleKeyDown;
  9314. // Loading state
  9315. if (params.buttonsStyling) {
  9316. confirmButton.style.borderLeftColor = params.confirmButtonColor;
  9317. confirmButton.style.borderRightColor = params.confirmButtonColor;
  9318. }
  9319. /**
  9320. * Show spinner instead of Confirm button and disable Cancel button
  9321. */
  9322. sweetAlert.showLoading = sweetAlert.enableLoading = function () {
  9323. show(getSpacer());
  9324. show(confirmButton, 'inline-block');
  9325. addClass(confirmButton, swalClasses.loading);
  9326. addClass(modal, swalClasses.loading);
  9327. confirmButton.disabled = true;
  9328. cancelButton.disabled = true;
  9329. };
  9330. /**
  9331. * Show spinner instead of Confirm button and disable Cancel button
  9332. */
  9333. sweetAlert.hideLoading = sweetAlert.disableLoading = function () {
  9334. if (!params.showConfirmButton) {
  9335. hide(confirmButton);
  9336. if (!params.showCancelButton) {
  9337. hide(getSpacer());
  9338. }
  9339. }
  9340. removeClass(confirmButton, swalClasses.loading);
  9341. removeClass(modal, swalClasses.loading);
  9342. confirmButton.disabled = false;
  9343. cancelButton.disabled = false;
  9344. };
  9345. sweetAlert.getTitle = function () {
  9346. return getTitle();
  9347. };
  9348. sweetAlert.getContent = function () {
  9349. return getContent();
  9350. };
  9351. sweetAlert.getInput = function () {
  9352. return getInput();
  9353. };
  9354. sweetAlert.getImage = function () {
  9355. return getImage();
  9356. };
  9357. sweetAlert.getConfirmButton = function () {
  9358. return getConfirmButton();
  9359. };
  9360. sweetAlert.getCancelButton = function () {
  9361. return getCancelButton();
  9362. };
  9363. sweetAlert.enableButtons = function () {
  9364. confirmButton.disabled = false;
  9365. cancelButton.disabled = false;
  9366. };
  9367. sweetAlert.disableButtons = function () {
  9368. confirmButton.disabled = true;
  9369. cancelButton.disabled = true;
  9370. };
  9371. sweetAlert.enableConfirmButton = function () {
  9372. confirmButton.disabled = false;
  9373. };
  9374. sweetAlert.disableConfirmButton = function () {
  9375. confirmButton.disabled = true;
  9376. };
  9377. sweetAlert.enableInput = function () {
  9378. var input = getInput();
  9379. if (!input) {
  9380. return false;
  9381. }
  9382. if (input.type === 'radio') {
  9383. var radiosContainer = input.parentNode.parentNode;
  9384. var radios = radiosContainer.querySelectorAll('input');
  9385. for (var _i4 = 0; _i4 < radios.length; _i4++) {
  9386. radios[_i4].disabled = false;
  9387. }
  9388. } else {
  9389. input.disabled = false;
  9390. }
  9391. };
  9392. sweetAlert.disableInput = function () {
  9393. var input = getInput();
  9394. if (!input) {
  9395. return false;
  9396. }
  9397. if (input && input.type === 'radio') {
  9398. var radiosContainer = input.parentNode.parentNode;
  9399. var radios = radiosContainer.querySelectorAll('input');
  9400. for (var _i5 = 0; _i5 < radios.length; _i5++) {
  9401. radios[_i5].disabled = true;
  9402. }
  9403. } else {
  9404. input.disabled = true;
  9405. }
  9406. };
  9407. // Set modal min-height to disable scrolling inside the modal
  9408. sweetAlert.recalculateHeight = debounce(function () {
  9409. var modal = getModal();
  9410. if (!modal) {
  9411. return;
  9412. }
  9413. var prevState = modal.style.display;
  9414. modal.style.minHeight = '';
  9415. show(modal);
  9416. modal.style.minHeight = modal.scrollHeight + 1 + 'px';
  9417. modal.style.display = prevState;
  9418. }, 50);
  9419. // Show block with validation error
  9420. sweetAlert.showValidationError = function (error) {
  9421. var validationError = getValidationError();
  9422. validationError.innerHTML = error;
  9423. show(validationError);
  9424. var input = getInput();
  9425. if (input) {
  9426. focusInput(input);
  9427. addClass(input, swalClasses.inputerror);
  9428. }
  9429. };
  9430. // Hide block with validation error
  9431. sweetAlert.resetValidationError = function () {
  9432. var validationError = getValidationError();
  9433. hide(validationError);
  9434. sweetAlert.recalculateHeight();
  9435. var input = getInput();
  9436. if (input) {
  9437. removeClass(input, swalClasses.inputerror);
  9438. }
  9439. };
  9440. sweetAlert.getProgressSteps = function () {
  9441. return params.progressSteps;
  9442. };
  9443. sweetAlert.setProgressSteps = function (progressSteps) {
  9444. params.progressSteps = progressSteps;
  9445. setParameters(params);
  9446. };
  9447. sweetAlert.showProgressSteps = function () {
  9448. show(getProgressSteps());
  9449. };
  9450. sweetAlert.hideProgressSteps = function () {
  9451. hide(getProgressSteps());
  9452. };
  9453. sweetAlert.enableButtons();
  9454. sweetAlert.hideLoading();
  9455. sweetAlert.resetValidationError();
  9456. // inputs
  9457. var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
  9458. var input = void 0;
  9459. for (var _i6 = 0; _i6 < inputTypes.length; _i6++) {
  9460. var inputClass = swalClasses[inputTypes[_i6]];
  9461. var inputContainer = getChildByClass(modal, inputClass);
  9462. input = getInput(inputTypes[_i6]);
  9463. // set attributes
  9464. if (input) {
  9465. for (var j in input.attributes) {
  9466. if (input.attributes.hasOwnProperty(j)) {
  9467. var attrName = input.attributes[j].name;
  9468. if (attrName !== 'type' && attrName !== 'value') {
  9469. input.removeAttribute(attrName);
  9470. }
  9471. }
  9472. }
  9473. for (var attr in params.inputAttributes) {
  9474. input.setAttribute(attr, params.inputAttributes[attr]);
  9475. }
  9476. }
  9477. // set class
  9478. inputContainer.className = inputClass;
  9479. if (params.inputClass) {
  9480. addClass(inputContainer, params.inputClass);
  9481. }
  9482. hide(inputContainer);
  9483. }
  9484. var populateInputOptions = void 0;
  9485. (function () {
  9486. switch (params.input) {
  9487. case 'text':
  9488. case 'email':
  9489. case 'password':
  9490. case 'number':
  9491. case 'tel':
  9492. input = getChildByClass(modal, swalClasses.input);
  9493. input.value = params.inputValue;
  9494. input.placeholder = params.inputPlaceholder;
  9495. input.type = params.input;
  9496. show(input);
  9497. break;
  9498. case 'file':
  9499. input = getChildByClass(modal, swalClasses.file);
  9500. input.placeholder = params.inputPlaceholder;
  9501. input.type = params.input;
  9502. show(input);
  9503. break;
  9504. case 'range':
  9505. var range = getChildByClass(modal, swalClasses.range);
  9506. var rangeInput = range.querySelector('input');
  9507. var rangeOutput = range.querySelector('output');
  9508. rangeInput.value = params.inputValue;
  9509. rangeInput.type = params.input;
  9510. rangeOutput.value = params.inputValue;
  9511. show(range);
  9512. break;
  9513. case 'select':
  9514. var select = getChildByClass(modal, swalClasses.select);
  9515. select.innerHTML = '';
  9516. if (params.inputPlaceholder) {
  9517. var placeholder = document.createElement('option');
  9518. placeholder.innerHTML = params.inputPlaceholder;
  9519. placeholder.value = '';
  9520. placeholder.disabled = true;
  9521. placeholder.selected = true;
  9522. select.appendChild(placeholder);
  9523. }
  9524. populateInputOptions = function populateInputOptions(inputOptions) {
  9525. for (var optionValue in inputOptions) {
  9526. var option = document.createElement('option');
  9527. option.value = optionValue;
  9528. option.innerHTML = inputOptions[optionValue];
  9529. if (params.inputValue === optionValue) {
  9530. option.selected = true;
  9531. }
  9532. select.appendChild(option);
  9533. }
  9534. show(select);
  9535. select.focus();
  9536. };
  9537. break;
  9538. case 'radio':
  9539. var radio = getChildByClass(modal, swalClasses.radio);
  9540. radio.innerHTML = '';
  9541. populateInputOptions = function populateInputOptions(inputOptions) {
  9542. for (var radioValue in inputOptions) {
  9543. var radioInput = document.createElement('input');
  9544. var radioLabel = document.createElement('label');
  9545. var radioLabelSpan = document.createElement('span');
  9546. radioInput.type = 'radio';
  9547. radioInput.name = swalClasses.radio;
  9548. radioInput.value = radioValue;
  9549. if (params.inputValue === radioValue) {
  9550. radioInput.checked = true;
  9551. }
  9552. radioLabelSpan.innerHTML = inputOptions[radioValue];
  9553. radioLabel.appendChild(radioInput);
  9554. radioLabel.appendChild(radioLabelSpan);
  9555. radioLabel.for = radioInput.id;
  9556. radio.appendChild(radioLabel);
  9557. }
  9558. show(radio);
  9559. var radios = radio.querySelectorAll('input');
  9560. if (radios.length) {
  9561. radios[0].focus();
  9562. }
  9563. };
  9564. break;
  9565. case 'checkbox':
  9566. var checkbox = getChildByClass(modal, swalClasses.checkbox);
  9567. var checkboxInput = getInput('checkbox');
  9568. checkboxInput.type = 'checkbox';
  9569. checkboxInput.value = 1;
  9570. checkboxInput.id = swalClasses.checkbox;
  9571. checkboxInput.checked = Boolean(params.inputValue);
  9572. var label = checkbox.getElementsByTagName('span');
  9573. if (label.length) {
  9574. checkbox.removeChild(label[0]);
  9575. }
  9576. label = document.createElement('span');
  9577. label.innerHTML = params.inputPlaceholder;
  9578. checkbox.appendChild(label);
  9579. show(checkbox);
  9580. break;
  9581. case 'textarea':
  9582. var textarea = getChildByClass(modal, swalClasses.textarea);
  9583. textarea.value = params.inputValue;
  9584. textarea.placeholder = params.inputPlaceholder;
  9585. show(textarea);
  9586. break;
  9587. case null:
  9588. break;
  9589. default:
  9590. console.error('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "select", "checkbox", "textarea" or "file", got "' + params.input + '"');
  9591. break;
  9592. }
  9593. })();
  9594. if (params.input === 'select' || params.input === 'radio') {
  9595. if (params.inputOptions instanceof Promise) {
  9596. sweetAlert.showLoading();
  9597. params.inputOptions.then(function (inputOptions) {
  9598. sweetAlert.hideLoading();
  9599. populateInputOptions(inputOptions);
  9600. });
  9601. } else if (_typeof(params.inputOptions) === 'object') {
  9602. populateInputOptions(params.inputOptions);
  9603. } else {
  9604. console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + _typeof(params.inputOptions));
  9605. }
  9606. }
  9607. openModal(params.animation, params.onOpen);
  9608. // Focus the first element (input or button)
  9609. if (params.allowEnterKey) {
  9610. setFocus(-1, 1);
  9611. } else {
  9612. if (document.activeElement) {
  9613. document.activeElement.blur();
  9614. }
  9615. }
  9616. // fix scroll
  9617. getContainer().scrollTop = 0;
  9618. // Observe changes inside the modal and adjust height
  9619. if (typeof MutationObserver !== 'undefined' && !swal2Observer) {
  9620. swal2Observer = new MutationObserver(sweetAlert.recalculateHeight);
  9621. swal2Observer.observe(modal, { childList: true, characterData: true, subtree: true });
  9622. }
  9623. });
  9624. };
  9625. /*
  9626. * Global function to determine if swal2 modal is shown
  9627. */
  9628. sweetAlert.isVisible = function () {
  9629. return !!getModal();
  9630. };
  9631. /*
  9632. * Global function for chaining sweetAlert modals
  9633. */
  9634. sweetAlert.queue = function (steps) {
  9635. queue = steps;
  9636. var resetQueue = function resetQueue() {
  9637. queue = [];
  9638. document.body.removeAttribute('data-swal2-queue-step');
  9639. };
  9640. var queueResult = [];
  9641. return new Promise(function (resolve, reject) {
  9642. (function step(i, callback) {
  9643. if (i < queue.length) {
  9644. document.body.setAttribute('data-swal2-queue-step', i);
  9645. sweetAlert(queue[i]).then(function (result) {
  9646. queueResult.push(result);
  9647. step(i + 1, callback);
  9648. }, function (dismiss) {
  9649. resetQueue();
  9650. reject(dismiss);
  9651. });
  9652. } else {
  9653. resetQueue();
  9654. resolve(queueResult);
  9655. }
  9656. })(0);
  9657. });
  9658. };
  9659. /*
  9660. * Global function for getting the index of current modal in queue
  9661. */
  9662. sweetAlert.getQueueStep = function () {
  9663. return document.body.getAttribute('data-swal2-queue-step');
  9664. };
  9665. /*
  9666. * Global function for inserting a modal to the queue
  9667. */
  9668. sweetAlert.insertQueueStep = function (step, index) {
  9669. if (index && index < queue.length) {
  9670. return queue.splice(index, 0, step);
  9671. }
  9672. return queue.push(step);
  9673. };
  9674. /*
  9675. * Global function for deleting a modal from the queue
  9676. */
  9677. sweetAlert.deleteQueueStep = function (index) {
  9678. if (typeof queue[index] !== 'undefined') {
  9679. queue.splice(index, 1);
  9680. }
  9681. };
  9682. /*
  9683. * Global function to close sweetAlert
  9684. */
  9685. sweetAlert.close = sweetAlert.closeModal = function (onComplete) {
  9686. var container = getContainer();
  9687. var modal = getModal();
  9688. if (!modal) {
  9689. return;
  9690. }
  9691. removeClass(modal, swalClasses.show);
  9692. addClass(modal, swalClasses.hide);
  9693. clearTimeout(modal.timeout);
  9694. resetPrevState();
  9695. var removeModalAndResetState = function removeModalAndResetState() {
  9696. container.parentNode.removeChild(container);
  9697. removeClass(document.documentElement, swalClasses.shown);
  9698. removeClass(document.body, swalClasses.shown);
  9699. undoScrollbar();
  9700. undoIOSfix();
  9701. };
  9702. // If animation is supported, animate
  9703. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  9704. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  9705. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  9706. if (hasClass(modal, swalClasses.hide)) {
  9707. removeModalAndResetState();
  9708. }
  9709. });
  9710. } else {
  9711. // Otherwise, remove immediately
  9712. removeModalAndResetState();
  9713. }
  9714. if (onComplete !== null && typeof onComplete === 'function') {
  9715. setTimeout(function () {
  9716. onComplete(modal);
  9717. });
  9718. }
  9719. };
  9720. /*
  9721. * Global function to click 'Confirm' button
  9722. */
  9723. sweetAlert.clickConfirm = function () {
  9724. return getConfirmButton().click();
  9725. };
  9726. /*
  9727. * Global function to click 'Cancel' button
  9728. */
  9729. sweetAlert.clickCancel = function () {
  9730. return getCancelButton().click();
  9731. };
  9732. /**
  9733. * Set default params for each popup
  9734. * @param {Object} userParams
  9735. */
  9736. sweetAlert.setDefaults = function (userParams) {
  9737. if (!userParams || (typeof userParams === 'undefined' ? 'undefined' : _typeof(userParams)) !== 'object') {
  9738. return console.error('SweetAlert2: the argument for setDefaults() is required and has to be a object');
  9739. }
  9740. for (var param in userParams) {
  9741. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  9742. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  9743. delete userParams[param];
  9744. }
  9745. }
  9746. _extends(modalParams, userParams);
  9747. };
  9748. /**
  9749. * Reset default params for each popup
  9750. */
  9751. sweetAlert.resetDefaults = function () {
  9752. modalParams = _extends({}, defaultParams);
  9753. };
  9754. sweetAlert.noop = function () {};
  9755. sweetAlert.version = '6.4.2';
  9756. sweetAlert.default = sweetAlert;
  9757. return sweetAlert;
  9758. })));
  9759. if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
  9760. /***/ }),
  9761. /* 3 */
  9762. /***/ (function(module, exports) {
  9763. // shim for using process in browser
  9764. var process = module.exports = {};
  9765. // cached from whatever global is present so that test runners that stub it
  9766. // don't break things. But we need to wrap it in a try catch in case it is
  9767. // wrapped in strict mode code which doesn't define any globals. It's inside a
  9768. // function because try/catches deoptimize in certain engines.
  9769. var cachedSetTimeout;
  9770. var cachedClearTimeout;
  9771. function defaultSetTimout() {
  9772. throw new Error('setTimeout has not been defined');
  9773. }
  9774. function defaultClearTimeout () {
  9775. throw new Error('clearTimeout has not been defined');
  9776. }
  9777. (function () {
  9778. try {
  9779. if (typeof setTimeout === 'function') {
  9780. cachedSetTimeout = setTimeout;
  9781. } else {
  9782. cachedSetTimeout = defaultSetTimout;
  9783. }
  9784. } catch (e) {
  9785. cachedSetTimeout = defaultSetTimout;
  9786. }
  9787. try {
  9788. if (typeof clearTimeout === 'function') {
  9789. cachedClearTimeout = clearTimeout;
  9790. } else {
  9791. cachedClearTimeout = defaultClearTimeout;
  9792. }
  9793. } catch (e) {
  9794. cachedClearTimeout = defaultClearTimeout;
  9795. }
  9796. } ())
  9797. function runTimeout(fun) {
  9798. if (cachedSetTimeout === setTimeout) {
  9799. //normal enviroments in sane situations
  9800. return setTimeout(fun, 0);
  9801. }
  9802. // if setTimeout wasn't available but was latter defined
  9803. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  9804. cachedSetTimeout = setTimeout;
  9805. return setTimeout(fun, 0);
  9806. }
  9807. try {
  9808. // when when somebody has screwed with setTimeout but no I.E. maddness
  9809. return cachedSetTimeout(fun, 0);
  9810. } catch(e){
  9811. try {
  9812. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  9813. return cachedSetTimeout.call(null, fun, 0);
  9814. } catch(e){
  9815. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  9816. return cachedSetTimeout.call(this, fun, 0);
  9817. }
  9818. }
  9819. }
  9820. function runClearTimeout(marker) {
  9821. if (cachedClearTimeout === clearTimeout) {
  9822. //normal enviroments in sane situations
  9823. return clearTimeout(marker);
  9824. }
  9825. // if clearTimeout wasn't available but was latter defined
  9826. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  9827. cachedClearTimeout = clearTimeout;
  9828. return clearTimeout(marker);
  9829. }
  9830. try {
  9831. // when when somebody has screwed with setTimeout but no I.E. maddness
  9832. return cachedClearTimeout(marker);
  9833. } catch (e){
  9834. try {
  9835. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  9836. return cachedClearTimeout.call(null, marker);
  9837. } catch (e){
  9838. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  9839. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  9840. return cachedClearTimeout.call(this, marker);
  9841. }
  9842. }
  9843. }
  9844. var queue = [];
  9845. var draining = false;
  9846. var currentQueue;
  9847. var queueIndex = -1;
  9848. function cleanUpNextTick() {
  9849. if (!draining || !currentQueue) {
  9850. return;
  9851. }
  9852. draining = false;
  9853. if (currentQueue.length) {
  9854. queue = currentQueue.concat(queue);
  9855. } else {
  9856. queueIndex = -1;
  9857. }
  9858. if (queue.length) {
  9859. drainQueue();
  9860. }
  9861. }
  9862. function drainQueue() {
  9863. if (draining) {
  9864. return;
  9865. }
  9866. var timeout = runTimeout(cleanUpNextTick);
  9867. draining = true;
  9868. var len = queue.length;
  9869. while(len) {
  9870. currentQueue = queue;
  9871. queue = [];
  9872. while (++queueIndex < len) {
  9873. if (currentQueue) {
  9874. currentQueue[queueIndex].run();
  9875. }
  9876. }
  9877. queueIndex = -1;
  9878. len = queue.length;
  9879. }
  9880. currentQueue = null;
  9881. draining = false;
  9882. runClearTimeout(timeout);
  9883. }
  9884. process.nextTick = function (fun) {
  9885. var args = new Array(arguments.length - 1);
  9886. if (arguments.length > 1) {
  9887. for (var i = 1; i < arguments.length; i++) {
  9888. args[i - 1] = arguments[i];
  9889. }
  9890. }
  9891. queue.push(new Item(fun, args));
  9892. if (queue.length === 1 && !draining) {
  9893. runTimeout(drainQueue);
  9894. }
  9895. };
  9896. // v8 likes predictible objects
  9897. function Item(fun, array) {
  9898. this.fun = fun;
  9899. this.array = array;
  9900. }
  9901. Item.prototype.run = function () {
  9902. this.fun.apply(null, this.array);
  9903. };
  9904. process.title = 'browser';
  9905. process.browser = true;
  9906. process.env = {};
  9907. process.argv = [];
  9908. process.version = ''; // empty string to avoid regexp issues
  9909. process.versions = {};
  9910. function noop() {}
  9911. process.on = noop;
  9912. process.addListener = noop;
  9913. process.once = noop;
  9914. process.off = noop;
  9915. process.removeListener = noop;
  9916. process.removeAllListeners = noop;
  9917. process.emit = noop;
  9918. process.binding = function (name) {
  9919. throw new Error('process.binding is not supported');
  9920. };
  9921. process.cwd = function () { return '/' };
  9922. process.chdir = function (dir) {
  9923. throw new Error('process.chdir is not supported');
  9924. };
  9925. process.umask = function() { return 0; };
  9926. /***/ }),
  9927. /* 4 */
  9928. /***/ (function(module, exports) {
  9929. // removed by extract-text-webpack-plugin
  9930. /***/ }),
  9931. /* 5 */
  9932. /***/ (function(module, exports) {
  9933. // removed by extract-text-webpack-plugin
  9934. /***/ }),
  9935. /* 6 */
  9936. /***/ (function(module, exports, __webpack_require__) {
  9937. var Component = __webpack_require__(0)(
  9938. /* script */
  9939. __webpack_require__(14),
  9940. /* template */
  9941. __webpack_require__(19),
  9942. /* scopeId */
  9943. null,
  9944. /* cssModules */
  9945. null
  9946. )
  9947. Component.options.__file = "G:\\Server Stats\\webSource\\server.vue"
  9948. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  9949. if (Component.options.functional) {console.error("[vue-loader] server.vue: functional components are not supported with templates, they should use render functions.")}
  9950. /* hot reload */
  9951. if (false) {(function () {
  9952. var hotAPI = require("vue-hot-reload-api")
  9953. hotAPI.install(require("vue"), false)
  9954. if (!hotAPI.compatible) return
  9955. module.hot.accept()
  9956. if (!module.hot.data) {
  9957. hotAPI.createRecord("data-v-49b001dc", Component.options)
  9958. } else {
  9959. hotAPI.reload("data-v-49b001dc", Component.options)
  9960. }
  9961. })()}
  9962. module.exports = Component.exports
  9963. /***/ }),
  9964. /* 7 */
  9965. /***/ (function(module, exports, __webpack_require__) {
  9966. var Component = __webpack_require__(0)(
  9967. /* script */
  9968. __webpack_require__(15),
  9969. /* template */
  9970. __webpack_require__(18),
  9971. /* scopeId */
  9972. null,
  9973. /* cssModules */
  9974. null
  9975. )
  9976. Component.options.__file = "G:\\Server Stats\\webSource\\serverDetails.vue"
  9977. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  9978. if (Component.options.functional) {console.error("[vue-loader] serverDetails.vue: functional components are not supported with templates, they should use render functions.")}
  9979. /* hot reload */
  9980. if (false) {(function () {
  9981. var hotAPI = require("vue-hot-reload-api")
  9982. hotAPI.install(require("vue"), false)
  9983. if (!hotAPI.compatible) return
  9984. module.hot.accept()
  9985. if (!module.hot.data) {
  9986. hotAPI.createRecord("data-v-04a2f200", Component.options)
  9987. } else {
  9988. hotAPI.reload("data-v-04a2f200", Component.options)
  9989. }
  9990. })()}
  9991. module.exports = Component.exports
  9992. /***/ }),
  9993. /* 8 */
  9994. /***/ (function(module, exports, __webpack_require__) {
  9995. /* styles */
  9996. __webpack_require__(22)
  9997. var Component = __webpack_require__(0)(
  9998. /* script */
  9999. __webpack_require__(16),
  10000. /* template */
  10001. __webpack_require__(20),
  10002. /* scopeId */
  10003. null,
  10004. /* cssModules */
  10005. null
  10006. )
  10007. Component.options.__file = "G:\\Server Stats\\webSource\\serverList.vue"
  10008. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  10009. if (Component.options.functional) {console.error("[vue-loader] serverList.vue: functional components are not supported with templates, they should use render functions.")}
  10010. /* hot reload */
  10011. if (false) {(function () {
  10012. var hotAPI = require("vue-hot-reload-api")
  10013. hotAPI.install(require("vue"), false)
  10014. if (!hotAPI.compatible) return
  10015. module.hot.accept()
  10016. if (!module.hot.data) {
  10017. hotAPI.createRecord("data-v-7440c7d0", Component.options)
  10018. } else {
  10019. hotAPI.reload("data-v-7440c7d0", Component.options)
  10020. }
  10021. })()}
  10022. module.exports = Component.exports
  10023. /***/ }),
  10024. /* 9 */
  10025. /***/ (function(module, exports, __webpack_require__) {
  10026. var Component = __webpack_require__(0)(
  10027. /* script */
  10028. __webpack_require__(17),
  10029. /* template */
  10030. __webpack_require__(21),
  10031. /* scopeId */
  10032. null,
  10033. /* cssModules */
  10034. null
  10035. )
  10036. Component.options.__file = "G:\\Server Stats\\webSource\\serveredit.vue"
  10037. if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
  10038. if (Component.options.functional) {console.error("[vue-loader] serveredit.vue: functional components are not supported with templates, they should use render functions.")}
  10039. /* hot reload */
  10040. if (false) {(function () {
  10041. var hotAPI = require("vue-hot-reload-api")
  10042. hotAPI.install(require("vue"), false)
  10043. if (!hotAPI.compatible) return
  10044. module.hot.accept()
  10045. if (!module.hot.data) {
  10046. hotAPI.createRecord("data-v-7fae8b1c", Component.options)
  10047. } else {
  10048. hotAPI.reload("data-v-7fae8b1c", Component.options)
  10049. }
  10050. })()}
  10051. module.exports = Component.exports
  10052. /***/ }),
  10053. /* 10 */
  10054. /***/ (function(module, exports, __webpack_require__) {
  10055. "use strict";
  10056. /* WEBPACK VAR INJECTION */(function(process) {/**
  10057. * vue-router v2.2.1
  10058. * (c) 2017 Evan You
  10059. * @license MIT
  10060. */
  10061. /* */
  10062. function assert (condition, message) {
  10063. if (!condition) {
  10064. throw new Error(("[vue-router] " + message))
  10065. }
  10066. }
  10067. function warn (condition, message) {
  10068. if (!condition) {
  10069. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  10070. }
  10071. }
  10072. var View = {
  10073. name: 'router-view',
  10074. functional: true,
  10075. props: {
  10076. name: {
  10077. type: String,
  10078. default: 'default'
  10079. }
  10080. },
  10081. render: function render (h, ref) {
  10082. var props = ref.props;
  10083. var children = ref.children;
  10084. var parent = ref.parent;
  10085. var data = ref.data;
  10086. data.routerView = true;
  10087. var name = props.name;
  10088. var route = parent.$route;
  10089. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  10090. // determine current view depth, also check to see if the tree
  10091. // has been toggled inactive but kept-alive.
  10092. var depth = 0;
  10093. var inactive = false;
  10094. while (parent) {
  10095. if (parent.$vnode && parent.$vnode.data.routerView) {
  10096. depth++;
  10097. }
  10098. if (parent._inactive) {
  10099. inactive = true;
  10100. }
  10101. parent = parent.$parent;
  10102. }
  10103. data.routerViewDepth = depth;
  10104. // render previous view if the tree is inactive and kept-alive
  10105. if (inactive) {
  10106. return h(cache[name], data, children)
  10107. }
  10108. var matched = route.matched[depth];
  10109. // render empty node if no matched route
  10110. if (!matched) {
  10111. cache[name] = null;
  10112. return h()
  10113. }
  10114. var component = cache[name] = matched.components[name];
  10115. // inject instance registration hooks
  10116. var hooks = data.hook || (data.hook = {});
  10117. hooks.init = function (vnode) {
  10118. matched.instances[name] = vnode.child;
  10119. };
  10120. hooks.prepatch = function (oldVnode, vnode) {
  10121. matched.instances[name] = vnode.child;
  10122. };
  10123. hooks.destroy = function (vnode) {
  10124. if (matched.instances[name] === vnode.child) {
  10125. matched.instances[name] = undefined;
  10126. }
  10127. };
  10128. // resolve props
  10129. data.props = resolveProps(route, matched.props && matched.props[name]);
  10130. return h(component, data, children)
  10131. }
  10132. };
  10133. function resolveProps (route, config) {
  10134. switch (typeof config) {
  10135. case 'undefined':
  10136. return
  10137. case 'object':
  10138. return config
  10139. case 'function':
  10140. return config(route)
  10141. case 'boolean':
  10142. return config ? route.params : undefined
  10143. default:
  10144. warn(false, ("props in \"" + (route.path) + "\" is a " + (typeof config) + ", expecting an object, function or boolean."));
  10145. }
  10146. }
  10147. /* */
  10148. var encodeReserveRE = /[!'()*]/g;
  10149. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  10150. var commaRE = /%2C/g;
  10151. // fixed encodeURIComponent which is more comformant to RFC3986:
  10152. // - escapes [!'()*]
  10153. // - preserve commas
  10154. var encode = function (str) { return encodeURIComponent(str)
  10155. .replace(encodeReserveRE, encodeReserveReplacer)
  10156. .replace(commaRE, ','); };
  10157. var decode = decodeURIComponent;
  10158. function resolveQuery (
  10159. query,
  10160. extraQuery
  10161. ) {
  10162. if ( extraQuery === void 0 ) extraQuery = {};
  10163. if (query) {
  10164. var parsedQuery;
  10165. try {
  10166. parsedQuery = parseQuery(query);
  10167. } catch (e) {
  10168. process.env.NODE_ENV !== 'production' && warn(false, e.message);
  10169. parsedQuery = {};
  10170. }
  10171. for (var key in extraQuery) {
  10172. parsedQuery[key] = extraQuery[key];
  10173. }
  10174. return parsedQuery
  10175. } else {
  10176. return extraQuery
  10177. }
  10178. }
  10179. function parseQuery (query) {
  10180. var res = {};
  10181. query = query.trim().replace(/^(\?|#|&)/, '');
  10182. if (!query) {
  10183. return res
  10184. }
  10185. query.split('&').forEach(function (param) {
  10186. var parts = param.replace(/\+/g, ' ').split('=');
  10187. var key = decode(parts.shift());
  10188. var val = parts.length > 0
  10189. ? decode(parts.join('='))
  10190. : null;
  10191. if (res[key] === undefined) {
  10192. res[key] = val;
  10193. } else if (Array.isArray(res[key])) {
  10194. res[key].push(val);
  10195. } else {
  10196. res[key] = [res[key], val];
  10197. }
  10198. });
  10199. return res
  10200. }
  10201. function stringifyQuery (obj) {
  10202. var res = obj ? Object.keys(obj).map(function (key) {
  10203. var val = obj[key];
  10204. if (val === undefined) {
  10205. return ''
  10206. }
  10207. if (val === null) {
  10208. return encode(key)
  10209. }
  10210. if (Array.isArray(val)) {
  10211. var result = [];
  10212. val.slice().forEach(function (val2) {
  10213. if (val2 === undefined) {
  10214. return
  10215. }
  10216. if (val2 === null) {
  10217. result.push(encode(key));
  10218. } else {
  10219. result.push(encode(key) + '=' + encode(val2));
  10220. }
  10221. });
  10222. return result.join('&')
  10223. }
  10224. return encode(key) + '=' + encode(val)
  10225. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  10226. return res ? ("?" + res) : ''
  10227. }
  10228. /* */
  10229. var trailingSlashRE = /\/?$/;
  10230. function createRoute (
  10231. record,
  10232. location,
  10233. redirectedFrom
  10234. ) {
  10235. var route = {
  10236. name: location.name || (record && record.name),
  10237. meta: (record && record.meta) || {},
  10238. path: location.path || '/',
  10239. hash: location.hash || '',
  10240. query: location.query || {},
  10241. params: location.params || {},
  10242. fullPath: getFullPath(location),
  10243. matched: record ? formatMatch(record) : []
  10244. };
  10245. if (redirectedFrom) {
  10246. route.redirectedFrom = getFullPath(redirectedFrom);
  10247. }
  10248. return Object.freeze(route)
  10249. }
  10250. // the starting route that represents the initial state
  10251. var START = createRoute(null, {
  10252. path: '/'
  10253. });
  10254. function formatMatch (record) {
  10255. var res = [];
  10256. while (record) {
  10257. res.unshift(record);
  10258. record = record.parent;
  10259. }
  10260. return res
  10261. }
  10262. function getFullPath (ref) {
  10263. var path = ref.path;
  10264. var query = ref.query; if ( query === void 0 ) query = {};
  10265. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  10266. return (path || '/') + stringifyQuery(query) + hash
  10267. }
  10268. function isSameRoute (a, b) {
  10269. if (b === START) {
  10270. return a === b
  10271. } else if (!b) {
  10272. return false
  10273. } else if (a.path && b.path) {
  10274. return (
  10275. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  10276. a.hash === b.hash &&
  10277. isObjectEqual(a.query, b.query)
  10278. )
  10279. } else if (a.name && b.name) {
  10280. return (
  10281. a.name === b.name &&
  10282. a.hash === b.hash &&
  10283. isObjectEqual(a.query, b.query) &&
  10284. isObjectEqual(a.params, b.params)
  10285. )
  10286. } else {
  10287. return false
  10288. }
  10289. }
  10290. function isObjectEqual (a, b) {
  10291. if ( a === void 0 ) a = {};
  10292. if ( b === void 0 ) b = {};
  10293. var aKeys = Object.keys(a);
  10294. var bKeys = Object.keys(b);
  10295. if (aKeys.length !== bKeys.length) {
  10296. return false
  10297. }
  10298. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  10299. }
  10300. function isIncludedRoute (current, target) {
  10301. return (
  10302. current.path.replace(trailingSlashRE, '/').indexOf(
  10303. target.path.replace(trailingSlashRE, '/')
  10304. ) === 0 &&
  10305. (!target.hash || current.hash === target.hash) &&
  10306. queryIncludes(current.query, target.query)
  10307. )
  10308. }
  10309. function queryIncludes (current, target) {
  10310. for (var key in target) {
  10311. if (!(key in current)) {
  10312. return false
  10313. }
  10314. }
  10315. return true
  10316. }
  10317. /* */
  10318. // work around weird flow bug
  10319. var toTypes = [String, Object];
  10320. var eventTypes = [String, Array];
  10321. var Link = {
  10322. name: 'router-link',
  10323. props: {
  10324. to: {
  10325. type: toTypes,
  10326. required: true
  10327. },
  10328. tag: {
  10329. type: String,
  10330. default: 'a'
  10331. },
  10332. exact: Boolean,
  10333. append: Boolean,
  10334. replace: Boolean,
  10335. activeClass: String,
  10336. event: {
  10337. type: eventTypes,
  10338. default: 'click'
  10339. }
  10340. },
  10341. render: function render (h) {
  10342. var this$1 = this;
  10343. var router = this.$router;
  10344. var current = this.$route;
  10345. var ref = router.resolve(this.to, current, this.append);
  10346. var location = ref.location;
  10347. var route = ref.route;
  10348. var href = ref.href;
  10349. var classes = {};
  10350. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active';
  10351. var compareTarget = location.path ? createRoute(null, location) : route;
  10352. classes[activeClass] = this.exact
  10353. ? isSameRoute(current, compareTarget)
  10354. : isIncludedRoute(current, compareTarget);
  10355. var handler = function (e) {
  10356. if (guardEvent(e)) {
  10357. if (this$1.replace) {
  10358. router.replace(location);
  10359. } else {
  10360. router.push(location);
  10361. }
  10362. }
  10363. };
  10364. var on = { click: guardEvent };
  10365. if (Array.isArray(this.event)) {
  10366. this.event.forEach(function (e) { on[e] = handler; });
  10367. } else {
  10368. on[this.event] = handler;
  10369. }
  10370. var data = {
  10371. class: classes
  10372. };
  10373. if (this.tag === 'a') {
  10374. data.on = on;
  10375. data.attrs = { href: href };
  10376. } else {
  10377. // find the first <a> child and apply listener and href
  10378. var a = findAnchor(this.$slots.default);
  10379. if (a) {
  10380. // in case the <a> is a static node
  10381. a.isStatic = false;
  10382. var extend = _Vue.util.extend;
  10383. var aData = a.data = extend({}, a.data);
  10384. aData.on = on;
  10385. var aAttrs = a.data.attrs = extend({}, a.data.attrs);
  10386. aAttrs.href = href;
  10387. } else {
  10388. // doesn't have <a> child, apply listener to self
  10389. data.on = on;
  10390. }
  10391. }
  10392. return h(this.tag, data, this.$slots.default)
  10393. }
  10394. };
  10395. function guardEvent (e) {
  10396. // don't redirect with control keys
  10397. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  10398. // don't redirect when preventDefault called
  10399. if (e.defaultPrevented) { return }
  10400. // don't redirect on right click
  10401. if (e.button !== undefined && e.button !== 0) { return }
  10402. // don't redirect if `target="_blank"`
  10403. if (e.target && e.target.getAttribute) {
  10404. var target = e.target.getAttribute('target');
  10405. if (/\b_blank\b/i.test(target)) { return }
  10406. }
  10407. // this may be a Weex event which doesn't have this method
  10408. if (e.preventDefault) {
  10409. e.preventDefault();
  10410. }
  10411. return true
  10412. }
  10413. function findAnchor (children) {
  10414. if (children) {
  10415. var child;
  10416. for (var i = 0; i < children.length; i++) {
  10417. child = children[i];
  10418. if (child.tag === 'a') {
  10419. return child
  10420. }
  10421. if (child.children && (child = findAnchor(child.children))) {
  10422. return child
  10423. }
  10424. }
  10425. }
  10426. }
  10427. var _Vue;
  10428. function install (Vue) {
  10429. if (install.installed) { return }
  10430. install.installed = true;
  10431. _Vue = Vue;
  10432. Object.defineProperty(Vue.prototype, '$router', {
  10433. get: function get () { return this.$root._router }
  10434. });
  10435. Object.defineProperty(Vue.prototype, '$route', {
  10436. get: function get () { return this.$root._route }
  10437. });
  10438. Vue.mixin({
  10439. beforeCreate: function beforeCreate () {
  10440. if (this.$options.router) {
  10441. this._router = this.$options.router;
  10442. this._router.init(this);
  10443. Vue.util.defineReactive(this, '_route', this._router.history.current);
  10444. }
  10445. }
  10446. });
  10447. Vue.component('router-view', View);
  10448. Vue.component('router-link', Link);
  10449. var strats = Vue.config.optionMergeStrategies;
  10450. // use the same hook merging strategy for route hooks
  10451. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created;
  10452. }
  10453. /* */
  10454. var inBrowser = typeof window !== 'undefined';
  10455. /* */
  10456. function resolvePath (
  10457. relative,
  10458. base,
  10459. append
  10460. ) {
  10461. if (relative.charAt(0) === '/') {
  10462. return relative
  10463. }
  10464. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  10465. return base + relative
  10466. }
  10467. var stack = base.split('/');
  10468. // remove trailing segment if:
  10469. // - not appending
  10470. // - appending to trailing slash (last segment is empty)
  10471. if (!append || !stack[stack.length - 1]) {
  10472. stack.pop();
  10473. }
  10474. // resolve relative path
  10475. var segments = relative.replace(/^\//, '').split('/');
  10476. for (var i = 0; i < segments.length; i++) {
  10477. var segment = segments[i];
  10478. if (segment === '.') {
  10479. continue
  10480. } else if (segment === '..') {
  10481. stack.pop();
  10482. } else {
  10483. stack.push(segment);
  10484. }
  10485. }
  10486. // ensure leading slash
  10487. if (stack[0] !== '') {
  10488. stack.unshift('');
  10489. }
  10490. return stack.join('/')
  10491. }
  10492. function parsePath (path) {
  10493. var hash = '';
  10494. var query = '';
  10495. var hashIndex = path.indexOf('#');
  10496. if (hashIndex >= 0) {
  10497. hash = path.slice(hashIndex);
  10498. path = path.slice(0, hashIndex);
  10499. }
  10500. var queryIndex = path.indexOf('?');
  10501. if (queryIndex >= 0) {
  10502. query = path.slice(queryIndex + 1);
  10503. path = path.slice(0, queryIndex);
  10504. }
  10505. return {
  10506. path: path,
  10507. query: query,
  10508. hash: hash
  10509. }
  10510. }
  10511. function cleanPath (path) {
  10512. return path.replace(/\/\//g, '/')
  10513. }
  10514. /* */
  10515. function createRouteMap (
  10516. routes,
  10517. oldPathMap,
  10518. oldNameMap
  10519. ) {
  10520. var pathMap = oldPathMap || Object.create(null);
  10521. var nameMap = oldNameMap || Object.create(null);
  10522. routes.forEach(function (route) {
  10523. addRouteRecord(pathMap, nameMap, route);
  10524. });
  10525. return {
  10526. pathMap: pathMap,
  10527. nameMap: nameMap
  10528. }
  10529. }
  10530. function addRouteRecord (
  10531. pathMap,
  10532. nameMap,
  10533. route,
  10534. parent,
  10535. matchAs
  10536. ) {
  10537. var path = route.path;
  10538. var name = route.name;
  10539. if (process.env.NODE_ENV !== 'production') {
  10540. assert(path != null, "\"path\" is required in a route configuration.");
  10541. assert(
  10542. typeof route.component !== 'string',
  10543. "route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
  10544. "string id. Use an actual component instead."
  10545. );
  10546. }
  10547. var record = {
  10548. path: normalizePath(path, parent),
  10549. components: route.components || { default: route.component },
  10550. instances: {},
  10551. name: name,
  10552. parent: parent,
  10553. matchAs: matchAs,
  10554. redirect: route.redirect,
  10555. beforeEnter: route.beforeEnter,
  10556. meta: route.meta || {},
  10557. props: route.props == null
  10558. ? {}
  10559. : route.components
  10560. ? route.props
  10561. : { default: route.props }
  10562. };
  10563. if (route.children) {
  10564. // Warn if route is named and has a default child route.
  10565. // If users navigate to this route by name, the default child will
  10566. // not be rendered (GH Issue #629)
  10567. if (process.env.NODE_ENV !== 'production') {
  10568. if (route.name && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
  10569. warn(
  10570. false,
  10571. "Named Route '" + (route.name) + "' has a default child route. " +
  10572. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  10573. "the default child route will not be rendered. Remove the name from " +
  10574. "this route and use the name of the default child route for named " +
  10575. "links instead."
  10576. );
  10577. }
  10578. }
  10579. route.children.forEach(function (child) {
  10580. var childMatchAs = matchAs
  10581. ? cleanPath((matchAs + "/" + (child.path)))
  10582. : undefined;
  10583. addRouteRecord(pathMap, nameMap, child, record, childMatchAs);
  10584. });
  10585. }
  10586. if (route.alias !== undefined) {
  10587. if (Array.isArray(route.alias)) {
  10588. route.alias.forEach(function (alias) {
  10589. var aliasRoute = {
  10590. path: alias,
  10591. children: route.children
  10592. };
  10593. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  10594. });
  10595. } else {
  10596. var aliasRoute = {
  10597. path: route.alias,
  10598. children: route.children
  10599. };
  10600. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  10601. }
  10602. }
  10603. if (!pathMap[record.path]) {
  10604. pathMap[record.path] = record;
  10605. }
  10606. if (name) {
  10607. if (!nameMap[name]) {
  10608. nameMap[name] = record;
  10609. } else if (process.env.NODE_ENV !== 'production' && !matchAs) {
  10610. warn(
  10611. false,
  10612. "Duplicate named routes definition: " +
  10613. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  10614. );
  10615. }
  10616. }
  10617. }
  10618. function normalizePath (path, parent) {
  10619. path = path.replace(/\/$/, '');
  10620. if (path[0] === '/') { return path }
  10621. if (parent == null) { return path }
  10622. return cleanPath(((parent.path) + "/" + path))
  10623. }
  10624. var index$1 = Array.isArray || function (arr) {
  10625. return Object.prototype.toString.call(arr) == '[object Array]';
  10626. };
  10627. var isarray = index$1;
  10628. /**
  10629. * Expose `pathToRegexp`.
  10630. */
  10631. var index = pathToRegexp;
  10632. var parse_1 = parse;
  10633. var compile_1 = compile;
  10634. var tokensToFunction_1 = tokensToFunction;
  10635. var tokensToRegExp_1 = tokensToRegExp;
  10636. /**
  10637. * The main path matching regexp utility.
  10638. *
  10639. * @type {RegExp}
  10640. */
  10641. var PATH_REGEXP = new RegExp([
  10642. // Match escaped characters that would otherwise appear in future matches.
  10643. // This allows the user to escape special characters that won't transform.
  10644. '(\\\\.)',
  10645. // Match Express-style parameters and un-named parameters with a prefix
  10646. // and optional suffixes. Matches appear as:
  10647. //
  10648. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  10649. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  10650. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  10651. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  10652. ].join('|'), 'g');
  10653. /**
  10654. * Parse a string for the raw tokens.
  10655. *
  10656. * @param {string} str
  10657. * @param {Object=} options
  10658. * @return {!Array}
  10659. */
  10660. function parse (str, options) {
  10661. var tokens = [];
  10662. var key = 0;
  10663. var index = 0;
  10664. var path = '';
  10665. var defaultDelimiter = options && options.delimiter || '/';
  10666. var res;
  10667. while ((res = PATH_REGEXP.exec(str)) != null) {
  10668. var m = res[0];
  10669. var escaped = res[1];
  10670. var offset = res.index;
  10671. path += str.slice(index, offset);
  10672. index = offset + m.length;
  10673. // Ignore already escaped sequences.
  10674. if (escaped) {
  10675. path += escaped[1];
  10676. continue
  10677. }
  10678. var next = str[index];
  10679. var prefix = res[2];
  10680. var name = res[3];
  10681. var capture = res[4];
  10682. var group = res[5];
  10683. var modifier = res[6];
  10684. var asterisk = res[7];
  10685. // Push the current path onto the tokens.
  10686. if (path) {
  10687. tokens.push(path);
  10688. path = '';
  10689. }
  10690. var partial = prefix != null && next != null && next !== prefix;
  10691. var repeat = modifier === '+' || modifier === '*';
  10692. var optional = modifier === '?' || modifier === '*';
  10693. var delimiter = res[2] || defaultDelimiter;
  10694. var pattern = capture || group;
  10695. tokens.push({
  10696. name: name || key++,
  10697. prefix: prefix || '',
  10698. delimiter: delimiter,
  10699. optional: optional,
  10700. repeat: repeat,
  10701. partial: partial,
  10702. asterisk: !!asterisk,
  10703. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  10704. });
  10705. }
  10706. // Match any characters still remaining.
  10707. if (index < str.length) {
  10708. path += str.substr(index);
  10709. }
  10710. // If the path exists, push it onto the end.
  10711. if (path) {
  10712. tokens.push(path);
  10713. }
  10714. return tokens
  10715. }
  10716. /**
  10717. * Compile a string to a template function for the path.
  10718. *
  10719. * @param {string} str
  10720. * @param {Object=} options
  10721. * @return {!function(Object=, Object=)}
  10722. */
  10723. function compile (str, options) {
  10724. return tokensToFunction(parse(str, options))
  10725. }
  10726. /**
  10727. * Prettier encoding of URI path segments.
  10728. *
  10729. * @param {string}
  10730. * @return {string}
  10731. */
  10732. function encodeURIComponentPretty (str) {
  10733. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  10734. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  10735. })
  10736. }
  10737. /**
  10738. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  10739. *
  10740. * @param {string}
  10741. * @return {string}
  10742. */
  10743. function encodeAsterisk (str) {
  10744. return encodeURI(str).replace(/[?#]/g, function (c) {
  10745. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  10746. })
  10747. }
  10748. /**
  10749. * Expose a method for transforming tokens into the path function.
  10750. */
  10751. function tokensToFunction (tokens) {
  10752. // Compile all the tokens into regexps.
  10753. var matches = new Array(tokens.length);
  10754. // Compile all the patterns before compilation.
  10755. for (var i = 0; i < tokens.length; i++) {
  10756. if (typeof tokens[i] === 'object') {
  10757. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  10758. }
  10759. }
  10760. return function (obj, opts) {
  10761. var path = '';
  10762. var data = obj || {};
  10763. var options = opts || {};
  10764. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  10765. for (var i = 0; i < tokens.length; i++) {
  10766. var token = tokens[i];
  10767. if (typeof token === 'string') {
  10768. path += token;
  10769. continue
  10770. }
  10771. var value = data[token.name];
  10772. var segment;
  10773. if (value == null) {
  10774. if (token.optional) {
  10775. // Prepend partial segment prefixes.
  10776. if (token.partial) {
  10777. path += token.prefix;
  10778. }
  10779. continue
  10780. } else {
  10781. throw new TypeError('Expected "' + token.name + '" to be defined')
  10782. }
  10783. }
  10784. if (isarray(value)) {
  10785. if (!token.repeat) {
  10786. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  10787. }
  10788. if (value.length === 0) {
  10789. if (token.optional) {
  10790. continue
  10791. } else {
  10792. throw new TypeError('Expected "' + token.name + '" to not be empty')
  10793. }
  10794. }
  10795. for (var j = 0; j < value.length; j++) {
  10796. segment = encode(value[j]);
  10797. if (!matches[i].test(segment)) {
  10798. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  10799. }
  10800. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  10801. }
  10802. continue
  10803. }
  10804. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  10805. if (!matches[i].test(segment)) {
  10806. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  10807. }
  10808. path += token.prefix + segment;
  10809. }
  10810. return path
  10811. }
  10812. }
  10813. /**
  10814. * Escape a regular expression string.
  10815. *
  10816. * @param {string} str
  10817. * @return {string}
  10818. */
  10819. function escapeString (str) {
  10820. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  10821. }
  10822. /**
  10823. * Escape the capturing group by escaping special characters and meaning.
  10824. *
  10825. * @param {string} group
  10826. * @return {string}
  10827. */
  10828. function escapeGroup (group) {
  10829. return group.replace(/([=!:$\/()])/g, '\\$1')
  10830. }
  10831. /**
  10832. * Attach the keys as a property of the regexp.
  10833. *
  10834. * @param {!RegExp} re
  10835. * @param {Array} keys
  10836. * @return {!RegExp}
  10837. */
  10838. function attachKeys (re, keys) {
  10839. re.keys = keys;
  10840. return re
  10841. }
  10842. /**
  10843. * Get the flags for a regexp from the options.
  10844. *
  10845. * @param {Object} options
  10846. * @return {string}
  10847. */
  10848. function flags (options) {
  10849. return options.sensitive ? '' : 'i'
  10850. }
  10851. /**
  10852. * Pull out keys from a regexp.
  10853. *
  10854. * @param {!RegExp} path
  10855. * @param {!Array} keys
  10856. * @return {!RegExp}
  10857. */
  10858. function regexpToRegexp (path, keys) {
  10859. // Use a negative lookahead to match only capturing groups.
  10860. var groups = path.source.match(/\((?!\?)/g);
  10861. if (groups) {
  10862. for (var i = 0; i < groups.length; i++) {
  10863. keys.push({
  10864. name: i,
  10865. prefix: null,
  10866. delimiter: null,
  10867. optional: false,
  10868. repeat: false,
  10869. partial: false,
  10870. asterisk: false,
  10871. pattern: null
  10872. });
  10873. }
  10874. }
  10875. return attachKeys(path, keys)
  10876. }
  10877. /**
  10878. * Transform an array into a regexp.
  10879. *
  10880. * @param {!Array} path
  10881. * @param {Array} keys
  10882. * @param {!Object} options
  10883. * @return {!RegExp}
  10884. */
  10885. function arrayToRegexp (path, keys, options) {
  10886. var parts = [];
  10887. for (var i = 0; i < path.length; i++) {
  10888. parts.push(pathToRegexp(path[i], keys, options).source);
  10889. }
  10890. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  10891. return attachKeys(regexp, keys)
  10892. }
  10893. /**
  10894. * Create a path regexp from string input.
  10895. *
  10896. * @param {string} path
  10897. * @param {!Array} keys
  10898. * @param {!Object} options
  10899. * @return {!RegExp}
  10900. */
  10901. function stringToRegexp (path, keys, options) {
  10902. return tokensToRegExp(parse(path, options), keys, options)
  10903. }
  10904. /**
  10905. * Expose a function for taking tokens and returning a RegExp.
  10906. *
  10907. * @param {!Array} tokens
  10908. * @param {(Array|Object)=} keys
  10909. * @param {Object=} options
  10910. * @return {!RegExp}
  10911. */
  10912. function tokensToRegExp (tokens, keys, options) {
  10913. if (!isarray(keys)) {
  10914. options = /** @type {!Object} */ (keys || options);
  10915. keys = [];
  10916. }
  10917. options = options || {};
  10918. var strict = options.strict;
  10919. var end = options.end !== false;
  10920. var route = '';
  10921. // Iterate over the tokens and create our regexp string.
  10922. for (var i = 0; i < tokens.length; i++) {
  10923. var token = tokens[i];
  10924. if (typeof token === 'string') {
  10925. route += escapeString(token);
  10926. } else {
  10927. var prefix = escapeString(token.prefix);
  10928. var capture = '(?:' + token.pattern + ')';
  10929. keys.push(token);
  10930. if (token.repeat) {
  10931. capture += '(?:' + prefix + capture + ')*';
  10932. }
  10933. if (token.optional) {
  10934. if (!token.partial) {
  10935. capture = '(?:' + prefix + '(' + capture + '))?';
  10936. } else {
  10937. capture = prefix + '(' + capture + ')?';
  10938. }
  10939. } else {
  10940. capture = prefix + '(' + capture + ')';
  10941. }
  10942. route += capture;
  10943. }
  10944. }
  10945. var delimiter = escapeString(options.delimiter || '/');
  10946. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  10947. // In non-strict mode we allow a slash at the end of match. If the path to
  10948. // match already ends with a slash, we remove it for consistency. The slash
  10949. // is valid at the end of a path match, not in the middle. This is important
  10950. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  10951. if (!strict) {
  10952. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  10953. }
  10954. if (end) {
  10955. route += '$';
  10956. } else {
  10957. // In non-ending mode, we need the capturing groups to match as much as
  10958. // possible by using a positive lookahead to the end or next path segment.
  10959. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  10960. }
  10961. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  10962. }
  10963. /**
  10964. * Normalize the given path string, returning a regular expression.
  10965. *
  10966. * An empty array can be passed in for the keys, which will hold the
  10967. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  10968. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  10969. *
  10970. * @param {(string|RegExp|Array)} path
  10971. * @param {(Array|Object)=} keys
  10972. * @param {Object=} options
  10973. * @return {!RegExp}
  10974. */
  10975. function pathToRegexp (path, keys, options) {
  10976. if (!isarray(keys)) {
  10977. options = /** @type {!Object} */ (keys || options);
  10978. keys = [];
  10979. }
  10980. options = options || {};
  10981. if (path instanceof RegExp) {
  10982. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  10983. }
  10984. if (isarray(path)) {
  10985. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  10986. }
  10987. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  10988. }
  10989. index.parse = parse_1;
  10990. index.compile = compile_1;
  10991. index.tokensToFunction = tokensToFunction_1;
  10992. index.tokensToRegExp = tokensToRegExp_1;
  10993. /* */
  10994. var regexpCache = Object.create(null);
  10995. function getRouteRegex (path) {
  10996. var hit = regexpCache[path];
  10997. var keys, regexp;
  10998. if (hit) {
  10999. keys = hit.keys;
  11000. regexp = hit.regexp;
  11001. } else {
  11002. keys = [];
  11003. regexp = index(path, keys);
  11004. regexpCache[path] = { keys: keys, regexp: regexp };
  11005. }
  11006. return { keys: keys, regexp: regexp }
  11007. }
  11008. var regexpCompileCache = Object.create(null);
  11009. function fillParams (
  11010. path,
  11011. params,
  11012. routeMsg
  11013. ) {
  11014. try {
  11015. var filler =
  11016. regexpCompileCache[path] ||
  11017. (regexpCompileCache[path] = index.compile(path));
  11018. return filler(params || {}, { pretty: true })
  11019. } catch (e) {
  11020. if (process.env.NODE_ENV !== 'production') {
  11021. warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
  11022. }
  11023. return ''
  11024. }
  11025. }
  11026. /* */
  11027. function normalizeLocation (
  11028. raw,
  11029. current,
  11030. append
  11031. ) {
  11032. var next = typeof raw === 'string' ? { path: raw } : raw;
  11033. // named target
  11034. if (next.name || next._normalized) {
  11035. return next
  11036. }
  11037. // relative params
  11038. if (!next.path && next.params && current) {
  11039. next = assign({}, next);
  11040. next._normalized = true;
  11041. var params = assign(assign({}, current.params), next.params);
  11042. if (current.name) {
  11043. next.name = current.name;
  11044. next.params = params;
  11045. } else if (current.matched) {
  11046. var rawPath = current.matched[current.matched.length - 1].path;
  11047. next.path = fillParams(rawPath, params, ("path " + (current.path)));
  11048. } else if (process.env.NODE_ENV !== 'production') {
  11049. warn(false, "relative params navigation requires a current route.");
  11050. }
  11051. return next
  11052. }
  11053. var parsedPath = parsePath(next.path || '');
  11054. var basePath = (current && current.path) || '/';
  11055. var path = parsedPath.path
  11056. ? resolvePath(parsedPath.path, basePath, append || next.append)
  11057. : (current && current.path) || '/';
  11058. var query = resolveQuery(parsedPath.query, next.query);
  11059. var hash = next.hash || parsedPath.hash;
  11060. if (hash && hash.charAt(0) !== '#') {
  11061. hash = "#" + hash;
  11062. }
  11063. return {
  11064. _normalized: true,
  11065. path: path,
  11066. query: query,
  11067. hash: hash
  11068. }
  11069. }
  11070. function assign (a, b) {
  11071. for (var key in b) {
  11072. a[key] = b[key];
  11073. }
  11074. return a
  11075. }
  11076. /* */
  11077. function createMatcher (routes) {
  11078. var ref = createRouteMap(routes);
  11079. var pathMap = ref.pathMap;
  11080. var nameMap = ref.nameMap;
  11081. function addRoutes (routes) {
  11082. createRouteMap(routes, pathMap, nameMap);
  11083. }
  11084. function match (
  11085. raw,
  11086. currentRoute,
  11087. redirectedFrom
  11088. ) {
  11089. var location = normalizeLocation(raw, currentRoute);
  11090. var name = location.name;
  11091. if (name) {
  11092. var record = nameMap[name];
  11093. if (process.env.NODE_ENV !== 'production') {
  11094. warn(record, ("Route with name '" + name + "' does not exist"));
  11095. }
  11096. var paramNames = getRouteRegex(record.path).keys
  11097. .filter(function (key) { return !key.optional; })
  11098. .map(function (key) { return key.name; });
  11099. if (typeof location.params !== 'object') {
  11100. location.params = {};
  11101. }
  11102. if (currentRoute && typeof currentRoute.params === 'object') {
  11103. for (var key in currentRoute.params) {
  11104. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  11105. location.params[key] = currentRoute.params[key];
  11106. }
  11107. }
  11108. }
  11109. if (record) {
  11110. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  11111. return _createRoute(record, location, redirectedFrom)
  11112. }
  11113. } else if (location.path) {
  11114. location.params = {};
  11115. for (var path in pathMap) {
  11116. if (matchRoute(path, location.params, location.path)) {
  11117. return _createRoute(pathMap[path], location, redirectedFrom)
  11118. }
  11119. }
  11120. }
  11121. // no match
  11122. return _createRoute(null, location)
  11123. }
  11124. function redirect (
  11125. record,
  11126. location
  11127. ) {
  11128. var originalRedirect = record.redirect;
  11129. var redirect = typeof originalRedirect === 'function'
  11130. ? originalRedirect(createRoute(record, location))
  11131. : originalRedirect;
  11132. if (typeof redirect === 'string') {
  11133. redirect = { path: redirect };
  11134. }
  11135. if (!redirect || typeof redirect !== 'object') {
  11136. process.env.NODE_ENV !== 'production' && warn(
  11137. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  11138. );
  11139. return _createRoute(null, location)
  11140. }
  11141. var re = redirect;
  11142. var name = re.name;
  11143. var path = re.path;
  11144. var query = location.query;
  11145. var hash = location.hash;
  11146. var params = location.params;
  11147. query = re.hasOwnProperty('query') ? re.query : query;
  11148. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  11149. params = re.hasOwnProperty('params') ? re.params : params;
  11150. if (name) {
  11151. // resolved named direct
  11152. var targetRecord = nameMap[name];
  11153. if (process.env.NODE_ENV !== 'production') {
  11154. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  11155. }
  11156. return match({
  11157. _normalized: true,
  11158. name: name,
  11159. query: query,
  11160. hash: hash,
  11161. params: params
  11162. }, undefined, location)
  11163. } else if (path) {
  11164. // 1. resolve relative redirect
  11165. var rawPath = resolveRecordPath(path, record);
  11166. // 2. resolve params
  11167. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  11168. // 3. rematch with existing query and hash
  11169. return match({
  11170. _normalized: true,
  11171. path: resolvedPath,
  11172. query: query,
  11173. hash: hash
  11174. }, undefined, location)
  11175. } else {
  11176. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  11177. return _createRoute(null, location)
  11178. }
  11179. }
  11180. function alias (
  11181. record,
  11182. location,
  11183. matchAs
  11184. ) {
  11185. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  11186. var aliasedMatch = match({
  11187. _normalized: true,
  11188. path: aliasedPath
  11189. });
  11190. if (aliasedMatch) {
  11191. var matched = aliasedMatch.matched;
  11192. var aliasedRecord = matched[matched.length - 1];
  11193. location.params = aliasedMatch.params;
  11194. return _createRoute(aliasedRecord, location)
  11195. }
  11196. return _createRoute(null, location)
  11197. }
  11198. function _createRoute (
  11199. record,
  11200. location,
  11201. redirectedFrom
  11202. ) {
  11203. if (record && record.redirect) {
  11204. return redirect(record, redirectedFrom || location)
  11205. }
  11206. if (record && record.matchAs) {
  11207. return alias(record, location, record.matchAs)
  11208. }
  11209. return createRoute(record, location, redirectedFrom)
  11210. }
  11211. return {
  11212. match: match,
  11213. addRoutes: addRoutes
  11214. }
  11215. }
  11216. function matchRoute (
  11217. path,
  11218. params,
  11219. pathname
  11220. ) {
  11221. var ref = getRouteRegex(path);
  11222. var regexp = ref.regexp;
  11223. var keys = ref.keys;
  11224. var m = pathname.match(regexp);
  11225. if (!m) {
  11226. return false
  11227. } else if (!params) {
  11228. return true
  11229. }
  11230. for (var i = 1, len = m.length; i < len; ++i) {
  11231. var key = keys[i - 1];
  11232. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  11233. if (key) { params[key.name] = val; }
  11234. }
  11235. return true
  11236. }
  11237. function resolveRecordPath (path, record) {
  11238. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  11239. }
  11240. /* */
  11241. var positionStore = Object.create(null);
  11242. function setupScroll () {
  11243. window.addEventListener('popstate', function (e) {
  11244. saveScrollPosition();
  11245. if (e.state && e.state.key) {
  11246. setStateKey(e.state.key);
  11247. }
  11248. });
  11249. }
  11250. function handleScroll (
  11251. router,
  11252. to,
  11253. from,
  11254. isPop
  11255. ) {
  11256. if (!router.app) {
  11257. return
  11258. }
  11259. var behavior = router.options.scrollBehavior;
  11260. if (!behavior) {
  11261. return
  11262. }
  11263. if (process.env.NODE_ENV !== 'production') {
  11264. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  11265. }
  11266. // wait until re-render finishes before scrolling
  11267. router.app.$nextTick(function () {
  11268. var position = getScrollPosition();
  11269. var shouldScroll = behavior(to, from, isPop ? position : null);
  11270. if (!shouldScroll) {
  11271. return
  11272. }
  11273. var isObject = typeof shouldScroll === 'object';
  11274. if (isObject && typeof shouldScroll.selector === 'string') {
  11275. var el = document.querySelector(shouldScroll.selector);
  11276. if (el) {
  11277. position = getElementPosition(el);
  11278. } else if (isValidPosition(shouldScroll)) {
  11279. position = normalizePosition(shouldScroll);
  11280. }
  11281. } else if (isObject && isValidPosition(shouldScroll)) {
  11282. position = normalizePosition(shouldScroll);
  11283. }
  11284. if (position) {
  11285. window.scrollTo(position.x, position.y);
  11286. }
  11287. });
  11288. }
  11289. function saveScrollPosition () {
  11290. var key = getStateKey();
  11291. if (key) {
  11292. positionStore[key] = {
  11293. x: window.pageXOffset,
  11294. y: window.pageYOffset
  11295. };
  11296. }
  11297. }
  11298. function getScrollPosition () {
  11299. var key = getStateKey();
  11300. if (key) {
  11301. return positionStore[key]
  11302. }
  11303. }
  11304. function getElementPosition (el) {
  11305. var docRect = document.documentElement.getBoundingClientRect();
  11306. var elRect = el.getBoundingClientRect();
  11307. return {
  11308. x: elRect.left - docRect.left,
  11309. y: elRect.top - docRect.top
  11310. }
  11311. }
  11312. function isValidPosition (obj) {
  11313. return isNumber(obj.x) || isNumber(obj.y)
  11314. }
  11315. function normalizePosition (obj) {
  11316. return {
  11317. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  11318. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  11319. }
  11320. }
  11321. function isNumber (v) {
  11322. return typeof v === 'number'
  11323. }
  11324. /* */
  11325. var supportsPushState = inBrowser && (function () {
  11326. var ua = window.navigator.userAgent;
  11327. if (
  11328. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  11329. ua.indexOf('Mobile Safari') !== -1 &&
  11330. ua.indexOf('Chrome') === -1 &&
  11331. ua.indexOf('Windows Phone') === -1
  11332. ) {
  11333. return false
  11334. }
  11335. return window.history && 'pushState' in window.history
  11336. })();
  11337. // use User Timing api (if present) for more accurate key precision
  11338. var Time = inBrowser && window.performance && window.performance.now
  11339. ? window.performance
  11340. : Date;
  11341. var _key = genKey();
  11342. function genKey () {
  11343. return Time.now().toFixed(3)
  11344. }
  11345. function getStateKey () {
  11346. return _key
  11347. }
  11348. function setStateKey (key) {
  11349. _key = key;
  11350. }
  11351. function pushState (url, replace) {
  11352. saveScrollPosition();
  11353. // try...catch the pushState call to get around Safari
  11354. // DOM Exception 18 where it limits to 100 pushState calls
  11355. var history = window.history;
  11356. try {
  11357. if (replace) {
  11358. history.replaceState({ key: _key }, '', url);
  11359. } else {
  11360. _key = genKey();
  11361. history.pushState({ key: _key }, '', url);
  11362. }
  11363. } catch (e) {
  11364. window.location[replace ? 'replace' : 'assign'](url);
  11365. }
  11366. }
  11367. function replaceState (url) {
  11368. pushState(url, true);
  11369. }
  11370. /* */
  11371. function runQueue (queue, fn, cb) {
  11372. var step = function (index) {
  11373. if (index >= queue.length) {
  11374. cb();
  11375. } else {
  11376. if (queue[index]) {
  11377. fn(queue[index], function () {
  11378. step(index + 1);
  11379. });
  11380. } else {
  11381. step(index + 1);
  11382. }
  11383. }
  11384. };
  11385. step(0);
  11386. }
  11387. /* */
  11388. var History = function History (router, base) {
  11389. this.router = router;
  11390. this.base = normalizeBase(base);
  11391. // start with a route object that stands for "nowhere"
  11392. this.current = START;
  11393. this.pending = null;
  11394. this.ready = false;
  11395. this.readyCbs = [];
  11396. };
  11397. History.prototype.listen = function listen (cb) {
  11398. this.cb = cb;
  11399. };
  11400. History.prototype.onReady = function onReady (cb) {
  11401. if (this.ready) {
  11402. cb();
  11403. } else {
  11404. this.readyCbs.push(cb);
  11405. }
  11406. };
  11407. History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {
  11408. var this$1 = this;
  11409. var route = this.router.match(location, this.current);
  11410. this.confirmTransition(route, function () {
  11411. this$1.updateRoute(route);
  11412. onComplete && onComplete(route);
  11413. this$1.ensureURL();
  11414. // fire ready cbs once
  11415. if (!this$1.ready) {
  11416. this$1.ready = true;
  11417. this$1.readyCbs.forEach(function (cb) {
  11418. cb(route);
  11419. });
  11420. }
  11421. }, onAbort);
  11422. };
  11423. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  11424. var this$1 = this;
  11425. var current = this.current;
  11426. var abort = function () { onAbort && onAbort(); };
  11427. if (
  11428. isSameRoute(route, current) &&
  11429. // in the case the route map has been dynamically appended to
  11430. route.matched.length === current.matched.length
  11431. ) {
  11432. this.ensureURL();
  11433. return abort()
  11434. }
  11435. var ref = resolveQueue(this.current.matched, route.matched);
  11436. var updated = ref.updated;
  11437. var deactivated = ref.deactivated;
  11438. var activated = ref.activated;
  11439. var queue = [].concat(
  11440. // in-component leave guards
  11441. extractLeaveGuards(deactivated),
  11442. // global before hooks
  11443. this.router.beforeHooks,
  11444. // in-component update hooks
  11445. extractUpdateHooks(updated),
  11446. // in-config enter guards
  11447. activated.map(function (m) { return m.beforeEnter; }),
  11448. // async components
  11449. resolveAsyncComponents(activated)
  11450. );
  11451. this.pending = route;
  11452. var iterator = function (hook, next) {
  11453. if (this$1.pending !== route) {
  11454. return abort()
  11455. }
  11456. hook(route, current, function (to) {
  11457. if (to === false) {
  11458. // next(false) -> abort navigation, ensure current URL
  11459. this$1.ensureURL(true);
  11460. abort();
  11461. } else if (typeof to === 'string' || typeof to === 'object') {
  11462. // next('/') or next({ path: '/' }) -> redirect
  11463. (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to);
  11464. abort();
  11465. } else {
  11466. // confirm transition and pass on the value
  11467. next(to);
  11468. }
  11469. });
  11470. };
  11471. runQueue(queue, iterator, function () {
  11472. var postEnterCbs = [];
  11473. var isValid = function () { return this$1.current === route; };
  11474. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  11475. // wait until async components are resolved before
  11476. // extracting in-component enter guards
  11477. runQueue(enterGuards, iterator, function () {
  11478. if (this$1.pending !== route) {
  11479. return abort()
  11480. }
  11481. this$1.pending = null;
  11482. onComplete(route);
  11483. if (this$1.router.app) {
  11484. this$1.router.app.$nextTick(function () {
  11485. postEnterCbs.forEach(function (cb) { return cb(); });
  11486. });
  11487. }
  11488. });
  11489. });
  11490. };
  11491. History.prototype.updateRoute = function updateRoute (route) {
  11492. var prev = this.current;
  11493. this.current = route;
  11494. this.cb && this.cb(route);
  11495. this.router.afterHooks.forEach(function (hook) {
  11496. hook && hook(route, prev);
  11497. });
  11498. };
  11499. function normalizeBase (base) {
  11500. if (!base) {
  11501. if (inBrowser) {
  11502. // respect <base> tag
  11503. var baseEl = document.querySelector('base');
  11504. base = baseEl ? baseEl.getAttribute('href') : '/';
  11505. } else {
  11506. base = '/';
  11507. }
  11508. }
  11509. // make sure there's the starting slash
  11510. if (base.charAt(0) !== '/') {
  11511. base = '/' + base;
  11512. }
  11513. // remove trailing slash
  11514. return base.replace(/\/$/, '')
  11515. }
  11516. function resolveQueue (
  11517. current,
  11518. next
  11519. ) {
  11520. var i;
  11521. var max = Math.max(current.length, next.length);
  11522. for (i = 0; i < max; i++) {
  11523. if (current[i] !== next[i]) {
  11524. break
  11525. }
  11526. }
  11527. return {
  11528. updated: next.slice(0, i),
  11529. activated: next.slice(i),
  11530. deactivated: current.slice(i)
  11531. }
  11532. }
  11533. function extractGuards (
  11534. records,
  11535. name,
  11536. bind,
  11537. reverse
  11538. ) {
  11539. var guards = flatMapComponents(records, function (def, instance, match, key) {
  11540. var guard = extractGuard(def, name);
  11541. if (guard) {
  11542. return Array.isArray(guard)
  11543. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  11544. : bind(guard, instance, match, key)
  11545. }
  11546. });
  11547. return flatten(reverse ? guards.reverse() : guards)
  11548. }
  11549. function extractGuard (
  11550. def,
  11551. key
  11552. ) {
  11553. if (typeof def !== 'function') {
  11554. // extend now so that global mixins are applied.
  11555. def = _Vue.extend(def);
  11556. }
  11557. return def.options[key]
  11558. }
  11559. function extractLeaveGuards (deactivated) {
  11560. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  11561. }
  11562. function extractUpdateHooks (updated) {
  11563. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  11564. }
  11565. function bindGuard (guard, instance) {
  11566. return function boundRouteGuard () {
  11567. return guard.apply(instance, arguments)
  11568. }
  11569. }
  11570. function extractEnterGuards (
  11571. activated,
  11572. cbs,
  11573. isValid
  11574. ) {
  11575. return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {
  11576. return bindEnterGuard(guard, match, key, cbs, isValid)
  11577. })
  11578. }
  11579. function bindEnterGuard (
  11580. guard,
  11581. match,
  11582. key,
  11583. cbs,
  11584. isValid
  11585. ) {
  11586. return function routeEnterGuard (to, from, next) {
  11587. return guard(to, from, function (cb) {
  11588. next(cb);
  11589. if (typeof cb === 'function') {
  11590. cbs.push(function () {
  11591. // #750
  11592. // if a router-view is wrapped with an out-in transition,
  11593. // the instance may not have been registered at this time.
  11594. // we will need to poll for registration until current route
  11595. // is no longer valid.
  11596. poll(cb, match.instances, key, isValid);
  11597. });
  11598. }
  11599. })
  11600. }
  11601. }
  11602. function poll (
  11603. cb, // somehow flow cannot infer this is a function
  11604. instances,
  11605. key,
  11606. isValid
  11607. ) {
  11608. if (instances[key]) {
  11609. cb(instances[key]);
  11610. } else if (isValid()) {
  11611. setTimeout(function () {
  11612. poll(cb, instances, key, isValid);
  11613. }, 16);
  11614. }
  11615. }
  11616. function resolveAsyncComponents (matched) {
  11617. return flatMapComponents(matched, function (def, _, match, key) {
  11618. // if it's a function and doesn't have Vue options attached,
  11619. // assume it's an async component resolve function.
  11620. // we are not using Vue's default async resolving mechanism because
  11621. // we want to halt the navigation until the incoming component has been
  11622. // resolved.
  11623. if (typeof def === 'function' && !def.options) {
  11624. return function (to, from, next) {
  11625. var resolve = once(function (resolvedDef) {
  11626. match.components[key] = resolvedDef;
  11627. next();
  11628. });
  11629. var reject = once(function (reason) {
  11630. warn(false, ("Failed to resolve async component " + key + ": " + reason));
  11631. next(false);
  11632. });
  11633. var res = def(resolve, reject);
  11634. if (res && typeof res.then === 'function') {
  11635. res.then(resolve, reject);
  11636. }
  11637. }
  11638. }
  11639. })
  11640. }
  11641. function flatMapComponents (
  11642. matched,
  11643. fn
  11644. ) {
  11645. return flatten(matched.map(function (m) {
  11646. return Object.keys(m.components).map(function (key) { return fn(
  11647. m.components[key],
  11648. m.instances[key],
  11649. m, key
  11650. ); })
  11651. }))
  11652. }
  11653. function flatten (arr) {
  11654. return Array.prototype.concat.apply([], arr)
  11655. }
  11656. // in Webpack 2, require.ensure now also returns a Promise
  11657. // so the resolve/reject functions may get called an extra time
  11658. // if the user uses an arrow function shorthand that happens to
  11659. // return that Promise.
  11660. function once (fn) {
  11661. var called = false;
  11662. return function () {
  11663. if (called) { return }
  11664. called = true;
  11665. return fn.apply(this, arguments)
  11666. }
  11667. }
  11668. /* */
  11669. var HTML5History = (function (History$$1) {
  11670. function HTML5History (router, base) {
  11671. var this$1 = this;
  11672. History$$1.call(this, router, base);
  11673. var expectScroll = router.options.scrollBehavior;
  11674. if (expectScroll) {
  11675. setupScroll();
  11676. }
  11677. window.addEventListener('popstate', function (e) {
  11678. this$1.transitionTo(getLocation(this$1.base), function (route) {
  11679. if (expectScroll) {
  11680. handleScroll(router, route, this$1.current, true);
  11681. }
  11682. });
  11683. });
  11684. }
  11685. if ( History$$1 ) HTML5History.__proto__ = History$$1;
  11686. HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
  11687. HTML5History.prototype.constructor = HTML5History;
  11688. HTML5History.prototype.go = function go (n) {
  11689. window.history.go(n);
  11690. };
  11691. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  11692. var this$1 = this;
  11693. this.transitionTo(location, function (route) {
  11694. pushState(cleanPath(this$1.base + route.fullPath));
  11695. handleScroll(this$1.router, route, this$1.current, false);
  11696. onComplete && onComplete(route);
  11697. }, onAbort);
  11698. };
  11699. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  11700. var this$1 = this;
  11701. this.transitionTo(location, function (route) {
  11702. replaceState(cleanPath(this$1.base + route.fullPath));
  11703. handleScroll(this$1.router, route, this$1.current, false);
  11704. onComplete && onComplete(route);
  11705. }, onAbort);
  11706. };
  11707. HTML5History.prototype.ensureURL = function ensureURL (push) {
  11708. if (getLocation(this.base) !== this.current.fullPath) {
  11709. var current = cleanPath(this.base + this.current.fullPath);
  11710. push ? pushState(current) : replaceState(current);
  11711. }
  11712. };
  11713. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  11714. return getLocation(this.base)
  11715. };
  11716. return HTML5History;
  11717. }(History));
  11718. function getLocation (base) {
  11719. var path = window.location.pathname;
  11720. if (base && path.indexOf(base) === 0) {
  11721. path = path.slice(base.length);
  11722. }
  11723. return (path || '/') + window.location.search + window.location.hash
  11724. }
  11725. /* */
  11726. var HashHistory = (function (History$$1) {
  11727. function HashHistory (router, base, fallback) {
  11728. History$$1.call(this, router, base);
  11729. // check history fallback deeplinking
  11730. if (fallback && checkFallback(this.base)) {
  11731. return
  11732. }
  11733. ensureSlash();
  11734. }
  11735. if ( History$$1 ) HashHistory.__proto__ = History$$1;
  11736. HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  11737. HashHistory.prototype.constructor = HashHistory;
  11738. // this is delayed until the app mounts
  11739. // to avoid the hashchange listener being fired too early
  11740. HashHistory.prototype.setupListeners = function setupListeners () {
  11741. var this$1 = this;
  11742. window.addEventListener('hashchange', function () {
  11743. if (!ensureSlash()) {
  11744. return
  11745. }
  11746. this$1.transitionTo(getHash(), function (route) {
  11747. replaceHash(route.fullPath);
  11748. });
  11749. });
  11750. };
  11751. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  11752. this.transitionTo(location, function (route) {
  11753. pushHash(route.fullPath);
  11754. onComplete && onComplete(route);
  11755. }, onAbort);
  11756. };
  11757. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  11758. this.transitionTo(location, function (route) {
  11759. replaceHash(route.fullPath);
  11760. onComplete && onComplete(route);
  11761. }, onAbort);
  11762. };
  11763. HashHistory.prototype.go = function go (n) {
  11764. window.history.go(n);
  11765. };
  11766. HashHistory.prototype.ensureURL = function ensureURL (push) {
  11767. var current = this.current.fullPath;
  11768. if (getHash() !== current) {
  11769. push ? pushHash(current) : replaceHash(current);
  11770. }
  11771. };
  11772. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  11773. return getHash()
  11774. };
  11775. return HashHistory;
  11776. }(History));
  11777. function checkFallback (base) {
  11778. var location = getLocation(base);
  11779. if (!/^\/#/.test(location)) {
  11780. window.location.replace(
  11781. cleanPath(base + '/#' + location)
  11782. );
  11783. return true
  11784. }
  11785. }
  11786. function ensureSlash () {
  11787. var path = getHash();
  11788. if (path.charAt(0) === '/') {
  11789. return true
  11790. }
  11791. replaceHash('/' + path);
  11792. return false
  11793. }
  11794. function getHash () {
  11795. // We can't use window.location.hash here because it's not
  11796. // consistent across browsers - Firefox will pre-decode it!
  11797. var href = window.location.href;
  11798. var index = href.indexOf('#');
  11799. return index === -1 ? '' : href.slice(index + 1)
  11800. }
  11801. function pushHash (path) {
  11802. window.location.hash = path;
  11803. }
  11804. function replaceHash (path) {
  11805. var i = window.location.href.indexOf('#');
  11806. window.location.replace(
  11807. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  11808. );
  11809. }
  11810. /* */
  11811. var AbstractHistory = (function (History$$1) {
  11812. function AbstractHistory (router, base) {
  11813. History$$1.call(this, router, base);
  11814. this.stack = [];
  11815. this.index = -1;
  11816. }
  11817. if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
  11818. AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  11819. AbstractHistory.prototype.constructor = AbstractHistory;
  11820. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  11821. var this$1 = this;
  11822. this.transitionTo(location, function (route) {
  11823. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  11824. this$1.index++;
  11825. onComplete && onComplete(route);
  11826. }, onAbort);
  11827. };
  11828. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  11829. var this$1 = this;
  11830. this.transitionTo(location, function (route) {
  11831. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  11832. onComplete && onComplete(route);
  11833. }, onAbort);
  11834. };
  11835. AbstractHistory.prototype.go = function go (n) {
  11836. var this$1 = this;
  11837. var targetIndex = this.index + n;
  11838. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  11839. return
  11840. }
  11841. var route = this.stack[targetIndex];
  11842. this.confirmTransition(route, function () {
  11843. this$1.index = targetIndex;
  11844. this$1.updateRoute(route);
  11845. });
  11846. };
  11847. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  11848. var current = this.stack[this.stack.length - 1];
  11849. return current ? current.fullPath : '/'
  11850. };
  11851. AbstractHistory.prototype.ensureURL = function ensureURL () {
  11852. // noop
  11853. };
  11854. return AbstractHistory;
  11855. }(History));
  11856. /* */
  11857. var VueRouter = function VueRouter (options) {
  11858. if ( options === void 0 ) options = {};
  11859. this.app = null;
  11860. this.apps = [];
  11861. this.options = options;
  11862. this.beforeHooks = [];
  11863. this.afterHooks = [];
  11864. this.matcher = createMatcher(options.routes || []);
  11865. var mode = options.mode || 'hash';
  11866. this.fallback = mode === 'history' && !supportsPushState;
  11867. if (this.fallback) {
  11868. mode = 'hash';
  11869. }
  11870. if (!inBrowser) {
  11871. mode = 'abstract';
  11872. }
  11873. this.mode = mode;
  11874. switch (mode) {
  11875. case 'history':
  11876. this.history = new HTML5History(this, options.base);
  11877. break
  11878. case 'hash':
  11879. this.history = new HashHistory(this, options.base, this.fallback);
  11880. break
  11881. case 'abstract':
  11882. this.history = new AbstractHistory(this, options.base);
  11883. break
  11884. default:
  11885. if (process.env.NODE_ENV !== 'production') {
  11886. assert(false, ("invalid mode: " + mode));
  11887. }
  11888. }
  11889. };
  11890. var prototypeAccessors = { currentRoute: {} };
  11891. VueRouter.prototype.match = function match (
  11892. raw,
  11893. current,
  11894. redirectedFrom
  11895. ) {
  11896. return this.matcher.match(raw, current, redirectedFrom)
  11897. };
  11898. prototypeAccessors.currentRoute.get = function () {
  11899. return this.history && this.history.current
  11900. };
  11901. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  11902. var this$1 = this;
  11903. process.env.NODE_ENV !== 'production' && assert(
  11904. install.installed,
  11905. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  11906. "before creating root instance."
  11907. );
  11908. this.apps.push(app);
  11909. // main app already initialized.
  11910. if (this.app) {
  11911. return
  11912. }
  11913. this.app = app;
  11914. var history = this.history;
  11915. if (history instanceof HTML5History) {
  11916. history.transitionTo(history.getCurrentLocation());
  11917. } else if (history instanceof HashHistory) {
  11918. var setupHashListener = function () {
  11919. history.setupListeners();
  11920. };
  11921. history.transitionTo(
  11922. history.getCurrentLocation(),
  11923. setupHashListener,
  11924. setupHashListener
  11925. );
  11926. }
  11927. history.listen(function (route) {
  11928. this$1.apps.forEach(function (app) {
  11929. app._route = route;
  11930. });
  11931. });
  11932. };
  11933. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  11934. this.beforeHooks.push(fn);
  11935. };
  11936. VueRouter.prototype.afterEach = function afterEach (fn) {
  11937. this.afterHooks.push(fn);
  11938. };
  11939. VueRouter.prototype.onReady = function onReady (cb) {
  11940. this.history.onReady(cb);
  11941. };
  11942. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  11943. this.history.push(location, onComplete, onAbort);
  11944. };
  11945. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  11946. this.history.replace(location, onComplete, onAbort);
  11947. };
  11948. VueRouter.prototype.go = function go (n) {
  11949. this.history.go(n);
  11950. };
  11951. VueRouter.prototype.back = function back () {
  11952. this.go(-1);
  11953. };
  11954. VueRouter.prototype.forward = function forward () {
  11955. this.go(1);
  11956. };
  11957. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  11958. var route = to
  11959. ? this.resolve(to).route
  11960. : this.currentRoute;
  11961. if (!route) {
  11962. return []
  11963. }
  11964. return [].concat.apply([], route.matched.map(function (m) {
  11965. return Object.keys(m.components).map(function (key) {
  11966. return m.components[key]
  11967. })
  11968. }))
  11969. };
  11970. VueRouter.prototype.resolve = function resolve (
  11971. to,
  11972. current,
  11973. append
  11974. ) {
  11975. var location = normalizeLocation(to, current || this.history.current, append);
  11976. var route = this.match(location, current);
  11977. var fullPath = route.redirectedFrom || route.fullPath;
  11978. var base = this.history.base;
  11979. var href = createHref(base, fullPath, this.mode);
  11980. return {
  11981. location: location,
  11982. route: route,
  11983. href: href,
  11984. // for backwards compat
  11985. normalizedTo: location,
  11986. resolved: route
  11987. }
  11988. };
  11989. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  11990. this.matcher.addRoutes(routes);
  11991. if (this.history.current !== START) {
  11992. this.history.transitionTo(this.history.getCurrentLocation());
  11993. }
  11994. };
  11995. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  11996. function createHref (base, fullPath, mode) {
  11997. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  11998. return base ? cleanPath(base + '/' + path) : path
  11999. }
  12000. VueRouter.install = install;
  12001. VueRouter.version = '2.2.1';
  12002. if (inBrowser && window.Vue) {
  12003. window.Vue.use(VueRouter);
  12004. }
  12005. module.exports = VueRouter;
  12006. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  12007. /***/ }),
  12008. /* 11 */
  12009. /***/ (function(module, exports, __webpack_require__) {
  12010. "use strict";
  12011. /* WEBPACK VAR INJECTION */(function(process, global) {/*!
  12012. * Vue.js v2.1.10
  12013. * (c) 2014-2017 Evan You
  12014. * Released under the MIT License.
  12015. */
  12016. /* */
  12017. /**
  12018. * Convert a value to a string that is actually rendered.
  12019. */
  12020. function _toString (val) {
  12021. return val == null
  12022. ? ''
  12023. : typeof val === 'object'
  12024. ? JSON.stringify(val, null, 2)
  12025. : String(val)
  12026. }
  12027. /**
  12028. * Convert a input value to a number for persistence.
  12029. * If the conversion fails, return original string.
  12030. */
  12031. function toNumber (val) {
  12032. var n = parseFloat(val);
  12033. return isNaN(n) ? val : n
  12034. }
  12035. /**
  12036. * Make a map and return a function for checking if a key
  12037. * is in that map.
  12038. */
  12039. function makeMap (
  12040. str,
  12041. expectsLowerCase
  12042. ) {
  12043. var map = Object.create(null);
  12044. var list = str.split(',');
  12045. for (var i = 0; i < list.length; i++) {
  12046. map[list[i]] = true;
  12047. }
  12048. return expectsLowerCase
  12049. ? function (val) { return map[val.toLowerCase()]; }
  12050. : function (val) { return map[val]; }
  12051. }
  12052. /**
  12053. * Check if a tag is a built-in tag.
  12054. */
  12055. var isBuiltInTag = makeMap('slot,component', true);
  12056. /**
  12057. * Remove an item from an array
  12058. */
  12059. function remove$1 (arr, item) {
  12060. if (arr.length) {
  12061. var index = arr.indexOf(item);
  12062. if (index > -1) {
  12063. return arr.splice(index, 1)
  12064. }
  12065. }
  12066. }
  12067. /**
  12068. * Check whether the object has the property.
  12069. */
  12070. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12071. function hasOwn (obj, key) {
  12072. return hasOwnProperty.call(obj, key)
  12073. }
  12074. /**
  12075. * Check if value is primitive
  12076. */
  12077. function isPrimitive (value) {
  12078. return typeof value === 'string' || typeof value === 'number'
  12079. }
  12080. /**
  12081. * Create a cached version of a pure function.
  12082. */
  12083. function cached (fn) {
  12084. var cache = Object.create(null);
  12085. return (function cachedFn (str) {
  12086. var hit = cache[str];
  12087. return hit || (cache[str] = fn(str))
  12088. })
  12089. }
  12090. /**
  12091. * Camelize a hyphen-delimited string.
  12092. */
  12093. var camelizeRE = /-(\w)/g;
  12094. var camelize = cached(function (str) {
  12095. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  12096. });
  12097. /**
  12098. * Capitalize a string.
  12099. */
  12100. var capitalize = cached(function (str) {
  12101. return str.charAt(0).toUpperCase() + str.slice(1)
  12102. });
  12103. /**
  12104. * Hyphenate a camelCase string.
  12105. */
  12106. var hyphenateRE = /([^-])([A-Z])/g;
  12107. var hyphenate = cached(function (str) {
  12108. return str
  12109. .replace(hyphenateRE, '$1-$2')
  12110. .replace(hyphenateRE, '$1-$2')
  12111. .toLowerCase()
  12112. });
  12113. /**
  12114. * Simple bind, faster than native
  12115. */
  12116. function bind$1 (fn, ctx) {
  12117. function boundFn (a) {
  12118. var l = arguments.length;
  12119. return l
  12120. ? l > 1
  12121. ? fn.apply(ctx, arguments)
  12122. : fn.call(ctx, a)
  12123. : fn.call(ctx)
  12124. }
  12125. // record original fn length
  12126. boundFn._length = fn.length;
  12127. return boundFn
  12128. }
  12129. /**
  12130. * Convert an Array-like object to a real Array.
  12131. */
  12132. function toArray (list, start) {
  12133. start = start || 0;
  12134. var i = list.length - start;
  12135. var ret = new Array(i);
  12136. while (i--) {
  12137. ret[i] = list[i + start];
  12138. }
  12139. return ret
  12140. }
  12141. /**
  12142. * Mix properties into target object.
  12143. */
  12144. function extend (to, _from) {
  12145. for (var key in _from) {
  12146. to[key] = _from[key];
  12147. }
  12148. return to
  12149. }
  12150. /**
  12151. * Quick object check - this is primarily used to tell
  12152. * Objects from primitive values when we know the value
  12153. * is a JSON-compliant type.
  12154. */
  12155. function isObject (obj) {
  12156. return obj !== null && typeof obj === 'object'
  12157. }
  12158. /**
  12159. * Strict object type check. Only returns true
  12160. * for plain JavaScript objects.
  12161. */
  12162. var toString = Object.prototype.toString;
  12163. var OBJECT_STRING = '[object Object]';
  12164. function isPlainObject (obj) {
  12165. return toString.call(obj) === OBJECT_STRING
  12166. }
  12167. /**
  12168. * Merge an Array of Objects into a single Object.
  12169. */
  12170. function toObject (arr) {
  12171. var res = {};
  12172. for (var i = 0; i < arr.length; i++) {
  12173. if (arr[i]) {
  12174. extend(res, arr[i]);
  12175. }
  12176. }
  12177. return res
  12178. }
  12179. /**
  12180. * Perform no operation.
  12181. */
  12182. function noop () {}
  12183. /**
  12184. * Always return false.
  12185. */
  12186. var no = function () { return false; };
  12187. /**
  12188. * Return same value
  12189. */
  12190. var identity = function (_) { return _; };
  12191. /**
  12192. * Generate a static keys string from compiler modules.
  12193. */
  12194. function genStaticKeys (modules) {
  12195. return modules.reduce(function (keys, m) {
  12196. return keys.concat(m.staticKeys || [])
  12197. }, []).join(',')
  12198. }
  12199. /**
  12200. * Check if two values are loosely equal - that is,
  12201. * if they are plain objects, do they have the same shape?
  12202. */
  12203. function looseEqual (a, b) {
  12204. var isObjectA = isObject(a);
  12205. var isObjectB = isObject(b);
  12206. if (isObjectA && isObjectB) {
  12207. return JSON.stringify(a) === JSON.stringify(b)
  12208. } else if (!isObjectA && !isObjectB) {
  12209. return String(a) === String(b)
  12210. } else {
  12211. return false
  12212. }
  12213. }
  12214. function looseIndexOf (arr, val) {
  12215. for (var i = 0; i < arr.length; i++) {
  12216. if (looseEqual(arr[i], val)) { return i }
  12217. }
  12218. return -1
  12219. }
  12220. /* */
  12221. var config = {
  12222. /**
  12223. * Option merge strategies (used in core/util/options)
  12224. */
  12225. optionMergeStrategies: Object.create(null),
  12226. /**
  12227. * Whether to suppress warnings.
  12228. */
  12229. silent: false,
  12230. /**
  12231. * Whether to enable devtools
  12232. */
  12233. devtools: process.env.NODE_ENV !== 'production',
  12234. /**
  12235. * Error handler for watcher errors
  12236. */
  12237. errorHandler: null,
  12238. /**
  12239. * Ignore certain custom elements
  12240. */
  12241. ignoredElements: [],
  12242. /**
  12243. * Custom user key aliases for v-on
  12244. */
  12245. keyCodes: Object.create(null),
  12246. /**
  12247. * Check if a tag is reserved so that it cannot be registered as a
  12248. * component. This is platform-dependent and may be overwritten.
  12249. */
  12250. isReservedTag: no,
  12251. /**
  12252. * Check if a tag is an unknown element.
  12253. * Platform-dependent.
  12254. */
  12255. isUnknownElement: no,
  12256. /**
  12257. * Get the namespace of an element
  12258. */
  12259. getTagNamespace: noop,
  12260. /**
  12261. * Parse the real tag name for the specific platform.
  12262. */
  12263. parsePlatformTagName: identity,
  12264. /**
  12265. * Check if an attribute must be bound using property, e.g. value
  12266. * Platform-dependent.
  12267. */
  12268. mustUseProp: no,
  12269. /**
  12270. * List of asset types that a component can own.
  12271. */
  12272. _assetTypes: [
  12273. 'component',
  12274. 'directive',
  12275. 'filter'
  12276. ],
  12277. /**
  12278. * List of lifecycle hooks.
  12279. */
  12280. _lifecycleHooks: [
  12281. 'beforeCreate',
  12282. 'created',
  12283. 'beforeMount',
  12284. 'mounted',
  12285. 'beforeUpdate',
  12286. 'updated',
  12287. 'beforeDestroy',
  12288. 'destroyed',
  12289. 'activated',
  12290. 'deactivated'
  12291. ],
  12292. /**
  12293. * Max circular updates allowed in a scheduler flush cycle.
  12294. */
  12295. _maxUpdateCount: 100
  12296. };
  12297. /* */
  12298. /**
  12299. * Check if a string starts with $ or _
  12300. */
  12301. function isReserved (str) {
  12302. var c = (str + '').charCodeAt(0);
  12303. return c === 0x24 || c === 0x5F
  12304. }
  12305. /**
  12306. * Define a property.
  12307. */
  12308. function def (obj, key, val, enumerable) {
  12309. Object.defineProperty(obj, key, {
  12310. value: val,
  12311. enumerable: !!enumerable,
  12312. writable: true,
  12313. configurable: true
  12314. });
  12315. }
  12316. /**
  12317. * Parse simple path.
  12318. */
  12319. var bailRE = /[^\w.$]/;
  12320. function parsePath (path) {
  12321. if (bailRE.test(path)) {
  12322. return
  12323. } else {
  12324. var segments = path.split('.');
  12325. return function (obj) {
  12326. for (var i = 0; i < segments.length; i++) {
  12327. if (!obj) { return }
  12328. obj = obj[segments[i]];
  12329. }
  12330. return obj
  12331. }
  12332. }
  12333. }
  12334. /* */
  12335. /* globals MutationObserver */
  12336. // can we use __proto__?
  12337. var hasProto = '__proto__' in {};
  12338. // Browser environment sniffing
  12339. var inBrowser = typeof window !== 'undefined';
  12340. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  12341. var isIE = UA && /msie|trident/.test(UA);
  12342. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12343. var isEdge = UA && UA.indexOf('edge/') > 0;
  12344. var isAndroid = UA && UA.indexOf('android') > 0;
  12345. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  12346. // this needs to be lazy-evaled because vue may be required before
  12347. // vue-server-renderer can set VUE_ENV
  12348. var _isServer;
  12349. var isServerRendering = function () {
  12350. if (_isServer === undefined) {
  12351. /* istanbul ignore if */
  12352. if (!inBrowser && typeof global !== 'undefined') {
  12353. // detect presence of vue-server-renderer and avoid
  12354. // Webpack shimming the process
  12355. _isServer = global['process'].env.VUE_ENV === 'server';
  12356. } else {
  12357. _isServer = false;
  12358. }
  12359. }
  12360. return _isServer
  12361. };
  12362. // detect devtools
  12363. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12364. /* istanbul ignore next */
  12365. function isNative (Ctor) {
  12366. return /native code/.test(Ctor.toString())
  12367. }
  12368. /**
  12369. * Defer a task to execute it asynchronously.
  12370. */
  12371. var nextTick = (function () {
  12372. var callbacks = [];
  12373. var pending = false;
  12374. var timerFunc;
  12375. function nextTickHandler () {
  12376. pending = false;
  12377. var copies = callbacks.slice(0);
  12378. callbacks.length = 0;
  12379. for (var i = 0; i < copies.length; i++) {
  12380. copies[i]();
  12381. }
  12382. }
  12383. // the nextTick behavior leverages the microtask queue, which can be accessed
  12384. // via either native Promise.then or MutationObserver.
  12385. // MutationObserver has wider support, however it is seriously bugged in
  12386. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  12387. // completely stops working after triggering a few times... so, if native
  12388. // Promise is available, we will use it:
  12389. /* istanbul ignore if */
  12390. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  12391. var p = Promise.resolve();
  12392. var logError = function (err) { console.error(err); };
  12393. timerFunc = function () {
  12394. p.then(nextTickHandler).catch(logError);
  12395. // in problematic UIWebViews, Promise.then doesn't completely break, but
  12396. // it can get stuck in a weird state where callbacks are pushed into the
  12397. // microtask queue but the queue isn't being flushed, until the browser
  12398. // needs to do some other work, e.g. handle a timer. Therefore we can
  12399. // "force" the microtask queue to be flushed by adding an empty timer.
  12400. if (isIOS) { setTimeout(noop); }
  12401. };
  12402. } else if (typeof MutationObserver !== 'undefined' && (
  12403. isNative(MutationObserver) ||
  12404. // PhantomJS and iOS 7.x
  12405. MutationObserver.toString() === '[object MutationObserverConstructor]'
  12406. )) {
  12407. // use MutationObserver where native Promise is not available,
  12408. // e.g. PhantomJS IE11, iOS7, Android 4.4
  12409. var counter = 1;
  12410. var observer = new MutationObserver(nextTickHandler);
  12411. var textNode = document.createTextNode(String(counter));
  12412. observer.observe(textNode, {
  12413. characterData: true
  12414. });
  12415. timerFunc = function () {
  12416. counter = (counter + 1) % 2;
  12417. textNode.data = String(counter);
  12418. };
  12419. } else {
  12420. // fallback to setTimeout
  12421. /* istanbul ignore next */
  12422. timerFunc = function () {
  12423. setTimeout(nextTickHandler, 0);
  12424. };
  12425. }
  12426. return function queueNextTick (cb, ctx) {
  12427. var _resolve;
  12428. callbacks.push(function () {
  12429. if (cb) { cb.call(ctx); }
  12430. if (_resolve) { _resolve(ctx); }
  12431. });
  12432. if (!pending) {
  12433. pending = true;
  12434. timerFunc();
  12435. }
  12436. if (!cb && typeof Promise !== 'undefined') {
  12437. return new Promise(function (resolve) {
  12438. _resolve = resolve;
  12439. })
  12440. }
  12441. }
  12442. })();
  12443. var _Set;
  12444. /* istanbul ignore if */
  12445. if (typeof Set !== 'undefined' && isNative(Set)) {
  12446. // use native Set when available.
  12447. _Set = Set;
  12448. } else {
  12449. // a non-standard Set polyfill that only works with primitive keys.
  12450. _Set = (function () {
  12451. function Set () {
  12452. this.set = Object.create(null);
  12453. }
  12454. Set.prototype.has = function has (key) {
  12455. return this.set[key] === true
  12456. };
  12457. Set.prototype.add = function add (key) {
  12458. this.set[key] = true;
  12459. };
  12460. Set.prototype.clear = function clear () {
  12461. this.set = Object.create(null);
  12462. };
  12463. return Set;
  12464. }());
  12465. }
  12466. var warn = noop;
  12467. var formatComponentName;
  12468. if (process.env.NODE_ENV !== 'production') {
  12469. var hasConsole = typeof console !== 'undefined';
  12470. warn = function (msg, vm) {
  12471. if (hasConsole && (!config.silent)) {
  12472. console.error("[Vue warn]: " + msg + " " + (
  12473. vm ? formatLocation(formatComponentName(vm)) : ''
  12474. ));
  12475. }
  12476. };
  12477. formatComponentName = function (vm) {
  12478. if (vm.$root === vm) {
  12479. return 'root instance'
  12480. }
  12481. var name = vm._isVue
  12482. ? vm.$options.name || vm.$options._componentTag
  12483. : vm.name;
  12484. return (
  12485. (name ? ("component <" + name + ">") : "anonymous component") +
  12486. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  12487. )
  12488. };
  12489. var formatLocation = function (str) {
  12490. if (str === 'anonymous component') {
  12491. str += " - use the \"name\" option for better debugging messages.";
  12492. }
  12493. return ("\n(found in " + str + ")")
  12494. };
  12495. }
  12496. /* */
  12497. var uid$1 = 0;
  12498. /**
  12499. * A dep is an observable that can have multiple
  12500. * directives subscribing to it.
  12501. */
  12502. var Dep = function Dep () {
  12503. this.id = uid$1++;
  12504. this.subs = [];
  12505. };
  12506. Dep.prototype.addSub = function addSub (sub) {
  12507. this.subs.push(sub);
  12508. };
  12509. Dep.prototype.removeSub = function removeSub (sub) {
  12510. remove$1(this.subs, sub);
  12511. };
  12512. Dep.prototype.depend = function depend () {
  12513. if (Dep.target) {
  12514. Dep.target.addDep(this);
  12515. }
  12516. };
  12517. Dep.prototype.notify = function notify () {
  12518. // stablize the subscriber list first
  12519. var subs = this.subs.slice();
  12520. for (var i = 0, l = subs.length; i < l; i++) {
  12521. subs[i].update();
  12522. }
  12523. };
  12524. // the current target watcher being evaluated.
  12525. // this is globally unique because there could be only one
  12526. // watcher being evaluated at any time.
  12527. Dep.target = null;
  12528. var targetStack = [];
  12529. function pushTarget (_target) {
  12530. if (Dep.target) { targetStack.push(Dep.target); }
  12531. Dep.target = _target;
  12532. }
  12533. function popTarget () {
  12534. Dep.target = targetStack.pop();
  12535. }
  12536. /*
  12537. * not type checking this file because flow doesn't play well with
  12538. * dynamically accessing methods on Array prototype
  12539. */
  12540. var arrayProto = Array.prototype;
  12541. var arrayMethods = Object.create(arrayProto);[
  12542. 'push',
  12543. 'pop',
  12544. 'shift',
  12545. 'unshift',
  12546. 'splice',
  12547. 'sort',
  12548. 'reverse'
  12549. ]
  12550. .forEach(function (method) {
  12551. // cache original method
  12552. var original = arrayProto[method];
  12553. def(arrayMethods, method, function mutator () {
  12554. var arguments$1 = arguments;
  12555. // avoid leaking arguments:
  12556. // http://jsperf.com/closure-with-arguments
  12557. var i = arguments.length;
  12558. var args = new Array(i);
  12559. while (i--) {
  12560. args[i] = arguments$1[i];
  12561. }
  12562. var result = original.apply(this, args);
  12563. var ob = this.__ob__;
  12564. var inserted;
  12565. switch (method) {
  12566. case 'push':
  12567. inserted = args;
  12568. break
  12569. case 'unshift':
  12570. inserted = args;
  12571. break
  12572. case 'splice':
  12573. inserted = args.slice(2);
  12574. break
  12575. }
  12576. if (inserted) { ob.observeArray(inserted); }
  12577. // notify change
  12578. ob.dep.notify();
  12579. return result
  12580. });
  12581. });
  12582. /* */
  12583. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  12584. /**
  12585. * By default, when a reactive property is set, the new value is
  12586. * also converted to become reactive. However when passing down props,
  12587. * we don't want to force conversion because the value may be a nested value
  12588. * under a frozen data structure. Converting it would defeat the optimization.
  12589. */
  12590. var observerState = {
  12591. shouldConvert: true,
  12592. isSettingProps: false
  12593. };
  12594. /**
  12595. * Observer class that are attached to each observed
  12596. * object. Once attached, the observer converts target
  12597. * object's property keys into getter/setters that
  12598. * collect dependencies and dispatches updates.
  12599. */
  12600. var Observer = function Observer (value) {
  12601. this.value = value;
  12602. this.dep = new Dep();
  12603. this.vmCount = 0;
  12604. def(value, '__ob__', this);
  12605. if (Array.isArray(value)) {
  12606. var augment = hasProto
  12607. ? protoAugment
  12608. : copyAugment;
  12609. augment(value, arrayMethods, arrayKeys);
  12610. this.observeArray(value);
  12611. } else {
  12612. this.walk(value);
  12613. }
  12614. };
  12615. /**
  12616. * Walk through each property and convert them into
  12617. * getter/setters. This method should only be called when
  12618. * value type is Object.
  12619. */
  12620. Observer.prototype.walk = function walk (obj) {
  12621. var keys = Object.keys(obj);
  12622. for (var i = 0; i < keys.length; i++) {
  12623. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  12624. }
  12625. };
  12626. /**
  12627. * Observe a list of Array items.
  12628. */
  12629. Observer.prototype.observeArray = function observeArray (items) {
  12630. for (var i = 0, l = items.length; i < l; i++) {
  12631. observe(items[i]);
  12632. }
  12633. };
  12634. // helpers
  12635. /**
  12636. * Augment an target Object or Array by intercepting
  12637. * the prototype chain using __proto__
  12638. */
  12639. function protoAugment (target, src) {
  12640. /* eslint-disable no-proto */
  12641. target.__proto__ = src;
  12642. /* eslint-enable no-proto */
  12643. }
  12644. /**
  12645. * Augment an target Object or Array by defining
  12646. * hidden properties.
  12647. */
  12648. /* istanbul ignore next */
  12649. function copyAugment (target, src, keys) {
  12650. for (var i = 0, l = keys.length; i < l; i++) {
  12651. var key = keys[i];
  12652. def(target, key, src[key]);
  12653. }
  12654. }
  12655. /**
  12656. * Attempt to create an observer instance for a value,
  12657. * returns the new observer if successfully observed,
  12658. * or the existing observer if the value already has one.
  12659. */
  12660. function observe (value, asRootData) {
  12661. if (!isObject(value)) {
  12662. return
  12663. }
  12664. var ob;
  12665. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  12666. ob = value.__ob__;
  12667. } else if (
  12668. observerState.shouldConvert &&
  12669. !isServerRendering() &&
  12670. (Array.isArray(value) || isPlainObject(value)) &&
  12671. Object.isExtensible(value) &&
  12672. !value._isVue
  12673. ) {
  12674. ob = new Observer(value);
  12675. }
  12676. if (asRootData && ob) {
  12677. ob.vmCount++;
  12678. }
  12679. return ob
  12680. }
  12681. /**
  12682. * Define a reactive property on an Object.
  12683. */
  12684. function defineReactive$$1 (
  12685. obj,
  12686. key,
  12687. val,
  12688. customSetter
  12689. ) {
  12690. var dep = new Dep();
  12691. var property = Object.getOwnPropertyDescriptor(obj, key);
  12692. if (property && property.configurable === false) {
  12693. return
  12694. }
  12695. // cater for pre-defined getter/setters
  12696. var getter = property && property.get;
  12697. var setter = property && property.set;
  12698. var childOb = observe(val);
  12699. Object.defineProperty(obj, key, {
  12700. enumerable: true,
  12701. configurable: true,
  12702. get: function reactiveGetter () {
  12703. var value = getter ? getter.call(obj) : val;
  12704. if (Dep.target) {
  12705. dep.depend();
  12706. if (childOb) {
  12707. childOb.dep.depend();
  12708. }
  12709. if (Array.isArray(value)) {
  12710. dependArray(value);
  12711. }
  12712. }
  12713. return value
  12714. },
  12715. set: function reactiveSetter (newVal) {
  12716. var value = getter ? getter.call(obj) : val;
  12717. /* eslint-disable no-self-compare */
  12718. if (newVal === value || (newVal !== newVal && value !== value)) {
  12719. return
  12720. }
  12721. /* eslint-enable no-self-compare */
  12722. if (process.env.NODE_ENV !== 'production' && customSetter) {
  12723. customSetter();
  12724. }
  12725. if (setter) {
  12726. setter.call(obj, newVal);
  12727. } else {
  12728. val = newVal;
  12729. }
  12730. childOb = observe(newVal);
  12731. dep.notify();
  12732. }
  12733. });
  12734. }
  12735. /**
  12736. * Set a property on an object. Adds the new property and
  12737. * triggers change notification if the property doesn't
  12738. * already exist.
  12739. */
  12740. function set$1 (obj, key, val) {
  12741. if (Array.isArray(obj)) {
  12742. obj.length = Math.max(obj.length, key);
  12743. obj.splice(key, 1, val);
  12744. return val
  12745. }
  12746. if (hasOwn(obj, key)) {
  12747. obj[key] = val;
  12748. return
  12749. }
  12750. var ob = obj.__ob__;
  12751. if (obj._isVue || (ob && ob.vmCount)) {
  12752. process.env.NODE_ENV !== 'production' && warn(
  12753. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  12754. 'at runtime - declare it upfront in the data option.'
  12755. );
  12756. return
  12757. }
  12758. if (!ob) {
  12759. obj[key] = val;
  12760. return
  12761. }
  12762. defineReactive$$1(ob.value, key, val);
  12763. ob.dep.notify();
  12764. return val
  12765. }
  12766. /**
  12767. * Delete a property and trigger change if necessary.
  12768. */
  12769. function del (obj, key) {
  12770. var ob = obj.__ob__;
  12771. if (obj._isVue || (ob && ob.vmCount)) {
  12772. process.env.NODE_ENV !== 'production' && warn(
  12773. 'Avoid deleting properties on a Vue instance or its root $data ' +
  12774. '- just set it to null.'
  12775. );
  12776. return
  12777. }
  12778. if (!hasOwn(obj, key)) {
  12779. return
  12780. }
  12781. delete obj[key];
  12782. if (!ob) {
  12783. return
  12784. }
  12785. ob.dep.notify();
  12786. }
  12787. /**
  12788. * Collect dependencies on array elements when the array is touched, since
  12789. * we cannot intercept array element access like property getters.
  12790. */
  12791. function dependArray (value) {
  12792. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  12793. e = value[i];
  12794. e && e.__ob__ && e.__ob__.dep.depend();
  12795. if (Array.isArray(e)) {
  12796. dependArray(e);
  12797. }
  12798. }
  12799. }
  12800. /* */
  12801. /**
  12802. * Option overwriting strategies are functions that handle
  12803. * how to merge a parent option value and a child option
  12804. * value into the final value.
  12805. */
  12806. var strats = config.optionMergeStrategies;
  12807. /**
  12808. * Options with restrictions
  12809. */
  12810. if (process.env.NODE_ENV !== 'production') {
  12811. strats.el = strats.propsData = function (parent, child, vm, key) {
  12812. if (!vm) {
  12813. warn(
  12814. "option \"" + key + "\" can only be used during instance " +
  12815. 'creation with the `new` keyword.'
  12816. );
  12817. }
  12818. return defaultStrat(parent, child)
  12819. };
  12820. }
  12821. /**
  12822. * Helper that recursively merges two data objects together.
  12823. */
  12824. function mergeData (to, from) {
  12825. if (!from) { return to }
  12826. var key, toVal, fromVal;
  12827. var keys = Object.keys(from);
  12828. for (var i = 0; i < keys.length; i++) {
  12829. key = keys[i];
  12830. toVal = to[key];
  12831. fromVal = from[key];
  12832. if (!hasOwn(to, key)) {
  12833. set$1(to, key, fromVal);
  12834. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  12835. mergeData(toVal, fromVal);
  12836. }
  12837. }
  12838. return to
  12839. }
  12840. /**
  12841. * Data
  12842. */
  12843. strats.data = function (
  12844. parentVal,
  12845. childVal,
  12846. vm
  12847. ) {
  12848. if (!vm) {
  12849. // in a Vue.extend merge, both should be functions
  12850. if (!childVal) {
  12851. return parentVal
  12852. }
  12853. if (typeof childVal !== 'function') {
  12854. process.env.NODE_ENV !== 'production' && warn(
  12855. 'The "data" option should be a function ' +
  12856. 'that returns a per-instance value in component ' +
  12857. 'definitions.',
  12858. vm
  12859. );
  12860. return parentVal
  12861. }
  12862. if (!parentVal) {
  12863. return childVal
  12864. }
  12865. // when parentVal & childVal are both present,
  12866. // we need to return a function that returns the
  12867. // merged result of both functions... no need to
  12868. // check if parentVal is a function here because
  12869. // it has to be a function to pass previous merges.
  12870. return function mergedDataFn () {
  12871. return mergeData(
  12872. childVal.call(this),
  12873. parentVal.call(this)
  12874. )
  12875. }
  12876. } else if (parentVal || childVal) {
  12877. return function mergedInstanceDataFn () {
  12878. // instance merge
  12879. var instanceData = typeof childVal === 'function'
  12880. ? childVal.call(vm)
  12881. : childVal;
  12882. var defaultData = typeof parentVal === 'function'
  12883. ? parentVal.call(vm)
  12884. : undefined;
  12885. if (instanceData) {
  12886. return mergeData(instanceData, defaultData)
  12887. } else {
  12888. return defaultData
  12889. }
  12890. }
  12891. }
  12892. };
  12893. /**
  12894. * Hooks and param attributes are merged as arrays.
  12895. */
  12896. function mergeHook (
  12897. parentVal,
  12898. childVal
  12899. ) {
  12900. return childVal
  12901. ? parentVal
  12902. ? parentVal.concat(childVal)
  12903. : Array.isArray(childVal)
  12904. ? childVal
  12905. : [childVal]
  12906. : parentVal
  12907. }
  12908. config._lifecycleHooks.forEach(function (hook) {
  12909. strats[hook] = mergeHook;
  12910. });
  12911. /**
  12912. * Assets
  12913. *
  12914. * When a vm is present (instance creation), we need to do
  12915. * a three-way merge between constructor options, instance
  12916. * options and parent options.
  12917. */
  12918. function mergeAssets (parentVal, childVal) {
  12919. var res = Object.create(parentVal || null);
  12920. return childVal
  12921. ? extend(res, childVal)
  12922. : res
  12923. }
  12924. config._assetTypes.forEach(function (type) {
  12925. strats[type + 's'] = mergeAssets;
  12926. });
  12927. /**
  12928. * Watchers.
  12929. *
  12930. * Watchers hashes should not overwrite one
  12931. * another, so we merge them as arrays.
  12932. */
  12933. strats.watch = function (parentVal, childVal) {
  12934. /* istanbul ignore if */
  12935. if (!childVal) { return parentVal }
  12936. if (!parentVal) { return childVal }
  12937. var ret = {};
  12938. extend(ret, parentVal);
  12939. for (var key in childVal) {
  12940. var parent = ret[key];
  12941. var child = childVal[key];
  12942. if (parent && !Array.isArray(parent)) {
  12943. parent = [parent];
  12944. }
  12945. ret[key] = parent
  12946. ? parent.concat(child)
  12947. : [child];
  12948. }
  12949. return ret
  12950. };
  12951. /**
  12952. * Other object hashes.
  12953. */
  12954. strats.props =
  12955. strats.methods =
  12956. strats.computed = function (parentVal, childVal) {
  12957. if (!childVal) { return parentVal }
  12958. if (!parentVal) { return childVal }
  12959. var ret = Object.create(null);
  12960. extend(ret, parentVal);
  12961. extend(ret, childVal);
  12962. return ret
  12963. };
  12964. /**
  12965. * Default strategy.
  12966. */
  12967. var defaultStrat = function (parentVal, childVal) {
  12968. return childVal === undefined
  12969. ? parentVal
  12970. : childVal
  12971. };
  12972. /**
  12973. * Validate component names
  12974. */
  12975. function checkComponents (options) {
  12976. for (var key in options.components) {
  12977. var lower = key.toLowerCase();
  12978. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  12979. warn(
  12980. 'Do not use built-in or reserved HTML elements as component ' +
  12981. 'id: ' + key
  12982. );
  12983. }
  12984. }
  12985. }
  12986. /**
  12987. * Ensure all props option syntax are normalized into the
  12988. * Object-based format.
  12989. */
  12990. function normalizeProps (options) {
  12991. var props = options.props;
  12992. if (!props) { return }
  12993. var res = {};
  12994. var i, val, name;
  12995. if (Array.isArray(props)) {
  12996. i = props.length;
  12997. while (i--) {
  12998. val = props[i];
  12999. if (typeof val === 'string') {
  13000. name = camelize(val);
  13001. res[name] = { type: null };
  13002. } else if (process.env.NODE_ENV !== 'production') {
  13003. warn('props must be strings when using array syntax.');
  13004. }
  13005. }
  13006. } else if (isPlainObject(props)) {
  13007. for (var key in props) {
  13008. val = props[key];
  13009. name = camelize(key);
  13010. res[name] = isPlainObject(val)
  13011. ? val
  13012. : { type: val };
  13013. }
  13014. }
  13015. options.props = res;
  13016. }
  13017. /**
  13018. * Normalize raw function directives into object format.
  13019. */
  13020. function normalizeDirectives (options) {
  13021. var dirs = options.directives;
  13022. if (dirs) {
  13023. for (var key in dirs) {
  13024. var def = dirs[key];
  13025. if (typeof def === 'function') {
  13026. dirs[key] = { bind: def, update: def };
  13027. }
  13028. }
  13029. }
  13030. }
  13031. /**
  13032. * Merge two option objects into a new one.
  13033. * Core utility used in both instantiation and inheritance.
  13034. */
  13035. function mergeOptions (
  13036. parent,
  13037. child,
  13038. vm
  13039. ) {
  13040. if (process.env.NODE_ENV !== 'production') {
  13041. checkComponents(child);
  13042. }
  13043. normalizeProps(child);
  13044. normalizeDirectives(child);
  13045. var extendsFrom = child.extends;
  13046. if (extendsFrom) {
  13047. parent = typeof extendsFrom === 'function'
  13048. ? mergeOptions(parent, extendsFrom.options, vm)
  13049. : mergeOptions(parent, extendsFrom, vm);
  13050. }
  13051. if (child.mixins) {
  13052. for (var i = 0, l = child.mixins.length; i < l; i++) {
  13053. var mixin = child.mixins[i];
  13054. if (mixin.prototype instanceof Vue$3) {
  13055. mixin = mixin.options;
  13056. }
  13057. parent = mergeOptions(parent, mixin, vm);
  13058. }
  13059. }
  13060. var options = {};
  13061. var key;
  13062. for (key in parent) {
  13063. mergeField(key);
  13064. }
  13065. for (key in child) {
  13066. if (!hasOwn(parent, key)) {
  13067. mergeField(key);
  13068. }
  13069. }
  13070. function mergeField (key) {
  13071. var strat = strats[key] || defaultStrat;
  13072. options[key] = strat(parent[key], child[key], vm, key);
  13073. }
  13074. return options
  13075. }
  13076. /**
  13077. * Resolve an asset.
  13078. * This function is used because child instances need access
  13079. * to assets defined in its ancestor chain.
  13080. */
  13081. function resolveAsset (
  13082. options,
  13083. type,
  13084. id,
  13085. warnMissing
  13086. ) {
  13087. /* istanbul ignore if */
  13088. if (typeof id !== 'string') {
  13089. return
  13090. }
  13091. var assets = options[type];
  13092. // check local registration variations first
  13093. if (hasOwn(assets, id)) { return assets[id] }
  13094. var camelizedId = camelize(id);
  13095. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  13096. var PascalCaseId = capitalize(camelizedId);
  13097. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  13098. // fallback to prototype chain
  13099. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  13100. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  13101. warn(
  13102. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  13103. options
  13104. );
  13105. }
  13106. return res
  13107. }
  13108. /* */
  13109. function validateProp (
  13110. key,
  13111. propOptions,
  13112. propsData,
  13113. vm
  13114. ) {
  13115. var prop = propOptions[key];
  13116. var absent = !hasOwn(propsData, key);
  13117. var value = propsData[key];
  13118. // handle boolean props
  13119. if (isType(Boolean, prop.type)) {
  13120. if (absent && !hasOwn(prop, 'default')) {
  13121. value = false;
  13122. } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
  13123. value = true;
  13124. }
  13125. }
  13126. // check default value
  13127. if (value === undefined) {
  13128. value = getPropDefaultValue(vm, prop, key);
  13129. // since the default value is a fresh copy,
  13130. // make sure to observe it.
  13131. var prevShouldConvert = observerState.shouldConvert;
  13132. observerState.shouldConvert = true;
  13133. observe(value);
  13134. observerState.shouldConvert = prevShouldConvert;
  13135. }
  13136. if (process.env.NODE_ENV !== 'production') {
  13137. assertProp(prop, key, value, vm, absent);
  13138. }
  13139. return value
  13140. }
  13141. /**
  13142. * Get the default value of a prop.
  13143. */
  13144. function getPropDefaultValue (vm, prop, key) {
  13145. // no default, return undefined
  13146. if (!hasOwn(prop, 'default')) {
  13147. return undefined
  13148. }
  13149. var def = prop.default;
  13150. // warn against non-factory defaults for Object & Array
  13151. if (isObject(def)) {
  13152. process.env.NODE_ENV !== 'production' && warn(
  13153. 'Invalid default value for prop "' + key + '": ' +
  13154. 'Props with type Object/Array must use a factory function ' +
  13155. 'to return the default value.',
  13156. vm
  13157. );
  13158. }
  13159. // the raw prop value was also undefined from previous render,
  13160. // return previous default value to avoid unnecessary watcher trigger
  13161. if (vm && vm.$options.propsData &&
  13162. vm.$options.propsData[key] === undefined &&
  13163. vm[key] !== undefined) {
  13164. return vm[key]
  13165. }
  13166. // call factory function for non-Function types
  13167. return typeof def === 'function' && prop.type !== Function
  13168. ? def.call(vm)
  13169. : def
  13170. }
  13171. /**
  13172. * Assert whether a prop is valid.
  13173. */
  13174. function assertProp (
  13175. prop,
  13176. name,
  13177. value,
  13178. vm,
  13179. absent
  13180. ) {
  13181. if (prop.required && absent) {
  13182. warn(
  13183. 'Missing required prop: "' + name + '"',
  13184. vm
  13185. );
  13186. return
  13187. }
  13188. if (value == null && !prop.required) {
  13189. return
  13190. }
  13191. var type = prop.type;
  13192. var valid = !type || type === true;
  13193. var expectedTypes = [];
  13194. if (type) {
  13195. if (!Array.isArray(type)) {
  13196. type = [type];
  13197. }
  13198. for (var i = 0; i < type.length && !valid; i++) {
  13199. var assertedType = assertType(value, type[i]);
  13200. expectedTypes.push(assertedType.expectedType || '');
  13201. valid = assertedType.valid;
  13202. }
  13203. }
  13204. if (!valid) {
  13205. warn(
  13206. 'Invalid prop: type check failed for prop "' + name + '".' +
  13207. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  13208. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  13209. vm
  13210. );
  13211. return
  13212. }
  13213. var validator = prop.validator;
  13214. if (validator) {
  13215. if (!validator(value)) {
  13216. warn(
  13217. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  13218. vm
  13219. );
  13220. }
  13221. }
  13222. }
  13223. /**
  13224. * Assert the type of a value
  13225. */
  13226. function assertType (value, type) {
  13227. var valid;
  13228. var expectedType = getType(type);
  13229. if (expectedType === 'String') {
  13230. valid = typeof value === (expectedType = 'string');
  13231. } else if (expectedType === 'Number') {
  13232. valid = typeof value === (expectedType = 'number');
  13233. } else if (expectedType === 'Boolean') {
  13234. valid = typeof value === (expectedType = 'boolean');
  13235. } else if (expectedType === 'Function') {
  13236. valid = typeof value === (expectedType = 'function');
  13237. } else if (expectedType === 'Object') {
  13238. valid = isPlainObject(value);
  13239. } else if (expectedType === 'Array') {
  13240. valid = Array.isArray(value);
  13241. } else {
  13242. valid = value instanceof type;
  13243. }
  13244. return {
  13245. valid: valid,
  13246. expectedType: expectedType
  13247. }
  13248. }
  13249. /**
  13250. * Use function string name to check built-in types,
  13251. * because a simple equality check will fail when running
  13252. * across different vms / iframes.
  13253. */
  13254. function getType (fn) {
  13255. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  13256. return match && match[1]
  13257. }
  13258. function isType (type, fn) {
  13259. if (!Array.isArray(fn)) {
  13260. return getType(fn) === getType(type)
  13261. }
  13262. for (var i = 0, len = fn.length; i < len; i++) {
  13263. if (getType(fn[i]) === getType(type)) {
  13264. return true
  13265. }
  13266. }
  13267. /* istanbul ignore next */
  13268. return false
  13269. }
  13270. var util = Object.freeze({
  13271. defineReactive: defineReactive$$1,
  13272. _toString: _toString,
  13273. toNumber: toNumber,
  13274. makeMap: makeMap,
  13275. isBuiltInTag: isBuiltInTag,
  13276. remove: remove$1,
  13277. hasOwn: hasOwn,
  13278. isPrimitive: isPrimitive,
  13279. cached: cached,
  13280. camelize: camelize,
  13281. capitalize: capitalize,
  13282. hyphenate: hyphenate,
  13283. bind: bind$1,
  13284. toArray: toArray,
  13285. extend: extend,
  13286. isObject: isObject,
  13287. isPlainObject: isPlainObject,
  13288. toObject: toObject,
  13289. noop: noop,
  13290. no: no,
  13291. identity: identity,
  13292. genStaticKeys: genStaticKeys,
  13293. looseEqual: looseEqual,
  13294. looseIndexOf: looseIndexOf,
  13295. isReserved: isReserved,
  13296. def: def,
  13297. parsePath: parsePath,
  13298. hasProto: hasProto,
  13299. inBrowser: inBrowser,
  13300. UA: UA,
  13301. isIE: isIE,
  13302. isIE9: isIE9,
  13303. isEdge: isEdge,
  13304. isAndroid: isAndroid,
  13305. isIOS: isIOS,
  13306. isServerRendering: isServerRendering,
  13307. devtools: devtools,
  13308. nextTick: nextTick,
  13309. get _Set () { return _Set; },
  13310. mergeOptions: mergeOptions,
  13311. resolveAsset: resolveAsset,
  13312. get warn () { return warn; },
  13313. get formatComponentName () { return formatComponentName; },
  13314. validateProp: validateProp
  13315. });
  13316. /* not type checking this file because flow doesn't play well with Proxy */
  13317. var initProxy;
  13318. if (process.env.NODE_ENV !== 'production') {
  13319. var allowedGlobals = makeMap(
  13320. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  13321. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  13322. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  13323. 'require' // for Webpack/Browserify
  13324. );
  13325. var warnNonPresent = function (target, key) {
  13326. warn(
  13327. "Property or method \"" + key + "\" is not defined on the instance but " +
  13328. "referenced during render. Make sure to declare reactive data " +
  13329. "properties in the data option.",
  13330. target
  13331. );
  13332. };
  13333. var hasProxy =
  13334. typeof Proxy !== 'undefined' &&
  13335. Proxy.toString().match(/native code/);
  13336. if (hasProxy) {
  13337. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
  13338. config.keyCodes = new Proxy(config.keyCodes, {
  13339. set: function set (target, key, value) {
  13340. if (isBuiltInModifier(key)) {
  13341. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  13342. return false
  13343. } else {
  13344. target[key] = value;
  13345. return true
  13346. }
  13347. }
  13348. });
  13349. }
  13350. var hasHandler = {
  13351. has: function has (target, key) {
  13352. var has = key in target;
  13353. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  13354. if (!has && !isAllowed) {
  13355. warnNonPresent(target, key);
  13356. }
  13357. return has || !isAllowed
  13358. }
  13359. };
  13360. var getHandler = {
  13361. get: function get (target, key) {
  13362. if (typeof key === 'string' && !(key in target)) {
  13363. warnNonPresent(target, key);
  13364. }
  13365. return target[key]
  13366. }
  13367. };
  13368. initProxy = function initProxy (vm) {
  13369. if (hasProxy) {
  13370. // determine which proxy handler to use
  13371. var options = vm.$options;
  13372. var handlers = options.render && options.render._withStripped
  13373. ? getHandler
  13374. : hasHandler;
  13375. vm._renderProxy = new Proxy(vm, handlers);
  13376. } else {
  13377. vm._renderProxy = vm;
  13378. }
  13379. };
  13380. }
  13381. /* */
  13382. var VNode = function VNode (
  13383. tag,
  13384. data,
  13385. children,
  13386. text,
  13387. elm,
  13388. context,
  13389. componentOptions
  13390. ) {
  13391. this.tag = tag;
  13392. this.data = data;
  13393. this.children = children;
  13394. this.text = text;
  13395. this.elm = elm;
  13396. this.ns = undefined;
  13397. this.context = context;
  13398. this.functionalContext = undefined;
  13399. this.key = data && data.key;
  13400. this.componentOptions = componentOptions;
  13401. this.componentInstance = undefined;
  13402. this.parent = undefined;
  13403. this.raw = false;
  13404. this.isStatic = false;
  13405. this.isRootInsert = true;
  13406. this.isComment = false;
  13407. this.isCloned = false;
  13408. this.isOnce = false;
  13409. };
  13410. var prototypeAccessors = { child: {} };
  13411. // DEPRECATED: alias for componentInstance for backwards compat.
  13412. /* istanbul ignore next */
  13413. prototypeAccessors.child.get = function () {
  13414. return this.componentInstance
  13415. };
  13416. Object.defineProperties( VNode.prototype, prototypeAccessors );
  13417. var createEmptyVNode = function () {
  13418. var node = new VNode();
  13419. node.text = '';
  13420. node.isComment = true;
  13421. return node
  13422. };
  13423. function createTextVNode (val) {
  13424. return new VNode(undefined, undefined, undefined, String(val))
  13425. }
  13426. // optimized shallow clone
  13427. // used for static nodes and slot nodes because they may be reused across
  13428. // multiple renders, cloning them avoids errors when DOM manipulations rely
  13429. // on their elm reference.
  13430. function cloneVNode (vnode) {
  13431. var cloned = new VNode(
  13432. vnode.tag,
  13433. vnode.data,
  13434. vnode.children,
  13435. vnode.text,
  13436. vnode.elm,
  13437. vnode.context,
  13438. vnode.componentOptions
  13439. );
  13440. cloned.ns = vnode.ns;
  13441. cloned.isStatic = vnode.isStatic;
  13442. cloned.key = vnode.key;
  13443. cloned.isCloned = true;
  13444. return cloned
  13445. }
  13446. function cloneVNodes (vnodes) {
  13447. var res = new Array(vnodes.length);
  13448. for (var i = 0; i < vnodes.length; i++) {
  13449. res[i] = cloneVNode(vnodes[i]);
  13450. }
  13451. return res
  13452. }
  13453. /* */
  13454. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  13455. var hooksToMerge = Object.keys(hooks);
  13456. function createComponent (
  13457. Ctor,
  13458. data,
  13459. context,
  13460. children,
  13461. tag
  13462. ) {
  13463. if (!Ctor) {
  13464. return
  13465. }
  13466. var baseCtor = context.$options._base;
  13467. if (isObject(Ctor)) {
  13468. Ctor = baseCtor.extend(Ctor);
  13469. }
  13470. if (typeof Ctor !== 'function') {
  13471. if (process.env.NODE_ENV !== 'production') {
  13472. warn(("Invalid Component definition: " + (String(Ctor))), context);
  13473. }
  13474. return
  13475. }
  13476. // async component
  13477. if (!Ctor.cid) {
  13478. if (Ctor.resolved) {
  13479. Ctor = Ctor.resolved;
  13480. } else {
  13481. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  13482. // it's ok to queue this on every render because
  13483. // $forceUpdate is buffered by the scheduler.
  13484. context.$forceUpdate();
  13485. });
  13486. if (!Ctor) {
  13487. // return nothing if this is indeed an async component
  13488. // wait for the callback to trigger parent update.
  13489. return
  13490. }
  13491. }
  13492. }
  13493. // resolve constructor options in case global mixins are applied after
  13494. // component constructor creation
  13495. resolveConstructorOptions(Ctor);
  13496. data = data || {};
  13497. // extract props
  13498. var propsData = extractProps(data, Ctor);
  13499. // functional component
  13500. if (Ctor.options.functional) {
  13501. return createFunctionalComponent(Ctor, propsData, data, context, children)
  13502. }
  13503. // extract listeners, since these needs to be treated as
  13504. // child component listeners instead of DOM listeners
  13505. var listeners = data.on;
  13506. // replace with listeners with .native modifier
  13507. data.on = data.nativeOn;
  13508. if (Ctor.options.abstract) {
  13509. // abstract components do not keep anything
  13510. // other than props & listeners
  13511. data = {};
  13512. }
  13513. // merge component management hooks onto the placeholder node
  13514. mergeHooks(data);
  13515. // return a placeholder vnode
  13516. var name = Ctor.options.name || tag;
  13517. var vnode = new VNode(
  13518. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  13519. data, undefined, undefined, undefined, context,
  13520. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  13521. );
  13522. return vnode
  13523. }
  13524. function createFunctionalComponent (
  13525. Ctor,
  13526. propsData,
  13527. data,
  13528. context,
  13529. children
  13530. ) {
  13531. var props = {};
  13532. var propOptions = Ctor.options.props;
  13533. if (propOptions) {
  13534. for (var key in propOptions) {
  13535. props[key] = validateProp(key, propOptions, propsData);
  13536. }
  13537. }
  13538. // ensure the createElement function in functional components
  13539. // gets a unique context - this is necessary for correct named slot check
  13540. var _context = Object.create(context);
  13541. var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
  13542. var vnode = Ctor.options.render.call(null, h, {
  13543. props: props,
  13544. data: data,
  13545. parent: context,
  13546. children: children,
  13547. slots: function () { return resolveSlots(children, context); }
  13548. });
  13549. if (vnode instanceof VNode) {
  13550. vnode.functionalContext = context;
  13551. if (data.slot) {
  13552. (vnode.data || (vnode.data = {})).slot = data.slot;
  13553. }
  13554. }
  13555. return vnode
  13556. }
  13557. function createComponentInstanceForVnode (
  13558. vnode, // we know it's MountedComponentVNode but flow doesn't
  13559. parent, // activeInstance in lifecycle state
  13560. parentElm,
  13561. refElm
  13562. ) {
  13563. var vnodeComponentOptions = vnode.componentOptions;
  13564. var options = {
  13565. _isComponent: true,
  13566. parent: parent,
  13567. propsData: vnodeComponentOptions.propsData,
  13568. _componentTag: vnodeComponentOptions.tag,
  13569. _parentVnode: vnode,
  13570. _parentListeners: vnodeComponentOptions.listeners,
  13571. _renderChildren: vnodeComponentOptions.children,
  13572. _parentElm: parentElm || null,
  13573. _refElm: refElm || null
  13574. };
  13575. // check inline-template render functions
  13576. var inlineTemplate = vnode.data.inlineTemplate;
  13577. if (inlineTemplate) {
  13578. options.render = inlineTemplate.render;
  13579. options.staticRenderFns = inlineTemplate.staticRenderFns;
  13580. }
  13581. return new vnodeComponentOptions.Ctor(options)
  13582. }
  13583. function init (
  13584. vnode,
  13585. hydrating,
  13586. parentElm,
  13587. refElm
  13588. ) {
  13589. if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
  13590. var child = vnode.componentInstance = createComponentInstanceForVnode(
  13591. vnode,
  13592. activeInstance,
  13593. parentElm,
  13594. refElm
  13595. );
  13596. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  13597. } else if (vnode.data.keepAlive) {
  13598. // kept-alive components, treat as a patch
  13599. var mountedNode = vnode; // work around flow
  13600. prepatch(mountedNode, mountedNode);
  13601. }
  13602. }
  13603. function prepatch (
  13604. oldVnode,
  13605. vnode
  13606. ) {
  13607. var options = vnode.componentOptions;
  13608. var child = vnode.componentInstance = oldVnode.componentInstance;
  13609. child._updateFromParent(
  13610. options.propsData, // updated props
  13611. options.listeners, // updated listeners
  13612. vnode, // new parent vnode
  13613. options.children // new children
  13614. );
  13615. }
  13616. function insert (vnode) {
  13617. if (!vnode.componentInstance._isMounted) {
  13618. vnode.componentInstance._isMounted = true;
  13619. callHook(vnode.componentInstance, 'mounted');
  13620. }
  13621. if (vnode.data.keepAlive) {
  13622. vnode.componentInstance._inactive = false;
  13623. callHook(vnode.componentInstance, 'activated');
  13624. }
  13625. }
  13626. function destroy$1 (vnode) {
  13627. if (!vnode.componentInstance._isDestroyed) {
  13628. if (!vnode.data.keepAlive) {
  13629. vnode.componentInstance.$destroy();
  13630. } else {
  13631. vnode.componentInstance._inactive = true;
  13632. callHook(vnode.componentInstance, 'deactivated');
  13633. }
  13634. }
  13635. }
  13636. function resolveAsyncComponent (
  13637. factory,
  13638. baseCtor,
  13639. cb
  13640. ) {
  13641. if (factory.requested) {
  13642. // pool callbacks
  13643. factory.pendingCallbacks.push(cb);
  13644. } else {
  13645. factory.requested = true;
  13646. var cbs = factory.pendingCallbacks = [cb];
  13647. var sync = true;
  13648. var resolve = function (res) {
  13649. if (isObject(res)) {
  13650. res = baseCtor.extend(res);
  13651. }
  13652. // cache resolved
  13653. factory.resolved = res;
  13654. // invoke callbacks only if this is not a synchronous resolve
  13655. // (async resolves are shimmed as synchronous during SSR)
  13656. if (!sync) {
  13657. for (var i = 0, l = cbs.length; i < l; i++) {
  13658. cbs[i](res);
  13659. }
  13660. }
  13661. };
  13662. var reject = function (reason) {
  13663. process.env.NODE_ENV !== 'production' && warn(
  13664. "Failed to resolve async component: " + (String(factory)) +
  13665. (reason ? ("\nReason: " + reason) : '')
  13666. );
  13667. };
  13668. var res = factory(resolve, reject);
  13669. // handle promise
  13670. if (res && typeof res.then === 'function' && !factory.resolved) {
  13671. res.then(resolve, reject);
  13672. }
  13673. sync = false;
  13674. // return in case resolved synchronously
  13675. return factory.resolved
  13676. }
  13677. }
  13678. function extractProps (data, Ctor) {
  13679. // we are only extracting raw values here.
  13680. // validation and default values are handled in the child
  13681. // component itself.
  13682. var propOptions = Ctor.options.props;
  13683. if (!propOptions) {
  13684. return
  13685. }
  13686. var res = {};
  13687. var attrs = data.attrs;
  13688. var props = data.props;
  13689. var domProps = data.domProps;
  13690. if (attrs || props || domProps) {
  13691. for (var key in propOptions) {
  13692. var altKey = hyphenate(key);
  13693. checkProp(res, props, key, altKey, true) ||
  13694. checkProp(res, attrs, key, altKey) ||
  13695. checkProp(res, domProps, key, altKey);
  13696. }
  13697. }
  13698. return res
  13699. }
  13700. function checkProp (
  13701. res,
  13702. hash,
  13703. key,
  13704. altKey,
  13705. preserve
  13706. ) {
  13707. if (hash) {
  13708. if (hasOwn(hash, key)) {
  13709. res[key] = hash[key];
  13710. if (!preserve) {
  13711. delete hash[key];
  13712. }
  13713. return true
  13714. } else if (hasOwn(hash, altKey)) {
  13715. res[key] = hash[altKey];
  13716. if (!preserve) {
  13717. delete hash[altKey];
  13718. }
  13719. return true
  13720. }
  13721. }
  13722. return false
  13723. }
  13724. function mergeHooks (data) {
  13725. if (!data.hook) {
  13726. data.hook = {};
  13727. }
  13728. for (var i = 0; i < hooksToMerge.length; i++) {
  13729. var key = hooksToMerge[i];
  13730. var fromParent = data.hook[key];
  13731. var ours = hooks[key];
  13732. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  13733. }
  13734. }
  13735. function mergeHook$1 (one, two) {
  13736. return function (a, b, c, d) {
  13737. one(a, b, c, d);
  13738. two(a, b, c, d);
  13739. }
  13740. }
  13741. /* */
  13742. function mergeVNodeHook (def, hookKey, hook, key) {
  13743. key = key + hookKey;
  13744. var injectedHash = def.__injected || (def.__injected = {});
  13745. if (!injectedHash[key]) {
  13746. injectedHash[key] = true;
  13747. var oldHook = def[hookKey];
  13748. if (oldHook) {
  13749. def[hookKey] = function () {
  13750. oldHook.apply(this, arguments);
  13751. hook.apply(this, arguments);
  13752. };
  13753. } else {
  13754. def[hookKey] = hook;
  13755. }
  13756. }
  13757. }
  13758. /* */
  13759. var normalizeEvent = cached(function (name) {
  13760. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  13761. name = once ? name.slice(1) : name;
  13762. var capture = name.charAt(0) === '!';
  13763. name = capture ? name.slice(1) : name;
  13764. return {
  13765. name: name,
  13766. once: once,
  13767. capture: capture
  13768. }
  13769. });
  13770. function createEventHandle (fn) {
  13771. var handle = {
  13772. fn: fn,
  13773. invoker: function () {
  13774. var arguments$1 = arguments;
  13775. var fn = handle.fn;
  13776. if (Array.isArray(fn)) {
  13777. for (var i = 0; i < fn.length; i++) {
  13778. fn[i].apply(null, arguments$1);
  13779. }
  13780. } else {
  13781. fn.apply(null, arguments);
  13782. }
  13783. }
  13784. };
  13785. return handle
  13786. }
  13787. function updateListeners (
  13788. on,
  13789. oldOn,
  13790. add,
  13791. remove$$1,
  13792. vm
  13793. ) {
  13794. var name, cur, old, event;
  13795. for (name in on) {
  13796. cur = on[name];
  13797. old = oldOn[name];
  13798. event = normalizeEvent(name);
  13799. if (!cur) {
  13800. process.env.NODE_ENV !== 'production' && warn(
  13801. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  13802. vm
  13803. );
  13804. } else if (!old) {
  13805. if (!cur.invoker) {
  13806. cur = on[name] = createEventHandle(cur);
  13807. }
  13808. add(event.name, cur.invoker, event.once, event.capture);
  13809. } else if (cur !== old) {
  13810. old.fn = cur;
  13811. on[name] = old;
  13812. }
  13813. }
  13814. for (name in oldOn) {
  13815. if (!on[name]) {
  13816. event = normalizeEvent(name);
  13817. remove$$1(event.name, oldOn[name].invoker, event.capture);
  13818. }
  13819. }
  13820. }
  13821. /* */
  13822. // The template compiler attempts to minimize the need for normalization by
  13823. // statically analyzing the template at compile time.
  13824. //
  13825. // For plain HTML markup, normalization can be completely skipped because the
  13826. // generated render function is guaranteed to return Array<VNode>. There are
  13827. // two cases where extra normalization is needed:
  13828. // 1. When the children contains components - because a functional component
  13829. // may return an Array instead of a single root. In this case, just a simple
  13830. // nomralization is needed - if any child is an Array, we flatten the whole
  13831. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  13832. // because functional components already normalize their own children.
  13833. function simpleNormalizeChildren (children) {
  13834. for (var i = 0; i < children.length; i++) {
  13835. if (Array.isArray(children[i])) {
  13836. return Array.prototype.concat.apply([], children)
  13837. }
  13838. }
  13839. return children
  13840. }
  13841. // 2. When the children contains constrcuts that always generated nested Arrays,
  13842. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  13843. // with hand-written render functions / JSX. In such cases a full normalization
  13844. // is needed to cater to all possible types of children values.
  13845. function normalizeChildren (children) {
  13846. return isPrimitive(children)
  13847. ? [createTextVNode(children)]
  13848. : Array.isArray(children)
  13849. ? normalizeArrayChildren(children)
  13850. : undefined
  13851. }
  13852. function normalizeArrayChildren (children, nestedIndex) {
  13853. var res = [];
  13854. var i, c, last;
  13855. for (i = 0; i < children.length; i++) {
  13856. c = children[i];
  13857. if (c == null || typeof c === 'boolean') { continue }
  13858. last = res[res.length - 1];
  13859. // nested
  13860. if (Array.isArray(c)) {
  13861. res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
  13862. } else if (isPrimitive(c)) {
  13863. if (last && last.text) {
  13864. last.text += String(c);
  13865. } else if (c !== '') {
  13866. // convert primitive to vnode
  13867. res.push(createTextVNode(c));
  13868. }
  13869. } else {
  13870. if (c.text && last && last.text) {
  13871. res[res.length - 1] = createTextVNode(last.text + c.text);
  13872. } else {
  13873. // default key for nested array children (likely generated by v-for)
  13874. if (c.tag && c.key == null && nestedIndex != null) {
  13875. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  13876. }
  13877. res.push(c);
  13878. }
  13879. }
  13880. }
  13881. return res
  13882. }
  13883. /* */
  13884. function getFirstComponentChild (children) {
  13885. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  13886. }
  13887. /* */
  13888. var SIMPLE_NORMALIZE = 1;
  13889. var ALWAYS_NORMALIZE = 2;
  13890. // wrapper function for providing a more flexible interface
  13891. // without getting yelled at by flow
  13892. function createElement (
  13893. context,
  13894. tag,
  13895. data,
  13896. children,
  13897. normalizationType,
  13898. alwaysNormalize
  13899. ) {
  13900. if (Array.isArray(data) || isPrimitive(data)) {
  13901. normalizationType = children;
  13902. children = data;
  13903. data = undefined;
  13904. }
  13905. if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  13906. return _createElement(context, tag, data, children, normalizationType)
  13907. }
  13908. function _createElement (
  13909. context,
  13910. tag,
  13911. data,
  13912. children,
  13913. normalizationType
  13914. ) {
  13915. if (data && data.__ob__) {
  13916. process.env.NODE_ENV !== 'production' && warn(
  13917. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  13918. 'Always create fresh vnode data objects in each render!',
  13919. context
  13920. );
  13921. return createEmptyVNode()
  13922. }
  13923. if (!tag) {
  13924. // in case of component :is set to falsy value
  13925. return createEmptyVNode()
  13926. }
  13927. // support single function children as default scoped slot
  13928. if (Array.isArray(children) &&
  13929. typeof children[0] === 'function') {
  13930. data = data || {};
  13931. data.scopedSlots = { default: children[0] };
  13932. children.length = 0;
  13933. }
  13934. if (normalizationType === ALWAYS_NORMALIZE) {
  13935. children = normalizeChildren(children);
  13936. } else if (normalizationType === SIMPLE_NORMALIZE) {
  13937. children = simpleNormalizeChildren(children);
  13938. }
  13939. var vnode, ns;
  13940. if (typeof tag === 'string') {
  13941. var Ctor;
  13942. ns = config.getTagNamespace(tag);
  13943. if (config.isReservedTag(tag)) {
  13944. // platform built-in elements
  13945. vnode = new VNode(
  13946. config.parsePlatformTagName(tag), data, children,
  13947. undefined, undefined, context
  13948. );
  13949. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  13950. // component
  13951. vnode = createComponent(Ctor, data, context, children, tag);
  13952. } else {
  13953. // unknown or unlisted namespaced elements
  13954. // check at runtime because it may get assigned a namespace when its
  13955. // parent normalizes children
  13956. vnode = new VNode(
  13957. tag, data, children,
  13958. undefined, undefined, context
  13959. );
  13960. }
  13961. } else {
  13962. // direct component options / constructor
  13963. vnode = createComponent(tag, data, context, children);
  13964. }
  13965. if (vnode) {
  13966. if (ns) { applyNS(vnode, ns); }
  13967. return vnode
  13968. } else {
  13969. return createEmptyVNode()
  13970. }
  13971. }
  13972. function applyNS (vnode, ns) {
  13973. vnode.ns = ns;
  13974. if (vnode.tag === 'foreignObject') {
  13975. // use default namespace inside foreignObject
  13976. return
  13977. }
  13978. if (vnode.children) {
  13979. for (var i = 0, l = vnode.children.length; i < l; i++) {
  13980. var child = vnode.children[i];
  13981. if (child.tag && !child.ns) {
  13982. applyNS(child, ns);
  13983. }
  13984. }
  13985. }
  13986. }
  13987. /* */
  13988. function initRender (vm) {
  13989. vm.$vnode = null; // the placeholder node in parent tree
  13990. vm._vnode = null; // the root of the child tree
  13991. vm._staticTrees = null;
  13992. var parentVnode = vm.$options._parentVnode;
  13993. var renderContext = parentVnode && parentVnode.context;
  13994. vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
  13995. vm.$scopedSlots = {};
  13996. // bind the createElement fn to this instance
  13997. // so that we get proper render context inside it.
  13998. // args order: tag, data, children, normalizationType, alwaysNormalize
  13999. // internal version is used by render functions compiled from templates
  14000. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  14001. // normalization is always applied for the public version, used in
  14002. // user-written render functions.
  14003. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  14004. }
  14005. function renderMixin (Vue) {
  14006. Vue.prototype.$nextTick = function (fn) {
  14007. return nextTick(fn, this)
  14008. };
  14009. Vue.prototype._render = function () {
  14010. var vm = this;
  14011. var ref = vm.$options;
  14012. var render = ref.render;
  14013. var staticRenderFns = ref.staticRenderFns;
  14014. var _parentVnode = ref._parentVnode;
  14015. if (vm._isMounted) {
  14016. // clone slot nodes on re-renders
  14017. for (var key in vm.$slots) {
  14018. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  14019. }
  14020. }
  14021. if (_parentVnode && _parentVnode.data.scopedSlots) {
  14022. vm.$scopedSlots = _parentVnode.data.scopedSlots;
  14023. }
  14024. if (staticRenderFns && !vm._staticTrees) {
  14025. vm._staticTrees = [];
  14026. }
  14027. // set parent vnode. this allows render functions to have access
  14028. // to the data on the placeholder node.
  14029. vm.$vnode = _parentVnode;
  14030. // render self
  14031. var vnode;
  14032. try {
  14033. vnode = render.call(vm._renderProxy, vm.$createElement);
  14034. } catch (e) {
  14035. /* istanbul ignore else */
  14036. if (config.errorHandler) {
  14037. config.errorHandler.call(null, e, vm);
  14038. } else {
  14039. if (process.env.NODE_ENV !== 'production') {
  14040. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  14041. }
  14042. throw e
  14043. }
  14044. // return previous vnode to prevent render error causing blank component
  14045. vnode = vm._vnode;
  14046. }
  14047. // return empty vnode in case the render function errored out
  14048. if (!(vnode instanceof VNode)) {
  14049. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  14050. warn(
  14051. 'Multiple root nodes returned from render function. Render function ' +
  14052. 'should return a single root node.',
  14053. vm
  14054. );
  14055. }
  14056. vnode = createEmptyVNode();
  14057. }
  14058. // set parent
  14059. vnode.parent = _parentVnode;
  14060. return vnode
  14061. };
  14062. // toString for mustaches
  14063. Vue.prototype._s = _toString;
  14064. // convert text to vnode
  14065. Vue.prototype._v = createTextVNode;
  14066. // number conversion
  14067. Vue.prototype._n = toNumber;
  14068. // empty vnode
  14069. Vue.prototype._e = createEmptyVNode;
  14070. // loose equal
  14071. Vue.prototype._q = looseEqual;
  14072. // loose indexOf
  14073. Vue.prototype._i = looseIndexOf;
  14074. // render static tree by index
  14075. Vue.prototype._m = function renderStatic (
  14076. index,
  14077. isInFor
  14078. ) {
  14079. var tree = this._staticTrees[index];
  14080. // if has already-rendered static tree and not inside v-for,
  14081. // we can reuse the same tree by doing a shallow clone.
  14082. if (tree && !isInFor) {
  14083. return Array.isArray(tree)
  14084. ? cloneVNodes(tree)
  14085. : cloneVNode(tree)
  14086. }
  14087. // otherwise, render a fresh tree.
  14088. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  14089. markStatic(tree, ("__static__" + index), false);
  14090. return tree
  14091. };
  14092. // mark node as static (v-once)
  14093. Vue.prototype._o = function markOnce (
  14094. tree,
  14095. index,
  14096. key
  14097. ) {
  14098. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  14099. return tree
  14100. };
  14101. function markStatic (tree, key, isOnce) {
  14102. if (Array.isArray(tree)) {
  14103. for (var i = 0; i < tree.length; i++) {
  14104. if (tree[i] && typeof tree[i] !== 'string') {
  14105. markStaticNode(tree[i], (key + "_" + i), isOnce);
  14106. }
  14107. }
  14108. } else {
  14109. markStaticNode(tree, key, isOnce);
  14110. }
  14111. }
  14112. function markStaticNode (node, key, isOnce) {
  14113. node.isStatic = true;
  14114. node.key = key;
  14115. node.isOnce = isOnce;
  14116. }
  14117. // filter resolution helper
  14118. Vue.prototype._f = function resolveFilter (id) {
  14119. return resolveAsset(this.$options, 'filters', id, true) || identity
  14120. };
  14121. // render v-for
  14122. Vue.prototype._l = function renderList (
  14123. val,
  14124. render
  14125. ) {
  14126. var ret, i, l, keys, key;
  14127. if (Array.isArray(val) || typeof val === 'string') {
  14128. ret = new Array(val.length);
  14129. for (i = 0, l = val.length; i < l; i++) {
  14130. ret[i] = render(val[i], i);
  14131. }
  14132. } else if (typeof val === 'number') {
  14133. ret = new Array(val);
  14134. for (i = 0; i < val; i++) {
  14135. ret[i] = render(i + 1, i);
  14136. }
  14137. } else if (isObject(val)) {
  14138. keys = Object.keys(val);
  14139. ret = new Array(keys.length);
  14140. for (i = 0, l = keys.length; i < l; i++) {
  14141. key = keys[i];
  14142. ret[i] = render(val[key], key, i);
  14143. }
  14144. }
  14145. return ret
  14146. };
  14147. // renderSlot
  14148. Vue.prototype._t = function (
  14149. name,
  14150. fallback,
  14151. props,
  14152. bindObject
  14153. ) {
  14154. var scopedSlotFn = this.$scopedSlots[name];
  14155. if (scopedSlotFn) { // scoped slot
  14156. props = props || {};
  14157. if (bindObject) {
  14158. extend(props, bindObject);
  14159. }
  14160. return scopedSlotFn(props) || fallback
  14161. } else {
  14162. var slotNodes = this.$slots[name];
  14163. // warn duplicate slot usage
  14164. if (slotNodes && process.env.NODE_ENV !== 'production') {
  14165. slotNodes._rendered && warn(
  14166. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  14167. "- this will likely cause render errors.",
  14168. this
  14169. );
  14170. slotNodes._rendered = true;
  14171. }
  14172. return slotNodes || fallback
  14173. }
  14174. };
  14175. // apply v-bind object
  14176. Vue.prototype._b = function bindProps (
  14177. data,
  14178. tag,
  14179. value,
  14180. asProp
  14181. ) {
  14182. if (value) {
  14183. if (!isObject(value)) {
  14184. process.env.NODE_ENV !== 'production' && warn(
  14185. 'v-bind without argument expects an Object or Array value',
  14186. this
  14187. );
  14188. } else {
  14189. if (Array.isArray(value)) {
  14190. value = toObject(value);
  14191. }
  14192. for (var key in value) {
  14193. if (key === 'class' || key === 'style') {
  14194. data[key] = value[key];
  14195. } else {
  14196. var type = data.attrs && data.attrs.type;
  14197. var hash = asProp || config.mustUseProp(tag, type, key)
  14198. ? data.domProps || (data.domProps = {})
  14199. : data.attrs || (data.attrs = {});
  14200. hash[key] = value[key];
  14201. }
  14202. }
  14203. }
  14204. }
  14205. return data
  14206. };
  14207. // check v-on keyCodes
  14208. Vue.prototype._k = function checkKeyCodes (
  14209. eventKeyCode,
  14210. key,
  14211. builtInAlias
  14212. ) {
  14213. var keyCodes = config.keyCodes[key] || builtInAlias;
  14214. if (Array.isArray(keyCodes)) {
  14215. return keyCodes.indexOf(eventKeyCode) === -1
  14216. } else {
  14217. return keyCodes !== eventKeyCode
  14218. }
  14219. };
  14220. }
  14221. function resolveSlots (
  14222. children,
  14223. context
  14224. ) {
  14225. var slots = {};
  14226. if (!children) {
  14227. return slots
  14228. }
  14229. var defaultSlot = [];
  14230. var name, child;
  14231. for (var i = 0, l = children.length; i < l; i++) {
  14232. child = children[i];
  14233. // named slots should only be respected if the vnode was rendered in the
  14234. // same context.
  14235. if ((child.context === context || child.functionalContext === context) &&
  14236. child.data && (name = child.data.slot)) {
  14237. var slot = (slots[name] || (slots[name] = []));
  14238. if (child.tag === 'template') {
  14239. slot.push.apply(slot, child.children);
  14240. } else {
  14241. slot.push(child);
  14242. }
  14243. } else {
  14244. defaultSlot.push(child);
  14245. }
  14246. }
  14247. // ignore single whitespace
  14248. if (defaultSlot.length && !(
  14249. defaultSlot.length === 1 &&
  14250. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  14251. )) {
  14252. slots.default = defaultSlot;
  14253. }
  14254. return slots
  14255. }
  14256. /* */
  14257. function initEvents (vm) {
  14258. vm._events = Object.create(null);
  14259. vm._hasHookEvent = false;
  14260. // init parent attached events
  14261. var listeners = vm.$options._parentListeners;
  14262. if (listeners) {
  14263. updateComponentListeners(vm, listeners);
  14264. }
  14265. }
  14266. var target;
  14267. function add$1 (event, fn, once) {
  14268. if (once) {
  14269. target.$once(event, fn);
  14270. } else {
  14271. target.$on(event, fn);
  14272. }
  14273. }
  14274. function remove$2 (event, fn) {
  14275. target.$off(event, fn);
  14276. }
  14277. function updateComponentListeners (
  14278. vm,
  14279. listeners,
  14280. oldListeners
  14281. ) {
  14282. target = vm;
  14283. updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
  14284. }
  14285. function eventsMixin (Vue) {
  14286. var hookRE = /^hook:/;
  14287. Vue.prototype.$on = function (event, fn) {
  14288. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  14289. // optimize hook:event cost by using a boolean flag marked at registration
  14290. // instead of a hash lookup
  14291. if (hookRE.test(event)) {
  14292. vm._hasHookEvent = true;
  14293. }
  14294. return vm
  14295. };
  14296. Vue.prototype.$once = function (event, fn) {
  14297. var vm = this;
  14298. function on () {
  14299. vm.$off(event, on);
  14300. fn.apply(vm, arguments);
  14301. }
  14302. on.fn = fn;
  14303. vm.$on(event, on);
  14304. return vm
  14305. };
  14306. Vue.prototype.$off = function (event, fn) {
  14307. var vm = this;
  14308. // all
  14309. if (!arguments.length) {
  14310. vm._events = Object.create(null);
  14311. return vm
  14312. }
  14313. // specific event
  14314. var cbs = vm._events[event];
  14315. if (!cbs) {
  14316. return vm
  14317. }
  14318. if (arguments.length === 1) {
  14319. vm._events[event] = null;
  14320. return vm
  14321. }
  14322. // specific handler
  14323. var cb;
  14324. var i = cbs.length;
  14325. while (i--) {
  14326. cb = cbs[i];
  14327. if (cb === fn || cb.fn === fn) {
  14328. cbs.splice(i, 1);
  14329. break
  14330. }
  14331. }
  14332. return vm
  14333. };
  14334. Vue.prototype.$emit = function (event) {
  14335. var vm = this;
  14336. var cbs = vm._events[event];
  14337. if (cbs) {
  14338. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  14339. var args = toArray(arguments, 1);
  14340. for (var i = 0, l = cbs.length; i < l; i++) {
  14341. cbs[i].apply(vm, args);
  14342. }
  14343. }
  14344. return vm
  14345. };
  14346. }
  14347. /* */
  14348. var activeInstance = null;
  14349. function initLifecycle (vm) {
  14350. var options = vm.$options;
  14351. // locate first non-abstract parent
  14352. var parent = options.parent;
  14353. if (parent && !options.abstract) {
  14354. while (parent.$options.abstract && parent.$parent) {
  14355. parent = parent.$parent;
  14356. }
  14357. parent.$children.push(vm);
  14358. }
  14359. vm.$parent = parent;
  14360. vm.$root = parent ? parent.$root : vm;
  14361. vm.$children = [];
  14362. vm.$refs = {};
  14363. vm._watcher = null;
  14364. vm._inactive = false;
  14365. vm._isMounted = false;
  14366. vm._isDestroyed = false;
  14367. vm._isBeingDestroyed = false;
  14368. }
  14369. function lifecycleMixin (Vue) {
  14370. Vue.prototype._mount = function (
  14371. el,
  14372. hydrating
  14373. ) {
  14374. var vm = this;
  14375. vm.$el = el;
  14376. if (!vm.$options.render) {
  14377. vm.$options.render = createEmptyVNode;
  14378. if (process.env.NODE_ENV !== 'production') {
  14379. /* istanbul ignore if */
  14380. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  14381. warn(
  14382. 'You are using the runtime-only build of Vue where the template ' +
  14383. 'option is not available. Either pre-compile the templates into ' +
  14384. 'render functions, or use the compiler-included build.',
  14385. vm
  14386. );
  14387. } else {
  14388. warn(
  14389. 'Failed to mount component: template or render function not defined.',
  14390. vm
  14391. );
  14392. }
  14393. }
  14394. }
  14395. callHook(vm, 'beforeMount');
  14396. vm._watcher = new Watcher(vm, function updateComponent () {
  14397. vm._update(vm._render(), hydrating);
  14398. }, noop);
  14399. hydrating = false;
  14400. // manually mounted instance, call mounted on self
  14401. // mounted is called for render-created child components in its inserted hook
  14402. if (vm.$vnode == null) {
  14403. vm._isMounted = true;
  14404. callHook(vm, 'mounted');
  14405. }
  14406. return vm
  14407. };
  14408. Vue.prototype._update = function (vnode, hydrating) {
  14409. var vm = this;
  14410. if (vm._isMounted) {
  14411. callHook(vm, 'beforeUpdate');
  14412. }
  14413. var prevEl = vm.$el;
  14414. var prevVnode = vm._vnode;
  14415. var prevActiveInstance = activeInstance;
  14416. activeInstance = vm;
  14417. vm._vnode = vnode;
  14418. // Vue.prototype.__patch__ is injected in entry points
  14419. // based on the rendering backend used.
  14420. if (!prevVnode) {
  14421. // initial render
  14422. vm.$el = vm.__patch__(
  14423. vm.$el, vnode, hydrating, false /* removeOnly */,
  14424. vm.$options._parentElm,
  14425. vm.$options._refElm
  14426. );
  14427. } else {
  14428. // updates
  14429. vm.$el = vm.__patch__(prevVnode, vnode);
  14430. }
  14431. activeInstance = prevActiveInstance;
  14432. // update __vue__ reference
  14433. if (prevEl) {
  14434. prevEl.__vue__ = null;
  14435. }
  14436. if (vm.$el) {
  14437. vm.$el.__vue__ = vm;
  14438. }
  14439. // if parent is an HOC, update its $el as well
  14440. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  14441. vm.$parent.$el = vm.$el;
  14442. }
  14443. // updated hook is called by the scheduler to ensure that children are
  14444. // updated in a parent's updated hook.
  14445. };
  14446. Vue.prototype._updateFromParent = function (
  14447. propsData,
  14448. listeners,
  14449. parentVnode,
  14450. renderChildren
  14451. ) {
  14452. var vm = this;
  14453. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  14454. vm.$options._parentVnode = parentVnode;
  14455. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  14456. if (vm._vnode) { // update child tree's parent
  14457. vm._vnode.parent = parentVnode;
  14458. }
  14459. vm.$options._renderChildren = renderChildren;
  14460. // update props
  14461. if (propsData && vm.$options.props) {
  14462. observerState.shouldConvert = false;
  14463. if (process.env.NODE_ENV !== 'production') {
  14464. observerState.isSettingProps = true;
  14465. }
  14466. var propKeys = vm.$options._propKeys || [];
  14467. for (var i = 0; i < propKeys.length; i++) {
  14468. var key = propKeys[i];
  14469. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  14470. }
  14471. observerState.shouldConvert = true;
  14472. if (process.env.NODE_ENV !== 'production') {
  14473. observerState.isSettingProps = false;
  14474. }
  14475. vm.$options.propsData = propsData;
  14476. }
  14477. // update listeners
  14478. if (listeners) {
  14479. var oldListeners = vm.$options._parentListeners;
  14480. vm.$options._parentListeners = listeners;
  14481. updateComponentListeners(vm, listeners, oldListeners);
  14482. }
  14483. // resolve slots + force update if has children
  14484. if (hasChildren) {
  14485. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  14486. vm.$forceUpdate();
  14487. }
  14488. };
  14489. Vue.prototype.$forceUpdate = function () {
  14490. var vm = this;
  14491. if (vm._watcher) {
  14492. vm._watcher.update();
  14493. }
  14494. };
  14495. Vue.prototype.$destroy = function () {
  14496. var vm = this;
  14497. if (vm._isBeingDestroyed) {
  14498. return
  14499. }
  14500. callHook(vm, 'beforeDestroy');
  14501. vm._isBeingDestroyed = true;
  14502. // remove self from parent
  14503. var parent = vm.$parent;
  14504. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  14505. remove$1(parent.$children, vm);
  14506. }
  14507. // teardown watchers
  14508. if (vm._watcher) {
  14509. vm._watcher.teardown();
  14510. }
  14511. var i = vm._watchers.length;
  14512. while (i--) {
  14513. vm._watchers[i].teardown();
  14514. }
  14515. // remove reference from data ob
  14516. // frozen object may not have observer.
  14517. if (vm._data.__ob__) {
  14518. vm._data.__ob__.vmCount--;
  14519. }
  14520. // call the last hook...
  14521. vm._isDestroyed = true;
  14522. callHook(vm, 'destroyed');
  14523. // turn off all instance listeners.
  14524. vm.$off();
  14525. // remove __vue__ reference
  14526. if (vm.$el) {
  14527. vm.$el.__vue__ = null;
  14528. }
  14529. // invoke destroy hooks on current rendered tree
  14530. vm.__patch__(vm._vnode, null);
  14531. };
  14532. }
  14533. function callHook (vm, hook) {
  14534. var handlers = vm.$options[hook];
  14535. if (handlers) {
  14536. for (var i = 0, j = handlers.length; i < j; i++) {
  14537. handlers[i].call(vm);
  14538. }
  14539. }
  14540. if (vm._hasHookEvent) {
  14541. vm.$emit('hook:' + hook);
  14542. }
  14543. }
  14544. /* */
  14545. var queue = [];
  14546. var has$1 = {};
  14547. var circular = {};
  14548. var waiting = false;
  14549. var flushing = false;
  14550. var index = 0;
  14551. /**
  14552. * Reset the scheduler's state.
  14553. */
  14554. function resetSchedulerState () {
  14555. queue.length = 0;
  14556. has$1 = {};
  14557. if (process.env.NODE_ENV !== 'production') {
  14558. circular = {};
  14559. }
  14560. waiting = flushing = false;
  14561. }
  14562. /**
  14563. * Flush both queues and run the watchers.
  14564. */
  14565. function flushSchedulerQueue () {
  14566. flushing = true;
  14567. var watcher, id, vm;
  14568. // Sort queue before flush.
  14569. // This ensures that:
  14570. // 1. Components are updated from parent to child. (because parent is always
  14571. // created before the child)
  14572. // 2. A component's user watchers are run before its render watcher (because
  14573. // user watchers are created before the render watcher)
  14574. // 3. If a component is destroyed during a parent component's watcher run,
  14575. // its watchers can be skipped.
  14576. queue.sort(function (a, b) { return a.id - b.id; });
  14577. // do not cache length because more watchers might be pushed
  14578. // as we run existing watchers
  14579. for (index = 0; index < queue.length; index++) {
  14580. watcher = queue[index];
  14581. id = watcher.id;
  14582. has$1[id] = null;
  14583. watcher.run();
  14584. // in dev build, check and stop circular updates.
  14585. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  14586. circular[id] = (circular[id] || 0) + 1;
  14587. if (circular[id] > config._maxUpdateCount) {
  14588. warn(
  14589. 'You may have an infinite update loop ' + (
  14590. watcher.user
  14591. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  14592. : "in a component render function."
  14593. ),
  14594. watcher.vm
  14595. );
  14596. break
  14597. }
  14598. }
  14599. }
  14600. // call updated hooks
  14601. index = queue.length;
  14602. while (index--) {
  14603. watcher = queue[index];
  14604. vm = watcher.vm;
  14605. if (vm._watcher === watcher && vm._isMounted) {
  14606. callHook(vm, 'updated');
  14607. }
  14608. }
  14609. // devtool hook
  14610. /* istanbul ignore if */
  14611. if (devtools && config.devtools) {
  14612. devtools.emit('flush');
  14613. }
  14614. resetSchedulerState();
  14615. }
  14616. /**
  14617. * Push a watcher into the watcher queue.
  14618. * Jobs with duplicate IDs will be skipped unless it's
  14619. * pushed when the queue is being flushed.
  14620. */
  14621. function queueWatcher (watcher) {
  14622. var id = watcher.id;
  14623. if (has$1[id] == null) {
  14624. has$1[id] = true;
  14625. if (!flushing) {
  14626. queue.push(watcher);
  14627. } else {
  14628. // if already flushing, splice the watcher based on its id
  14629. // if already past its id, it will be run next immediately.
  14630. var i = queue.length - 1;
  14631. while (i >= 0 && queue[i].id > watcher.id) {
  14632. i--;
  14633. }
  14634. queue.splice(Math.max(i, index) + 1, 0, watcher);
  14635. }
  14636. // queue the flush
  14637. if (!waiting) {
  14638. waiting = true;
  14639. nextTick(flushSchedulerQueue);
  14640. }
  14641. }
  14642. }
  14643. /* */
  14644. var uid$2 = 0;
  14645. /**
  14646. * A watcher parses an expression, collects dependencies,
  14647. * and fires callback when the expression value changes.
  14648. * This is used for both the $watch() api and directives.
  14649. */
  14650. var Watcher = function Watcher (
  14651. vm,
  14652. expOrFn,
  14653. cb,
  14654. options
  14655. ) {
  14656. this.vm = vm;
  14657. vm._watchers.push(this);
  14658. // options
  14659. if (options) {
  14660. this.deep = !!options.deep;
  14661. this.user = !!options.user;
  14662. this.lazy = !!options.lazy;
  14663. this.sync = !!options.sync;
  14664. } else {
  14665. this.deep = this.user = this.lazy = this.sync = false;
  14666. }
  14667. this.cb = cb;
  14668. this.id = ++uid$2; // uid for batching
  14669. this.active = true;
  14670. this.dirty = this.lazy; // for lazy watchers
  14671. this.deps = [];
  14672. this.newDeps = [];
  14673. this.depIds = new _Set();
  14674. this.newDepIds = new _Set();
  14675. this.expression = process.env.NODE_ENV !== 'production'
  14676. ? expOrFn.toString()
  14677. : '';
  14678. // parse expression for getter
  14679. if (typeof expOrFn === 'function') {
  14680. this.getter = expOrFn;
  14681. } else {
  14682. this.getter = parsePath(expOrFn);
  14683. if (!this.getter) {
  14684. this.getter = function () {};
  14685. process.env.NODE_ENV !== 'production' && warn(
  14686. "Failed watching path: \"" + expOrFn + "\" " +
  14687. 'Watcher only accepts simple dot-delimited paths. ' +
  14688. 'For full control, use a function instead.',
  14689. vm
  14690. );
  14691. }
  14692. }
  14693. this.value = this.lazy
  14694. ? undefined
  14695. : this.get();
  14696. };
  14697. /**
  14698. * Evaluate the getter, and re-collect dependencies.
  14699. */
  14700. Watcher.prototype.get = function get () {
  14701. pushTarget(this);
  14702. var value = this.getter.call(this.vm, this.vm);
  14703. // "touch" every property so they are all tracked as
  14704. // dependencies for deep watching
  14705. if (this.deep) {
  14706. traverse(value);
  14707. }
  14708. popTarget();
  14709. this.cleanupDeps();
  14710. return value
  14711. };
  14712. /**
  14713. * Add a dependency to this directive.
  14714. */
  14715. Watcher.prototype.addDep = function addDep (dep) {
  14716. var id = dep.id;
  14717. if (!this.newDepIds.has(id)) {
  14718. this.newDepIds.add(id);
  14719. this.newDeps.push(dep);
  14720. if (!this.depIds.has(id)) {
  14721. dep.addSub(this);
  14722. }
  14723. }
  14724. };
  14725. /**
  14726. * Clean up for dependency collection.
  14727. */
  14728. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  14729. var this$1 = this;
  14730. var i = this.deps.length;
  14731. while (i--) {
  14732. var dep = this$1.deps[i];
  14733. if (!this$1.newDepIds.has(dep.id)) {
  14734. dep.removeSub(this$1);
  14735. }
  14736. }
  14737. var tmp = this.depIds;
  14738. this.depIds = this.newDepIds;
  14739. this.newDepIds = tmp;
  14740. this.newDepIds.clear();
  14741. tmp = this.deps;
  14742. this.deps = this.newDeps;
  14743. this.newDeps = tmp;
  14744. this.newDeps.length = 0;
  14745. };
  14746. /**
  14747. * Subscriber interface.
  14748. * Will be called when a dependency changes.
  14749. */
  14750. Watcher.prototype.update = function update () {
  14751. /* istanbul ignore else */
  14752. if (this.lazy) {
  14753. this.dirty = true;
  14754. } else if (this.sync) {
  14755. this.run();
  14756. } else {
  14757. queueWatcher(this);
  14758. }
  14759. };
  14760. /**
  14761. * Scheduler job interface.
  14762. * Will be called by the scheduler.
  14763. */
  14764. Watcher.prototype.run = function run () {
  14765. if (this.active) {
  14766. var value = this.get();
  14767. if (
  14768. value !== this.value ||
  14769. // Deep watchers and watchers on Object/Arrays should fire even
  14770. // when the value is the same, because the value may
  14771. // have mutated.
  14772. isObject(value) ||
  14773. this.deep
  14774. ) {
  14775. // set new value
  14776. var oldValue = this.value;
  14777. this.value = value;
  14778. if (this.user) {
  14779. try {
  14780. this.cb.call(this.vm, value, oldValue);
  14781. } catch (e) {
  14782. /* istanbul ignore else */
  14783. if (config.errorHandler) {
  14784. config.errorHandler.call(null, e, this.vm);
  14785. } else {
  14786. process.env.NODE_ENV !== 'production' && warn(
  14787. ("Error in watcher \"" + (this.expression) + "\""),
  14788. this.vm
  14789. );
  14790. throw e
  14791. }
  14792. }
  14793. } else {
  14794. this.cb.call(this.vm, value, oldValue);
  14795. }
  14796. }
  14797. }
  14798. };
  14799. /**
  14800. * Evaluate the value of the watcher.
  14801. * This only gets called for lazy watchers.
  14802. */
  14803. Watcher.prototype.evaluate = function evaluate () {
  14804. this.value = this.get();
  14805. this.dirty = false;
  14806. };
  14807. /**
  14808. * Depend on all deps collected by this watcher.
  14809. */
  14810. Watcher.prototype.depend = function depend () {
  14811. var this$1 = this;
  14812. var i = this.deps.length;
  14813. while (i--) {
  14814. this$1.deps[i].depend();
  14815. }
  14816. };
  14817. /**
  14818. * Remove self from all dependencies' subscriber list.
  14819. */
  14820. Watcher.prototype.teardown = function teardown () {
  14821. var this$1 = this;
  14822. if (this.active) {
  14823. // remove self from vm's watcher list
  14824. // this is a somewhat expensive operation so we skip it
  14825. // if the vm is being destroyed.
  14826. if (!this.vm._isBeingDestroyed) {
  14827. remove$1(this.vm._watchers, this);
  14828. }
  14829. var i = this.deps.length;
  14830. while (i--) {
  14831. this$1.deps[i].removeSub(this$1);
  14832. }
  14833. this.active = false;
  14834. }
  14835. };
  14836. /**
  14837. * Recursively traverse an object to evoke all converted
  14838. * getters, so that every nested property inside the object
  14839. * is collected as a "deep" dependency.
  14840. */
  14841. var seenObjects = new _Set();
  14842. function traverse (val) {
  14843. seenObjects.clear();
  14844. _traverse(val, seenObjects);
  14845. }
  14846. function _traverse (val, seen) {
  14847. var i, keys;
  14848. var isA = Array.isArray(val);
  14849. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  14850. return
  14851. }
  14852. if (val.__ob__) {
  14853. var depId = val.__ob__.dep.id;
  14854. if (seen.has(depId)) {
  14855. return
  14856. }
  14857. seen.add(depId);
  14858. }
  14859. if (isA) {
  14860. i = val.length;
  14861. while (i--) { _traverse(val[i], seen); }
  14862. } else {
  14863. keys = Object.keys(val);
  14864. i = keys.length;
  14865. while (i--) { _traverse(val[keys[i]], seen); }
  14866. }
  14867. }
  14868. /* */
  14869. function initState (vm) {
  14870. vm._watchers = [];
  14871. var opts = vm.$options;
  14872. if (opts.props) { initProps(vm, opts.props); }
  14873. if (opts.methods) { initMethods(vm, opts.methods); }
  14874. if (opts.data) {
  14875. initData(vm);
  14876. } else {
  14877. observe(vm._data = {}, true /* asRootData */);
  14878. }
  14879. if (opts.computed) { initComputed(vm, opts.computed); }
  14880. if (opts.watch) { initWatch(vm, opts.watch); }
  14881. }
  14882. var isReservedProp = { key: 1, ref: 1, slot: 1 };
  14883. function initProps (vm, props) {
  14884. var propsData = vm.$options.propsData || {};
  14885. var keys = vm.$options._propKeys = Object.keys(props);
  14886. var isRoot = !vm.$parent;
  14887. // root instance props should be converted
  14888. observerState.shouldConvert = isRoot;
  14889. var loop = function ( i ) {
  14890. var key = keys[i];
  14891. /* istanbul ignore else */
  14892. if (process.env.NODE_ENV !== 'production') {
  14893. if (isReservedProp[key]) {
  14894. warn(
  14895. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  14896. vm
  14897. );
  14898. }
  14899. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  14900. if (vm.$parent && !observerState.isSettingProps) {
  14901. warn(
  14902. "Avoid mutating a prop directly since the value will be " +
  14903. "overwritten whenever the parent component re-renders. " +
  14904. "Instead, use a data or computed property based on the prop's " +
  14905. "value. Prop being mutated: \"" + key + "\"",
  14906. vm
  14907. );
  14908. }
  14909. });
  14910. } else {
  14911. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  14912. }
  14913. };
  14914. for (var i = 0; i < keys.length; i++) loop( i );
  14915. observerState.shouldConvert = true;
  14916. }
  14917. function initData (vm) {
  14918. var data = vm.$options.data;
  14919. data = vm._data = typeof data === 'function'
  14920. ? data.call(vm)
  14921. : data || {};
  14922. if (!isPlainObject(data)) {
  14923. data = {};
  14924. process.env.NODE_ENV !== 'production' && warn(
  14925. 'data functions should return an object:\n' +
  14926. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  14927. vm
  14928. );
  14929. }
  14930. // proxy data on instance
  14931. var keys = Object.keys(data);
  14932. var props = vm.$options.props;
  14933. var i = keys.length;
  14934. while (i--) {
  14935. if (props && hasOwn(props, keys[i])) {
  14936. process.env.NODE_ENV !== 'production' && warn(
  14937. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  14938. "Use prop default value instead.",
  14939. vm
  14940. );
  14941. } else {
  14942. proxy(vm, keys[i]);
  14943. }
  14944. }
  14945. // observe data
  14946. observe(data, true /* asRootData */);
  14947. }
  14948. var computedSharedDefinition = {
  14949. enumerable: true,
  14950. configurable: true,
  14951. get: noop,
  14952. set: noop
  14953. };
  14954. function initComputed (vm, computed) {
  14955. for (var key in computed) {
  14956. /* istanbul ignore if */
  14957. if (process.env.NODE_ENV !== 'production' && key in vm) {
  14958. warn(
  14959. "existing instance property \"" + key + "\" will be " +
  14960. "overwritten by a computed property with the same name.",
  14961. vm
  14962. );
  14963. }
  14964. var userDef = computed[key];
  14965. if (typeof userDef === 'function') {
  14966. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  14967. computedSharedDefinition.set = noop;
  14968. } else {
  14969. computedSharedDefinition.get = userDef.get
  14970. ? userDef.cache !== false
  14971. ? makeComputedGetter(userDef.get, vm)
  14972. : bind$1(userDef.get, vm)
  14973. : noop;
  14974. computedSharedDefinition.set = userDef.set
  14975. ? bind$1(userDef.set, vm)
  14976. : noop;
  14977. }
  14978. Object.defineProperty(vm, key, computedSharedDefinition);
  14979. }
  14980. }
  14981. function makeComputedGetter (getter, owner) {
  14982. var watcher = new Watcher(owner, getter, noop, {
  14983. lazy: true
  14984. });
  14985. return function computedGetter () {
  14986. if (watcher.dirty) {
  14987. watcher.evaluate();
  14988. }
  14989. if (Dep.target) {
  14990. watcher.depend();
  14991. }
  14992. return watcher.value
  14993. }
  14994. }
  14995. function initMethods (vm, methods) {
  14996. for (var key in methods) {
  14997. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  14998. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  14999. warn(
  15000. "method \"" + key + "\" has an undefined value in the component definition. " +
  15001. "Did you reference the function correctly?",
  15002. vm
  15003. );
  15004. }
  15005. }
  15006. }
  15007. function initWatch (vm, watch) {
  15008. for (var key in watch) {
  15009. var handler = watch[key];
  15010. if (Array.isArray(handler)) {
  15011. for (var i = 0; i < handler.length; i++) {
  15012. createWatcher(vm, key, handler[i]);
  15013. }
  15014. } else {
  15015. createWatcher(vm, key, handler);
  15016. }
  15017. }
  15018. }
  15019. function createWatcher (vm, key, handler) {
  15020. var options;
  15021. if (isPlainObject(handler)) {
  15022. options = handler;
  15023. handler = handler.handler;
  15024. }
  15025. if (typeof handler === 'string') {
  15026. handler = vm[handler];
  15027. }
  15028. vm.$watch(key, handler, options);
  15029. }
  15030. function stateMixin (Vue) {
  15031. // flow somehow has problems with directly declared definition object
  15032. // when using Object.defineProperty, so we have to procedurally build up
  15033. // the object here.
  15034. var dataDef = {};
  15035. dataDef.get = function () {
  15036. return this._data
  15037. };
  15038. if (process.env.NODE_ENV !== 'production') {
  15039. dataDef.set = function (newData) {
  15040. warn(
  15041. 'Avoid replacing instance root $data. ' +
  15042. 'Use nested data properties instead.',
  15043. this
  15044. );
  15045. };
  15046. }
  15047. Object.defineProperty(Vue.prototype, '$data', dataDef);
  15048. Vue.prototype.$set = set$1;
  15049. Vue.prototype.$delete = del;
  15050. Vue.prototype.$watch = function (
  15051. expOrFn,
  15052. cb,
  15053. options
  15054. ) {
  15055. var vm = this;
  15056. options = options || {};
  15057. options.user = true;
  15058. var watcher = new Watcher(vm, expOrFn, cb, options);
  15059. if (options.immediate) {
  15060. cb.call(vm, watcher.value);
  15061. }
  15062. return function unwatchFn () {
  15063. watcher.teardown();
  15064. }
  15065. };
  15066. }
  15067. function proxy (vm, key) {
  15068. if (!isReserved(key)) {
  15069. Object.defineProperty(vm, key, {
  15070. configurable: true,
  15071. enumerable: true,
  15072. get: function proxyGetter () {
  15073. return vm._data[key]
  15074. },
  15075. set: function proxySetter (val) {
  15076. vm._data[key] = val;
  15077. }
  15078. });
  15079. }
  15080. }
  15081. /* */
  15082. var uid = 0;
  15083. function initMixin (Vue) {
  15084. Vue.prototype._init = function (options) {
  15085. var vm = this;
  15086. // a uid
  15087. vm._uid = uid++;
  15088. // a flag to avoid this being observed
  15089. vm._isVue = true;
  15090. // merge options
  15091. if (options && options._isComponent) {
  15092. // optimize internal component instantiation
  15093. // since dynamic options merging is pretty slow, and none of the
  15094. // internal component options needs special treatment.
  15095. initInternalComponent(vm, options);
  15096. } else {
  15097. vm.$options = mergeOptions(
  15098. resolveConstructorOptions(vm.constructor),
  15099. options || {},
  15100. vm
  15101. );
  15102. }
  15103. /* istanbul ignore else */
  15104. if (process.env.NODE_ENV !== 'production') {
  15105. initProxy(vm);
  15106. } else {
  15107. vm._renderProxy = vm;
  15108. }
  15109. // expose real self
  15110. vm._self = vm;
  15111. initLifecycle(vm);
  15112. initEvents(vm);
  15113. initRender(vm);
  15114. callHook(vm, 'beforeCreate');
  15115. initState(vm);
  15116. callHook(vm, 'created');
  15117. if (vm.$options.el) {
  15118. vm.$mount(vm.$options.el);
  15119. }
  15120. };
  15121. }
  15122. function initInternalComponent (vm, options) {
  15123. var opts = vm.$options = Object.create(vm.constructor.options);
  15124. // doing this because it's faster than dynamic enumeration.
  15125. opts.parent = options.parent;
  15126. opts.propsData = options.propsData;
  15127. opts._parentVnode = options._parentVnode;
  15128. opts._parentListeners = options._parentListeners;
  15129. opts._renderChildren = options._renderChildren;
  15130. opts._componentTag = options._componentTag;
  15131. opts._parentElm = options._parentElm;
  15132. opts._refElm = options._refElm;
  15133. if (options.render) {
  15134. opts.render = options.render;
  15135. opts.staticRenderFns = options.staticRenderFns;
  15136. }
  15137. }
  15138. function resolveConstructorOptions (Ctor) {
  15139. var options = Ctor.options;
  15140. if (Ctor.super) {
  15141. var superOptions = Ctor.super.options;
  15142. var cachedSuperOptions = Ctor.superOptions;
  15143. var extendOptions = Ctor.extendOptions;
  15144. if (superOptions !== cachedSuperOptions) {
  15145. // super option changed
  15146. Ctor.superOptions = superOptions;
  15147. extendOptions.render = options.render;
  15148. extendOptions.staticRenderFns = options.staticRenderFns;
  15149. extendOptions._scopeId = options._scopeId;
  15150. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  15151. if (options.name) {
  15152. options.components[options.name] = Ctor;
  15153. }
  15154. }
  15155. }
  15156. return options
  15157. }
  15158. function Vue$3 (options) {
  15159. if (process.env.NODE_ENV !== 'production' &&
  15160. !(this instanceof Vue$3)) {
  15161. warn('Vue is a constructor and should be called with the `new` keyword');
  15162. }
  15163. this._init(options);
  15164. }
  15165. initMixin(Vue$3);
  15166. stateMixin(Vue$3);
  15167. eventsMixin(Vue$3);
  15168. lifecycleMixin(Vue$3);
  15169. renderMixin(Vue$3);
  15170. /* */
  15171. function initUse (Vue) {
  15172. Vue.use = function (plugin) {
  15173. /* istanbul ignore if */
  15174. if (plugin.installed) {
  15175. return
  15176. }
  15177. // additional parameters
  15178. var args = toArray(arguments, 1);
  15179. args.unshift(this);
  15180. if (typeof plugin.install === 'function') {
  15181. plugin.install.apply(plugin, args);
  15182. } else {
  15183. plugin.apply(null, args);
  15184. }
  15185. plugin.installed = true;
  15186. return this
  15187. };
  15188. }
  15189. /* */
  15190. function initMixin$1 (Vue) {
  15191. Vue.mixin = function (mixin) {
  15192. this.options = mergeOptions(this.options, mixin);
  15193. };
  15194. }
  15195. /* */
  15196. function initExtend (Vue) {
  15197. /**
  15198. * Each instance constructor, including Vue, has a unique
  15199. * cid. This enables us to create wrapped "child
  15200. * constructors" for prototypal inheritance and cache them.
  15201. */
  15202. Vue.cid = 0;
  15203. var cid = 1;
  15204. /**
  15205. * Class inheritance
  15206. */
  15207. Vue.extend = function (extendOptions) {
  15208. extendOptions = extendOptions || {};
  15209. var Super = this;
  15210. var SuperId = Super.cid;
  15211. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  15212. if (cachedCtors[SuperId]) {
  15213. return cachedCtors[SuperId]
  15214. }
  15215. var name = extendOptions.name || Super.options.name;
  15216. if (process.env.NODE_ENV !== 'production') {
  15217. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  15218. warn(
  15219. 'Invalid component name: "' + name + '". Component names ' +
  15220. 'can only contain alphanumeric characters and the hyphen, ' +
  15221. 'and must start with a letter.'
  15222. );
  15223. }
  15224. }
  15225. var Sub = function VueComponent (options) {
  15226. this._init(options);
  15227. };
  15228. Sub.prototype = Object.create(Super.prototype);
  15229. Sub.prototype.constructor = Sub;
  15230. Sub.cid = cid++;
  15231. Sub.options = mergeOptions(
  15232. Super.options,
  15233. extendOptions
  15234. );
  15235. Sub['super'] = Super;
  15236. // allow further extension/mixin/plugin usage
  15237. Sub.extend = Super.extend;
  15238. Sub.mixin = Super.mixin;
  15239. Sub.use = Super.use;
  15240. // create asset registers, so extended classes
  15241. // can have their private assets too.
  15242. config._assetTypes.forEach(function (type) {
  15243. Sub[type] = Super[type];
  15244. });
  15245. // enable recursive self-lookup
  15246. if (name) {
  15247. Sub.options.components[name] = Sub;
  15248. }
  15249. // keep a reference to the super options at extension time.
  15250. // later at instantiation we can check if Super's options have
  15251. // been updated.
  15252. Sub.superOptions = Super.options;
  15253. Sub.extendOptions = extendOptions;
  15254. // cache constructor
  15255. cachedCtors[SuperId] = Sub;
  15256. return Sub
  15257. };
  15258. }
  15259. /* */
  15260. function initAssetRegisters (Vue) {
  15261. /**
  15262. * Create asset registration methods.
  15263. */
  15264. config._assetTypes.forEach(function (type) {
  15265. Vue[type] = function (
  15266. id,
  15267. definition
  15268. ) {
  15269. if (!definition) {
  15270. return this.options[type + 's'][id]
  15271. } else {
  15272. /* istanbul ignore if */
  15273. if (process.env.NODE_ENV !== 'production') {
  15274. if (type === 'component' && config.isReservedTag(id)) {
  15275. warn(
  15276. 'Do not use built-in or reserved HTML elements as component ' +
  15277. 'id: ' + id
  15278. );
  15279. }
  15280. }
  15281. if (type === 'component' && isPlainObject(definition)) {
  15282. definition.name = definition.name || id;
  15283. definition = this.options._base.extend(definition);
  15284. }
  15285. if (type === 'directive' && typeof definition === 'function') {
  15286. definition = { bind: definition, update: definition };
  15287. }
  15288. this.options[type + 's'][id] = definition;
  15289. return definition
  15290. }
  15291. };
  15292. });
  15293. }
  15294. /* */
  15295. var patternTypes = [String, RegExp];
  15296. function getComponentName (opts) {
  15297. return opts && (opts.Ctor.options.name || opts.tag)
  15298. }
  15299. function matches (pattern, name) {
  15300. if (typeof pattern === 'string') {
  15301. return pattern.split(',').indexOf(name) > -1
  15302. } else {
  15303. return pattern.test(name)
  15304. }
  15305. }
  15306. function pruneCache (cache, filter) {
  15307. for (var key in cache) {
  15308. var cachedNode = cache[key];
  15309. if (cachedNode) {
  15310. var name = getComponentName(cachedNode.componentOptions);
  15311. if (name && !filter(name)) {
  15312. pruneCacheEntry(cachedNode);
  15313. cache[key] = null;
  15314. }
  15315. }
  15316. }
  15317. }
  15318. function pruneCacheEntry (vnode) {
  15319. if (vnode) {
  15320. if (!vnode.componentInstance._inactive) {
  15321. callHook(vnode.componentInstance, 'deactivated');
  15322. }
  15323. vnode.componentInstance.$destroy();
  15324. }
  15325. }
  15326. var KeepAlive = {
  15327. name: 'keep-alive',
  15328. abstract: true,
  15329. props: {
  15330. include: patternTypes,
  15331. exclude: patternTypes
  15332. },
  15333. created: function created () {
  15334. this.cache = Object.create(null);
  15335. },
  15336. destroyed: function destroyed () {
  15337. var this$1 = this;
  15338. for (var key in this.cache) {
  15339. pruneCacheEntry(this$1.cache[key]);
  15340. }
  15341. },
  15342. watch: {
  15343. include: function include (val) {
  15344. pruneCache(this.cache, function (name) { return matches(val, name); });
  15345. },
  15346. exclude: function exclude (val) {
  15347. pruneCache(this.cache, function (name) { return !matches(val, name); });
  15348. }
  15349. },
  15350. render: function render () {
  15351. var vnode = getFirstComponentChild(this.$slots.default);
  15352. var componentOptions = vnode && vnode.componentOptions;
  15353. if (componentOptions) {
  15354. // check pattern
  15355. var name = getComponentName(componentOptions);
  15356. if (name && (
  15357. (this.include && !matches(this.include, name)) ||
  15358. (this.exclude && matches(this.exclude, name))
  15359. )) {
  15360. return vnode
  15361. }
  15362. var key = vnode.key == null
  15363. // same constructor may get registered as different local components
  15364. // so cid alone is not enough (#3269)
  15365. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  15366. : vnode.key;
  15367. if (this.cache[key]) {
  15368. vnode.componentInstance = this.cache[key].componentInstance;
  15369. } else {
  15370. this.cache[key] = vnode;
  15371. }
  15372. vnode.data.keepAlive = true;
  15373. }
  15374. return vnode
  15375. }
  15376. };
  15377. var builtInComponents = {
  15378. KeepAlive: KeepAlive
  15379. };
  15380. /* */
  15381. function initGlobalAPI (Vue) {
  15382. // config
  15383. var configDef = {};
  15384. configDef.get = function () { return config; };
  15385. if (process.env.NODE_ENV !== 'production') {
  15386. configDef.set = function () {
  15387. warn(
  15388. 'Do not replace the Vue.config object, set individual fields instead.'
  15389. );
  15390. };
  15391. }
  15392. Object.defineProperty(Vue, 'config', configDef);
  15393. Vue.util = util;
  15394. Vue.set = set$1;
  15395. Vue.delete = del;
  15396. Vue.nextTick = nextTick;
  15397. Vue.options = Object.create(null);
  15398. config._assetTypes.forEach(function (type) {
  15399. Vue.options[type + 's'] = Object.create(null);
  15400. });
  15401. // this is used to identify the "base" constructor to extend all plain-object
  15402. // components with in Weex's multi-instance scenarios.
  15403. Vue.options._base = Vue;
  15404. extend(Vue.options.components, builtInComponents);
  15405. initUse(Vue);
  15406. initMixin$1(Vue);
  15407. initExtend(Vue);
  15408. initAssetRegisters(Vue);
  15409. }
  15410. initGlobalAPI(Vue$3);
  15411. Object.defineProperty(Vue$3.prototype, '$isServer', {
  15412. get: isServerRendering
  15413. });
  15414. Vue$3.version = '2.1.10';
  15415. /* */
  15416. // attributes that should be using props for binding
  15417. var acceptValue = makeMap('input,textarea,option,select');
  15418. var mustUseProp = function (tag, type, attr) {
  15419. return (
  15420. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  15421. (attr === 'selected' && tag === 'option') ||
  15422. (attr === 'checked' && tag === 'input') ||
  15423. (attr === 'muted' && tag === 'video')
  15424. )
  15425. };
  15426. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  15427. var isBooleanAttr = makeMap(
  15428. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  15429. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  15430. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  15431. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  15432. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  15433. 'truespeed,typemustmatch,visible'
  15434. );
  15435. var xlinkNS = 'http://www.w3.org/1999/xlink';
  15436. var isXlink = function (name) {
  15437. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  15438. };
  15439. var getXlinkProp = function (name) {
  15440. return isXlink(name) ? name.slice(6, name.length) : ''
  15441. };
  15442. var isFalsyAttrValue = function (val) {
  15443. return val == null || val === false
  15444. };
  15445. /* */
  15446. function genClassForVnode (vnode) {
  15447. var data = vnode.data;
  15448. var parentNode = vnode;
  15449. var childNode = vnode;
  15450. while (childNode.componentInstance) {
  15451. childNode = childNode.componentInstance._vnode;
  15452. if (childNode.data) {
  15453. data = mergeClassData(childNode.data, data);
  15454. }
  15455. }
  15456. while ((parentNode = parentNode.parent)) {
  15457. if (parentNode.data) {
  15458. data = mergeClassData(data, parentNode.data);
  15459. }
  15460. }
  15461. return genClassFromData(data)
  15462. }
  15463. function mergeClassData (child, parent) {
  15464. return {
  15465. staticClass: concat(child.staticClass, parent.staticClass),
  15466. class: child.class
  15467. ? [child.class, parent.class]
  15468. : parent.class
  15469. }
  15470. }
  15471. function genClassFromData (data) {
  15472. var dynamicClass = data.class;
  15473. var staticClass = data.staticClass;
  15474. if (staticClass || dynamicClass) {
  15475. return concat(staticClass, stringifyClass(dynamicClass))
  15476. }
  15477. /* istanbul ignore next */
  15478. return ''
  15479. }
  15480. function concat (a, b) {
  15481. return a ? b ? (a + ' ' + b) : a : (b || '')
  15482. }
  15483. function stringifyClass (value) {
  15484. var res = '';
  15485. if (!value) {
  15486. return res
  15487. }
  15488. if (typeof value === 'string') {
  15489. return value
  15490. }
  15491. if (Array.isArray(value)) {
  15492. var stringified;
  15493. for (var i = 0, l = value.length; i < l; i++) {
  15494. if (value[i]) {
  15495. if ((stringified = stringifyClass(value[i]))) {
  15496. res += stringified + ' ';
  15497. }
  15498. }
  15499. }
  15500. return res.slice(0, -1)
  15501. }
  15502. if (isObject(value)) {
  15503. for (var key in value) {
  15504. if (value[key]) { res += key + ' '; }
  15505. }
  15506. return res.slice(0, -1)
  15507. }
  15508. /* istanbul ignore next */
  15509. return res
  15510. }
  15511. /* */
  15512. var namespaceMap = {
  15513. svg: 'http://www.w3.org/2000/svg',
  15514. math: 'http://www.w3.org/1998/Math/MathML'
  15515. };
  15516. var isHTMLTag = makeMap(
  15517. 'html,body,base,head,link,meta,style,title,' +
  15518. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  15519. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  15520. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  15521. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  15522. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  15523. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  15524. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  15525. 'output,progress,select,textarea,' +
  15526. 'details,dialog,menu,menuitem,summary,' +
  15527. 'content,element,shadow,template'
  15528. );
  15529. // this map is intentionally selective, only covering SVG elements that may
  15530. // contain child elements.
  15531. var isSVG = makeMap(
  15532. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' +
  15533. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  15534. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  15535. true
  15536. );
  15537. var isPreTag = function (tag) { return tag === 'pre'; };
  15538. var isReservedTag = function (tag) {
  15539. return isHTMLTag(tag) || isSVG(tag)
  15540. };
  15541. function getTagNamespace (tag) {
  15542. if (isSVG(tag)) {
  15543. return 'svg'
  15544. }
  15545. // basic support for MathML
  15546. // note it doesn't support other MathML elements being component roots
  15547. if (tag === 'math') {
  15548. return 'math'
  15549. }
  15550. }
  15551. var unknownElementCache = Object.create(null);
  15552. function isUnknownElement (tag) {
  15553. /* istanbul ignore if */
  15554. if (!inBrowser) {
  15555. return true
  15556. }
  15557. if (isReservedTag(tag)) {
  15558. return false
  15559. }
  15560. tag = tag.toLowerCase();
  15561. /* istanbul ignore if */
  15562. if (unknownElementCache[tag] != null) {
  15563. return unknownElementCache[tag]
  15564. }
  15565. var el = document.createElement(tag);
  15566. if (tag.indexOf('-') > -1) {
  15567. // http://stackoverflow.com/a/28210364/1070244
  15568. return (unknownElementCache[tag] = (
  15569. el.constructor === window.HTMLUnknownElement ||
  15570. el.constructor === window.HTMLElement
  15571. ))
  15572. } else {
  15573. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  15574. }
  15575. }
  15576. /* */
  15577. /**
  15578. * Query an element selector if it's not an element already.
  15579. */
  15580. function query (el) {
  15581. if (typeof el === 'string') {
  15582. var selector = el;
  15583. el = document.querySelector(el);
  15584. if (!el) {
  15585. process.env.NODE_ENV !== 'production' && warn(
  15586. 'Cannot find element: ' + selector
  15587. );
  15588. return document.createElement('div')
  15589. }
  15590. }
  15591. return el
  15592. }
  15593. /* */
  15594. function createElement$1 (tagName, vnode) {
  15595. var elm = document.createElement(tagName);
  15596. if (tagName !== 'select') {
  15597. return elm
  15598. }
  15599. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  15600. elm.setAttribute('multiple', 'multiple');
  15601. }
  15602. return elm
  15603. }
  15604. function createElementNS (namespace, tagName) {
  15605. return document.createElementNS(namespaceMap[namespace], tagName)
  15606. }
  15607. function createTextNode (text) {
  15608. return document.createTextNode(text)
  15609. }
  15610. function createComment (text) {
  15611. return document.createComment(text)
  15612. }
  15613. function insertBefore (parentNode, newNode, referenceNode) {
  15614. parentNode.insertBefore(newNode, referenceNode);
  15615. }
  15616. function removeChild (node, child) {
  15617. node.removeChild(child);
  15618. }
  15619. function appendChild (node, child) {
  15620. node.appendChild(child);
  15621. }
  15622. function parentNode (node) {
  15623. return node.parentNode
  15624. }
  15625. function nextSibling (node) {
  15626. return node.nextSibling
  15627. }
  15628. function tagName (node) {
  15629. return node.tagName
  15630. }
  15631. function setTextContent (node, text) {
  15632. node.textContent = text;
  15633. }
  15634. function setAttribute (node, key, val) {
  15635. node.setAttribute(key, val);
  15636. }
  15637. var nodeOps = Object.freeze({
  15638. createElement: createElement$1,
  15639. createElementNS: createElementNS,
  15640. createTextNode: createTextNode,
  15641. createComment: createComment,
  15642. insertBefore: insertBefore,
  15643. removeChild: removeChild,
  15644. appendChild: appendChild,
  15645. parentNode: parentNode,
  15646. nextSibling: nextSibling,
  15647. tagName: tagName,
  15648. setTextContent: setTextContent,
  15649. setAttribute: setAttribute
  15650. });
  15651. /* */
  15652. var ref = {
  15653. create: function create (_, vnode) {
  15654. registerRef(vnode);
  15655. },
  15656. update: function update (oldVnode, vnode) {
  15657. if (oldVnode.data.ref !== vnode.data.ref) {
  15658. registerRef(oldVnode, true);
  15659. registerRef(vnode);
  15660. }
  15661. },
  15662. destroy: function destroy (vnode) {
  15663. registerRef(vnode, true);
  15664. }
  15665. };
  15666. function registerRef (vnode, isRemoval) {
  15667. var key = vnode.data.ref;
  15668. if (!key) { return }
  15669. var vm = vnode.context;
  15670. var ref = vnode.componentInstance || vnode.elm;
  15671. var refs = vm.$refs;
  15672. if (isRemoval) {
  15673. if (Array.isArray(refs[key])) {
  15674. remove$1(refs[key], ref);
  15675. } else if (refs[key] === ref) {
  15676. refs[key] = undefined;
  15677. }
  15678. } else {
  15679. if (vnode.data.refInFor) {
  15680. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  15681. refs[key].push(ref);
  15682. } else {
  15683. refs[key] = [ref];
  15684. }
  15685. } else {
  15686. refs[key] = ref;
  15687. }
  15688. }
  15689. }
  15690. /**
  15691. * Virtual DOM patching algorithm based on Snabbdom by
  15692. * Simon Friis Vindum (@paldepind)
  15693. * Licensed under the MIT License
  15694. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  15695. *
  15696. * modified by Evan You (@yyx990803)
  15697. *
  15698. /*
  15699. * Not type-checking this because this file is perf-critical and the cost
  15700. * of making flow understand it is not worth it.
  15701. */
  15702. var emptyNode = new VNode('', {}, []);
  15703. var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];
  15704. function isUndef (s) {
  15705. return s == null
  15706. }
  15707. function isDef (s) {
  15708. return s != null
  15709. }
  15710. function sameVnode (vnode1, vnode2) {
  15711. return (
  15712. vnode1.key === vnode2.key &&
  15713. vnode1.tag === vnode2.tag &&
  15714. vnode1.isComment === vnode2.isComment &&
  15715. !vnode1.data === !vnode2.data
  15716. )
  15717. }
  15718. function createKeyToOldIdx (children, beginIdx, endIdx) {
  15719. var i, key;
  15720. var map = {};
  15721. for (i = beginIdx; i <= endIdx; ++i) {
  15722. key = children[i].key;
  15723. if (isDef(key)) { map[key] = i; }
  15724. }
  15725. return map
  15726. }
  15727. function createPatchFunction (backend) {
  15728. var i, j;
  15729. var cbs = {};
  15730. var modules = backend.modules;
  15731. var nodeOps = backend.nodeOps;
  15732. for (i = 0; i < hooks$1.length; ++i) {
  15733. cbs[hooks$1[i]] = [];
  15734. for (j = 0; j < modules.length; ++j) {
  15735. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  15736. }
  15737. }
  15738. function emptyNodeAt (elm) {
  15739. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  15740. }
  15741. function createRmCb (childElm, listeners) {
  15742. function remove$$1 () {
  15743. if (--remove$$1.listeners === 0) {
  15744. removeNode(childElm);
  15745. }
  15746. }
  15747. remove$$1.listeners = listeners;
  15748. return remove$$1
  15749. }
  15750. function removeNode (el) {
  15751. var parent = nodeOps.parentNode(el);
  15752. // element may have already been removed due to v-html / v-text
  15753. if (parent) {
  15754. nodeOps.removeChild(parent, el);
  15755. }
  15756. }
  15757. var inPre = 0;
  15758. function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
  15759. vnode.isRootInsert = !nested; // for transition enter check
  15760. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  15761. return
  15762. }
  15763. var data = vnode.data;
  15764. var children = vnode.children;
  15765. var tag = vnode.tag;
  15766. if (isDef(tag)) {
  15767. if (process.env.NODE_ENV !== 'production') {
  15768. if (data && data.pre) {
  15769. inPre++;
  15770. }
  15771. if (
  15772. !inPre &&
  15773. !vnode.ns &&
  15774. !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
  15775. config.isUnknownElement(tag)
  15776. ) {
  15777. warn(
  15778. 'Unknown custom element: <' + tag + '> - did you ' +
  15779. 'register the component correctly? For recursive components, ' +
  15780. 'make sure to provide the "name" option.',
  15781. vnode.context
  15782. );
  15783. }
  15784. }
  15785. vnode.elm = vnode.ns
  15786. ? nodeOps.createElementNS(vnode.ns, tag)
  15787. : nodeOps.createElement(tag, vnode);
  15788. setScope(vnode);
  15789. /* istanbul ignore if */
  15790. {
  15791. createChildren(vnode, children, insertedVnodeQueue);
  15792. if (isDef(data)) {
  15793. invokeCreateHooks(vnode, insertedVnodeQueue);
  15794. }
  15795. insert(parentElm, vnode.elm, refElm);
  15796. }
  15797. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  15798. inPre--;
  15799. }
  15800. } else if (vnode.isComment) {
  15801. vnode.elm = nodeOps.createComment(vnode.text);
  15802. insert(parentElm, vnode.elm, refElm);
  15803. } else {
  15804. vnode.elm = nodeOps.createTextNode(vnode.text);
  15805. insert(parentElm, vnode.elm, refElm);
  15806. }
  15807. }
  15808. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  15809. var i = vnode.data;
  15810. if (isDef(i)) {
  15811. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  15812. if (isDef(i = i.hook) && isDef(i = i.init)) {
  15813. i(vnode, false /* hydrating */, parentElm, refElm);
  15814. }
  15815. // after calling the init hook, if the vnode is a child component
  15816. // it should've created a child instance and mounted it. the child
  15817. // component also has set the placeholder vnode's elm.
  15818. // in that case we can just return the element and be done.
  15819. if (isDef(vnode.componentInstance)) {
  15820. initComponent(vnode, insertedVnodeQueue);
  15821. if (isReactivated) {
  15822. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  15823. }
  15824. return true
  15825. }
  15826. }
  15827. }
  15828. function initComponent (vnode, insertedVnodeQueue) {
  15829. if (vnode.data.pendingInsert) {
  15830. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  15831. }
  15832. vnode.elm = vnode.componentInstance.$el;
  15833. if (isPatchable(vnode)) {
  15834. invokeCreateHooks(vnode, insertedVnodeQueue);
  15835. setScope(vnode);
  15836. } else {
  15837. // empty component root.
  15838. // skip all element-related modules except for ref (#3455)
  15839. registerRef(vnode);
  15840. // make sure to invoke the insert hook
  15841. insertedVnodeQueue.push(vnode);
  15842. }
  15843. }
  15844. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  15845. var i;
  15846. // hack for #4339: a reactivated component with inner transition
  15847. // does not trigger because the inner node's created hooks are not called
  15848. // again. It's not ideal to involve module-specific logic in here but
  15849. // there doesn't seem to be a better way to do it.
  15850. var innerNode = vnode;
  15851. while (innerNode.componentInstance) {
  15852. innerNode = innerNode.componentInstance._vnode;
  15853. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  15854. for (i = 0; i < cbs.activate.length; ++i) {
  15855. cbs.activate[i](emptyNode, innerNode);
  15856. }
  15857. insertedVnodeQueue.push(innerNode);
  15858. break
  15859. }
  15860. }
  15861. // unlike a newly created component,
  15862. // a reactivated keep-alive component doesn't insert itself
  15863. insert(parentElm, vnode.elm, refElm);
  15864. }
  15865. function insert (parent, elm, ref) {
  15866. if (parent) {
  15867. if (ref) {
  15868. nodeOps.insertBefore(parent, elm, ref);
  15869. } else {
  15870. nodeOps.appendChild(parent, elm);
  15871. }
  15872. }
  15873. }
  15874. function createChildren (vnode, children, insertedVnodeQueue) {
  15875. if (Array.isArray(children)) {
  15876. for (var i = 0; i < children.length; ++i) {
  15877. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
  15878. }
  15879. } else if (isPrimitive(vnode.text)) {
  15880. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  15881. }
  15882. }
  15883. function isPatchable (vnode) {
  15884. while (vnode.componentInstance) {
  15885. vnode = vnode.componentInstance._vnode;
  15886. }
  15887. return isDef(vnode.tag)
  15888. }
  15889. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  15890. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  15891. cbs.create[i$1](emptyNode, vnode);
  15892. }
  15893. i = vnode.data.hook; // Reuse variable
  15894. if (isDef(i)) {
  15895. if (i.create) { i.create(emptyNode, vnode); }
  15896. if (i.insert) { insertedVnodeQueue.push(vnode); }
  15897. }
  15898. }
  15899. // set scope id attribute for scoped CSS.
  15900. // this is implemented as a special case to avoid the overhead
  15901. // of going through the normal attribute patching process.
  15902. function setScope (vnode) {
  15903. var i;
  15904. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  15905. nodeOps.setAttribute(vnode.elm, i, '');
  15906. }
  15907. if (isDef(i = activeInstance) &&
  15908. i !== vnode.context &&
  15909. isDef(i = i.$options._scopeId)) {
  15910. nodeOps.setAttribute(vnode.elm, i, '');
  15911. }
  15912. }
  15913. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  15914. for (; startIdx <= endIdx; ++startIdx) {
  15915. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
  15916. }
  15917. }
  15918. function invokeDestroyHook (vnode) {
  15919. var i, j;
  15920. var data = vnode.data;
  15921. if (isDef(data)) {
  15922. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  15923. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  15924. }
  15925. if (isDef(i = vnode.children)) {
  15926. for (j = 0; j < vnode.children.length; ++j) {
  15927. invokeDestroyHook(vnode.children[j]);
  15928. }
  15929. }
  15930. }
  15931. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  15932. for (; startIdx <= endIdx; ++startIdx) {
  15933. var ch = vnodes[startIdx];
  15934. if (isDef(ch)) {
  15935. if (isDef(ch.tag)) {
  15936. removeAndInvokeRemoveHook(ch);
  15937. invokeDestroyHook(ch);
  15938. } else { // Text node
  15939. removeNode(ch.elm);
  15940. }
  15941. }
  15942. }
  15943. }
  15944. function removeAndInvokeRemoveHook (vnode, rm) {
  15945. if (rm || isDef(vnode.data)) {
  15946. var listeners = cbs.remove.length + 1;
  15947. if (!rm) {
  15948. // directly removing
  15949. rm = createRmCb(vnode.elm, listeners);
  15950. } else {
  15951. // we have a recursively passed down rm callback
  15952. // increase the listeners count
  15953. rm.listeners += listeners;
  15954. }
  15955. // recursively invoke hooks on child component root node
  15956. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  15957. removeAndInvokeRemoveHook(i, rm);
  15958. }
  15959. for (i = 0; i < cbs.remove.length; ++i) {
  15960. cbs.remove[i](vnode, rm);
  15961. }
  15962. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  15963. i(vnode, rm);
  15964. } else {
  15965. rm();
  15966. }
  15967. } else {
  15968. removeNode(vnode.elm);
  15969. }
  15970. }
  15971. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  15972. var oldStartIdx = 0;
  15973. var newStartIdx = 0;
  15974. var oldEndIdx = oldCh.length - 1;
  15975. var oldStartVnode = oldCh[0];
  15976. var oldEndVnode = oldCh[oldEndIdx];
  15977. var newEndIdx = newCh.length - 1;
  15978. var newStartVnode = newCh[0];
  15979. var newEndVnode = newCh[newEndIdx];
  15980. var oldKeyToIdx, idxInOld, elmToMove, refElm;
  15981. // removeOnly is a special flag used only by <transition-group>
  15982. // to ensure removed elements stay in correct relative positions
  15983. // during leaving transitions
  15984. var canMove = !removeOnly;
  15985. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  15986. if (isUndef(oldStartVnode)) {
  15987. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  15988. } else if (isUndef(oldEndVnode)) {
  15989. oldEndVnode = oldCh[--oldEndIdx];
  15990. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  15991. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  15992. oldStartVnode = oldCh[++oldStartIdx];
  15993. newStartVnode = newCh[++newStartIdx];
  15994. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  15995. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  15996. oldEndVnode = oldCh[--oldEndIdx];
  15997. newEndVnode = newCh[--newEndIdx];
  15998. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  15999. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  16000. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  16001. oldStartVnode = oldCh[++oldStartIdx];
  16002. newEndVnode = newCh[--newEndIdx];
  16003. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  16004. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  16005. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  16006. oldEndVnode = oldCh[--oldEndIdx];
  16007. newStartVnode = newCh[++newStartIdx];
  16008. } else {
  16009. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  16010. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  16011. if (isUndef(idxInOld)) { // New element
  16012. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  16013. newStartVnode = newCh[++newStartIdx];
  16014. } else {
  16015. elmToMove = oldCh[idxInOld];
  16016. /* istanbul ignore if */
  16017. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  16018. warn(
  16019. 'It seems there are duplicate keys that is causing an update error. ' +
  16020. 'Make sure each v-for item has a unique key.'
  16021. );
  16022. }
  16023. if (sameVnode(elmToMove, newStartVnode)) {
  16024. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  16025. oldCh[idxInOld] = undefined;
  16026. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  16027. newStartVnode = newCh[++newStartIdx];
  16028. } else {
  16029. // same key but different element. treat as new element
  16030. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  16031. newStartVnode = newCh[++newStartIdx];
  16032. }
  16033. }
  16034. }
  16035. }
  16036. if (oldStartIdx > oldEndIdx) {
  16037. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  16038. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  16039. } else if (newStartIdx > newEndIdx) {
  16040. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  16041. }
  16042. }
  16043. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  16044. if (oldVnode === vnode) {
  16045. return
  16046. }
  16047. // reuse element for static trees.
  16048. // note we only do this if the vnode is cloned -
  16049. // if the new node is not cloned it means the render functions have been
  16050. // reset by the hot-reload-api and we need to do a proper re-render.
  16051. if (vnode.isStatic &&
  16052. oldVnode.isStatic &&
  16053. vnode.key === oldVnode.key &&
  16054. (vnode.isCloned || vnode.isOnce)) {
  16055. vnode.elm = oldVnode.elm;
  16056. vnode.componentInstance = oldVnode.componentInstance;
  16057. return
  16058. }
  16059. var i;
  16060. var data = vnode.data;
  16061. var hasData = isDef(data);
  16062. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  16063. i(oldVnode, vnode);
  16064. }
  16065. var elm = vnode.elm = oldVnode.elm;
  16066. var oldCh = oldVnode.children;
  16067. var ch = vnode.children;
  16068. if (hasData && isPatchable(vnode)) {
  16069. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  16070. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  16071. }
  16072. if (isUndef(vnode.text)) {
  16073. if (isDef(oldCh) && isDef(ch)) {
  16074. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  16075. } else if (isDef(ch)) {
  16076. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  16077. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  16078. } else if (isDef(oldCh)) {
  16079. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  16080. } else if (isDef(oldVnode.text)) {
  16081. nodeOps.setTextContent(elm, '');
  16082. }
  16083. } else if (oldVnode.text !== vnode.text) {
  16084. nodeOps.setTextContent(elm, vnode.text);
  16085. }
  16086. if (hasData) {
  16087. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  16088. }
  16089. }
  16090. function invokeInsertHook (vnode, queue, initial) {
  16091. // delay insert hooks for component root nodes, invoke them after the
  16092. // element is really inserted
  16093. if (initial && vnode.parent) {
  16094. vnode.parent.data.pendingInsert = queue;
  16095. } else {
  16096. for (var i = 0; i < queue.length; ++i) {
  16097. queue[i].data.hook.insert(queue[i]);
  16098. }
  16099. }
  16100. }
  16101. var bailed = false;
  16102. // list of modules that can skip create hook during hydration because they
  16103. // are already rendered on the client or has no need for initialization
  16104. var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
  16105. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  16106. function hydrate (elm, vnode, insertedVnodeQueue) {
  16107. if (process.env.NODE_ENV !== 'production') {
  16108. if (!assertNodeMatch(elm, vnode)) {
  16109. return false
  16110. }
  16111. }
  16112. vnode.elm = elm;
  16113. var tag = vnode.tag;
  16114. var data = vnode.data;
  16115. var children = vnode.children;
  16116. if (isDef(data)) {
  16117. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  16118. if (isDef(i = vnode.componentInstance)) {
  16119. // child component. it should have hydrated its own tree.
  16120. initComponent(vnode, insertedVnodeQueue);
  16121. return true
  16122. }
  16123. }
  16124. if (isDef(tag)) {
  16125. if (isDef(children)) {
  16126. // empty element, allow client to pick up and populate children
  16127. if (!elm.hasChildNodes()) {
  16128. createChildren(vnode, children, insertedVnodeQueue);
  16129. } else {
  16130. var childrenMatch = true;
  16131. var childNode = elm.firstChild;
  16132. for (var i$1 = 0; i$1 < children.length; i$1++) {
  16133. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
  16134. childrenMatch = false;
  16135. break
  16136. }
  16137. childNode = childNode.nextSibling;
  16138. }
  16139. // if childNode is not null, it means the actual childNodes list is
  16140. // longer than the virtual children list.
  16141. if (!childrenMatch || childNode) {
  16142. if (process.env.NODE_ENV !== 'production' &&
  16143. typeof console !== 'undefined' &&
  16144. !bailed) {
  16145. bailed = true;
  16146. console.warn('Parent: ', elm);
  16147. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  16148. }
  16149. return false
  16150. }
  16151. }
  16152. }
  16153. if (isDef(data)) {
  16154. for (var key in data) {
  16155. if (!isRenderedModule(key)) {
  16156. invokeCreateHooks(vnode, insertedVnodeQueue);
  16157. break
  16158. }
  16159. }
  16160. }
  16161. } else if (elm.data !== vnode.text) {
  16162. elm.data = vnode.text;
  16163. }
  16164. return true
  16165. }
  16166. function assertNodeMatch (node, vnode) {
  16167. if (vnode.tag) {
  16168. return (
  16169. vnode.tag.indexOf('vue-component') === 0 ||
  16170. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  16171. )
  16172. } else {
  16173. return node.nodeType === (vnode.isComment ? 8 : 3)
  16174. }
  16175. }
  16176. return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
  16177. if (!vnode) {
  16178. if (oldVnode) { invokeDestroyHook(oldVnode); }
  16179. return
  16180. }
  16181. var isInitialPatch = false;
  16182. var insertedVnodeQueue = [];
  16183. if (!oldVnode) {
  16184. // empty mount (likely as component), create new root element
  16185. isInitialPatch = true;
  16186. createElm(vnode, insertedVnodeQueue, parentElm, refElm);
  16187. } else {
  16188. var isRealElement = isDef(oldVnode.nodeType);
  16189. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  16190. // patch existing root node
  16191. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  16192. } else {
  16193. if (isRealElement) {
  16194. // mounting to a real element
  16195. // check if this is server-rendered content and if we can perform
  16196. // a successful hydration.
  16197. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  16198. oldVnode.removeAttribute('server-rendered');
  16199. hydrating = true;
  16200. }
  16201. if (hydrating) {
  16202. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  16203. invokeInsertHook(vnode, insertedVnodeQueue, true);
  16204. return oldVnode
  16205. } else if (process.env.NODE_ENV !== 'production') {
  16206. warn(
  16207. 'The client-side rendered virtual DOM tree is not matching ' +
  16208. 'server-rendered content. This is likely caused by incorrect ' +
  16209. 'HTML markup, for example nesting block-level elements inside ' +
  16210. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  16211. 'full client-side render.'
  16212. );
  16213. }
  16214. }
  16215. // either not server-rendered, or hydration failed.
  16216. // create an empty node and replace it
  16217. oldVnode = emptyNodeAt(oldVnode);
  16218. }
  16219. // replacing existing element
  16220. var oldElm = oldVnode.elm;
  16221. var parentElm$1 = nodeOps.parentNode(oldElm);
  16222. createElm(
  16223. vnode,
  16224. insertedVnodeQueue,
  16225. // extremely rare edge case: do not insert if old element is in a
  16226. // leaving transition. Only happens when combining transition +
  16227. // keep-alive + HOCs. (#4590)
  16228. oldElm._leaveCb ? null : parentElm$1,
  16229. nodeOps.nextSibling(oldElm)
  16230. );
  16231. if (vnode.parent) {
  16232. // component root element replaced.
  16233. // update parent placeholder node element, recursively
  16234. var ancestor = vnode.parent;
  16235. while (ancestor) {
  16236. ancestor.elm = vnode.elm;
  16237. ancestor = ancestor.parent;
  16238. }
  16239. if (isPatchable(vnode)) {
  16240. for (var i = 0; i < cbs.create.length; ++i) {
  16241. cbs.create[i](emptyNode, vnode.parent);
  16242. }
  16243. }
  16244. }
  16245. if (parentElm$1 !== null) {
  16246. removeVnodes(parentElm$1, [oldVnode], 0, 0);
  16247. } else if (isDef(oldVnode.tag)) {
  16248. invokeDestroyHook(oldVnode);
  16249. }
  16250. }
  16251. }
  16252. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  16253. return vnode.elm
  16254. }
  16255. }
  16256. /* */
  16257. var directives = {
  16258. create: updateDirectives,
  16259. update: updateDirectives,
  16260. destroy: function unbindDirectives (vnode) {
  16261. updateDirectives(vnode, emptyNode);
  16262. }
  16263. };
  16264. function updateDirectives (oldVnode, vnode) {
  16265. if (oldVnode.data.directives || vnode.data.directives) {
  16266. _update(oldVnode, vnode);
  16267. }
  16268. }
  16269. function _update (oldVnode, vnode) {
  16270. var isCreate = oldVnode === emptyNode;
  16271. var isDestroy = vnode === emptyNode;
  16272. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  16273. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  16274. var dirsWithInsert = [];
  16275. var dirsWithPostpatch = [];
  16276. var key, oldDir, dir;
  16277. for (key in newDirs) {
  16278. oldDir = oldDirs[key];
  16279. dir = newDirs[key];
  16280. if (!oldDir) {
  16281. // new directive, bind
  16282. callHook$1(dir, 'bind', vnode, oldVnode);
  16283. if (dir.def && dir.def.inserted) {
  16284. dirsWithInsert.push(dir);
  16285. }
  16286. } else {
  16287. // existing directive, update
  16288. dir.oldValue = oldDir.value;
  16289. callHook$1(dir, 'update', vnode, oldVnode);
  16290. if (dir.def && dir.def.componentUpdated) {
  16291. dirsWithPostpatch.push(dir);
  16292. }
  16293. }
  16294. }
  16295. if (dirsWithInsert.length) {
  16296. var callInsert = function () {
  16297. for (var i = 0; i < dirsWithInsert.length; i++) {
  16298. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  16299. }
  16300. };
  16301. if (isCreate) {
  16302. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  16303. } else {
  16304. callInsert();
  16305. }
  16306. }
  16307. if (dirsWithPostpatch.length) {
  16308. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  16309. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  16310. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  16311. }
  16312. }, 'dir-postpatch');
  16313. }
  16314. if (!isCreate) {
  16315. for (key in oldDirs) {
  16316. if (!newDirs[key]) {
  16317. // no longer present, unbind
  16318. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  16319. }
  16320. }
  16321. }
  16322. }
  16323. var emptyModifiers = Object.create(null);
  16324. function normalizeDirectives$1 (
  16325. dirs,
  16326. vm
  16327. ) {
  16328. var res = Object.create(null);
  16329. if (!dirs) {
  16330. return res
  16331. }
  16332. var i, dir;
  16333. for (i = 0; i < dirs.length; i++) {
  16334. dir = dirs[i];
  16335. if (!dir.modifiers) {
  16336. dir.modifiers = emptyModifiers;
  16337. }
  16338. res[getRawDirName(dir)] = dir;
  16339. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  16340. }
  16341. return res
  16342. }
  16343. function getRawDirName (dir) {
  16344. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  16345. }
  16346. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  16347. var fn = dir.def && dir.def[hook];
  16348. if (fn) {
  16349. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  16350. }
  16351. }
  16352. var baseModules = [
  16353. ref,
  16354. directives
  16355. ];
  16356. /* */
  16357. function updateAttrs (oldVnode, vnode) {
  16358. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  16359. return
  16360. }
  16361. var key, cur, old;
  16362. var elm = vnode.elm;
  16363. var oldAttrs = oldVnode.data.attrs || {};
  16364. var attrs = vnode.data.attrs || {};
  16365. // clone observed objects, as the user probably wants to mutate it
  16366. if (attrs.__ob__) {
  16367. attrs = vnode.data.attrs = extend({}, attrs);
  16368. }
  16369. for (key in attrs) {
  16370. cur = attrs[key];
  16371. old = oldAttrs[key];
  16372. if (old !== cur) {
  16373. setAttr(elm, key, cur);
  16374. }
  16375. }
  16376. // #4391: in IE9, setting type can reset value for input[type=radio]
  16377. /* istanbul ignore if */
  16378. if (isIE9 && attrs.value !== oldAttrs.value) {
  16379. setAttr(elm, 'value', attrs.value);
  16380. }
  16381. for (key in oldAttrs) {
  16382. if (attrs[key] == null) {
  16383. if (isXlink(key)) {
  16384. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  16385. } else if (!isEnumeratedAttr(key)) {
  16386. elm.removeAttribute(key);
  16387. }
  16388. }
  16389. }
  16390. }
  16391. function setAttr (el, key, value) {
  16392. if (isBooleanAttr(key)) {
  16393. // set attribute for blank value
  16394. // e.g. <option disabled>Select one</option>
  16395. if (isFalsyAttrValue(value)) {
  16396. el.removeAttribute(key);
  16397. } else {
  16398. el.setAttribute(key, key);
  16399. }
  16400. } else if (isEnumeratedAttr(key)) {
  16401. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  16402. } else if (isXlink(key)) {
  16403. if (isFalsyAttrValue(value)) {
  16404. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  16405. } else {
  16406. el.setAttributeNS(xlinkNS, key, value);
  16407. }
  16408. } else {
  16409. if (isFalsyAttrValue(value)) {
  16410. el.removeAttribute(key);
  16411. } else {
  16412. el.setAttribute(key, value);
  16413. }
  16414. }
  16415. }
  16416. var attrs = {
  16417. create: updateAttrs,
  16418. update: updateAttrs
  16419. };
  16420. /* */
  16421. function updateClass (oldVnode, vnode) {
  16422. var el = vnode.elm;
  16423. var data = vnode.data;
  16424. var oldData = oldVnode.data;
  16425. if (!data.staticClass && !data.class &&
  16426. (!oldData || (!oldData.staticClass && !oldData.class))) {
  16427. return
  16428. }
  16429. var cls = genClassForVnode(vnode);
  16430. // handle transition classes
  16431. var transitionClass = el._transitionClasses;
  16432. if (transitionClass) {
  16433. cls = concat(cls, stringifyClass(transitionClass));
  16434. }
  16435. // set the class
  16436. if (cls !== el._prevClass) {
  16437. el.setAttribute('class', cls);
  16438. el._prevClass = cls;
  16439. }
  16440. }
  16441. var klass = {
  16442. create: updateClass,
  16443. update: updateClass
  16444. };
  16445. /* */
  16446. var target$1;
  16447. function add$2 (
  16448. event,
  16449. handler,
  16450. once,
  16451. capture
  16452. ) {
  16453. if (once) {
  16454. var oldHandler = handler;
  16455. var _target = target$1; // save current target element in closure
  16456. handler = function (ev) {
  16457. remove$3(event, handler, capture, _target);
  16458. arguments.length === 1
  16459. ? oldHandler(ev)
  16460. : oldHandler.apply(null, arguments);
  16461. };
  16462. }
  16463. target$1.addEventListener(event, handler, capture);
  16464. }
  16465. function remove$3 (
  16466. event,
  16467. handler,
  16468. capture,
  16469. _target
  16470. ) {
  16471. (_target || target$1).removeEventListener(event, handler, capture);
  16472. }
  16473. function updateDOMListeners (oldVnode, vnode) {
  16474. if (!oldVnode.data.on && !vnode.data.on) {
  16475. return
  16476. }
  16477. var on = vnode.data.on || {};
  16478. var oldOn = oldVnode.data.on || {};
  16479. target$1 = vnode.elm;
  16480. updateListeners(on, oldOn, add$2, remove$3, vnode.context);
  16481. }
  16482. var events = {
  16483. create: updateDOMListeners,
  16484. update: updateDOMListeners
  16485. };
  16486. /* */
  16487. function updateDOMProps (oldVnode, vnode) {
  16488. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  16489. return
  16490. }
  16491. var key, cur;
  16492. var elm = vnode.elm;
  16493. var oldProps = oldVnode.data.domProps || {};
  16494. var props = vnode.data.domProps || {};
  16495. // clone observed objects, as the user probably wants to mutate it
  16496. if (props.__ob__) {
  16497. props = vnode.data.domProps = extend({}, props);
  16498. }
  16499. for (key in oldProps) {
  16500. if (props[key] == null) {
  16501. elm[key] = '';
  16502. }
  16503. }
  16504. for (key in props) {
  16505. cur = props[key];
  16506. // ignore children if the node has textContent or innerHTML,
  16507. // as these will throw away existing DOM nodes and cause removal errors
  16508. // on subsequent patches (#3360)
  16509. if (key === 'textContent' || key === 'innerHTML') {
  16510. if (vnode.children) { vnode.children.length = 0; }
  16511. if (cur === oldProps[key]) { continue }
  16512. }
  16513. if (key === 'value') {
  16514. // store value as _value as well since
  16515. // non-string values will be stringified
  16516. elm._value = cur;
  16517. // avoid resetting cursor position when value is the same
  16518. var strCur = cur == null ? '' : String(cur);
  16519. if (shouldUpdateValue(elm, vnode, strCur)) {
  16520. elm.value = strCur;
  16521. }
  16522. } else {
  16523. elm[key] = cur;
  16524. }
  16525. }
  16526. }
  16527. // check platforms/web/util/attrs.js acceptValue
  16528. function shouldUpdateValue (
  16529. elm,
  16530. vnode,
  16531. checkVal
  16532. ) {
  16533. return (!elm.composing && (
  16534. vnode.tag === 'option' ||
  16535. isDirty(elm, checkVal) ||
  16536. isInputChanged(vnode, checkVal)
  16537. ))
  16538. }
  16539. function isDirty (elm, checkVal) {
  16540. // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
  16541. return document.activeElement !== elm && elm.value !== checkVal
  16542. }
  16543. function isInputChanged (vnode, newVal) {
  16544. var value = vnode.elm.value;
  16545. var modifiers = vnode.elm._vModifiers; // injected by v-model runtime
  16546. if ((modifiers && modifiers.number) || vnode.elm.type === 'number') {
  16547. return toNumber(value) !== toNumber(newVal)
  16548. }
  16549. if (modifiers && modifiers.trim) {
  16550. return value.trim() !== newVal.trim()
  16551. }
  16552. return value !== newVal
  16553. }
  16554. var domProps = {
  16555. create: updateDOMProps,
  16556. update: updateDOMProps
  16557. };
  16558. /* */
  16559. var parseStyleText = cached(function (cssText) {
  16560. var res = {};
  16561. var listDelimiter = /;(?![^(]*\))/g;
  16562. var propertyDelimiter = /:(.+)/;
  16563. cssText.split(listDelimiter).forEach(function (item) {
  16564. if (item) {
  16565. var tmp = item.split(propertyDelimiter);
  16566. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  16567. }
  16568. });
  16569. return res
  16570. });
  16571. // merge static and dynamic style data on the same vnode
  16572. function normalizeStyleData (data) {
  16573. var style = normalizeStyleBinding(data.style);
  16574. // static style is pre-processed into an object during compilation
  16575. // and is always a fresh object, so it's safe to merge into it
  16576. return data.staticStyle
  16577. ? extend(data.staticStyle, style)
  16578. : style
  16579. }
  16580. // normalize possible array / string values into Object
  16581. function normalizeStyleBinding (bindingStyle) {
  16582. if (Array.isArray(bindingStyle)) {
  16583. return toObject(bindingStyle)
  16584. }
  16585. if (typeof bindingStyle === 'string') {
  16586. return parseStyleText(bindingStyle)
  16587. }
  16588. return bindingStyle
  16589. }
  16590. /**
  16591. * parent component style should be after child's
  16592. * so that parent component's style could override it
  16593. */
  16594. function getStyle (vnode, checkChild) {
  16595. var res = {};
  16596. var styleData;
  16597. if (checkChild) {
  16598. var childNode = vnode;
  16599. while (childNode.componentInstance) {
  16600. childNode = childNode.componentInstance._vnode;
  16601. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  16602. extend(res, styleData);
  16603. }
  16604. }
  16605. }
  16606. if ((styleData = normalizeStyleData(vnode.data))) {
  16607. extend(res, styleData);
  16608. }
  16609. var parentNode = vnode;
  16610. while ((parentNode = parentNode.parent)) {
  16611. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  16612. extend(res, styleData);
  16613. }
  16614. }
  16615. return res
  16616. }
  16617. /* */
  16618. var cssVarRE = /^--/;
  16619. var importantRE = /\s*!important$/;
  16620. var setProp = function (el, name, val) {
  16621. /* istanbul ignore if */
  16622. if (cssVarRE.test(name)) {
  16623. el.style.setProperty(name, val);
  16624. } else if (importantRE.test(val)) {
  16625. el.style.setProperty(name, val.replace(importantRE, ''), 'important');
  16626. } else {
  16627. el.style[normalize(name)] = val;
  16628. }
  16629. };
  16630. var prefixes = ['Webkit', 'Moz', 'ms'];
  16631. var testEl;
  16632. var normalize = cached(function (prop) {
  16633. testEl = testEl || document.createElement('div');
  16634. prop = camelize(prop);
  16635. if (prop !== 'filter' && (prop in testEl.style)) {
  16636. return prop
  16637. }
  16638. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  16639. for (var i = 0; i < prefixes.length; i++) {
  16640. var prefixed = prefixes[i] + upper;
  16641. if (prefixed in testEl.style) {
  16642. return prefixed
  16643. }
  16644. }
  16645. });
  16646. function updateStyle (oldVnode, vnode) {
  16647. var data = vnode.data;
  16648. var oldData = oldVnode.data;
  16649. if (!data.staticStyle && !data.style &&
  16650. !oldData.staticStyle && !oldData.style) {
  16651. return
  16652. }
  16653. var cur, name;
  16654. var el = vnode.elm;
  16655. var oldStaticStyle = oldVnode.data.staticStyle;
  16656. var oldStyleBinding = oldVnode.data.style || {};
  16657. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  16658. var oldStyle = oldStaticStyle || oldStyleBinding;
  16659. var style = normalizeStyleBinding(vnode.data.style) || {};
  16660. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  16661. var newStyle = getStyle(vnode, true);
  16662. for (name in oldStyle) {
  16663. if (newStyle[name] == null) {
  16664. setProp(el, name, '');
  16665. }
  16666. }
  16667. for (name in newStyle) {
  16668. cur = newStyle[name];
  16669. if (cur !== oldStyle[name]) {
  16670. // ie9 setting to null has no effect, must use empty string
  16671. setProp(el, name, cur == null ? '' : cur);
  16672. }
  16673. }
  16674. }
  16675. var style = {
  16676. create: updateStyle,
  16677. update: updateStyle
  16678. };
  16679. /* */
  16680. /**
  16681. * Add class with compatibility for SVG since classList is not supported on
  16682. * SVG elements in IE
  16683. */
  16684. function addClass (el, cls) {
  16685. /* istanbul ignore if */
  16686. if (!cls || !cls.trim()) {
  16687. return
  16688. }
  16689. /* istanbul ignore else */
  16690. if (el.classList) {
  16691. if (cls.indexOf(' ') > -1) {
  16692. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  16693. } else {
  16694. el.classList.add(cls);
  16695. }
  16696. } else {
  16697. var cur = ' ' + el.getAttribute('class') + ' ';
  16698. if (cur.indexOf(' ' + cls + ' ') < 0) {
  16699. el.setAttribute('class', (cur + cls).trim());
  16700. }
  16701. }
  16702. }
  16703. /**
  16704. * Remove class with compatibility for SVG since classList is not supported on
  16705. * SVG elements in IE
  16706. */
  16707. function removeClass (el, cls) {
  16708. /* istanbul ignore if */
  16709. if (!cls || !cls.trim()) {
  16710. return
  16711. }
  16712. /* istanbul ignore else */
  16713. if (el.classList) {
  16714. if (cls.indexOf(' ') > -1) {
  16715. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  16716. } else {
  16717. el.classList.remove(cls);
  16718. }
  16719. } else {
  16720. var cur = ' ' + el.getAttribute('class') + ' ';
  16721. var tar = ' ' + cls + ' ';
  16722. while (cur.indexOf(tar) >= 0) {
  16723. cur = cur.replace(tar, ' ');
  16724. }
  16725. el.setAttribute('class', cur.trim());
  16726. }
  16727. }
  16728. /* */
  16729. var hasTransition = inBrowser && !isIE9;
  16730. var TRANSITION = 'transition';
  16731. var ANIMATION = 'animation';
  16732. // Transition property/event sniffing
  16733. var transitionProp = 'transition';
  16734. var transitionEndEvent = 'transitionend';
  16735. var animationProp = 'animation';
  16736. var animationEndEvent = 'animationend';
  16737. if (hasTransition) {
  16738. /* istanbul ignore if */
  16739. if (window.ontransitionend === undefined &&
  16740. window.onwebkittransitionend !== undefined) {
  16741. transitionProp = 'WebkitTransition';
  16742. transitionEndEvent = 'webkitTransitionEnd';
  16743. }
  16744. if (window.onanimationend === undefined &&
  16745. window.onwebkitanimationend !== undefined) {
  16746. animationProp = 'WebkitAnimation';
  16747. animationEndEvent = 'webkitAnimationEnd';
  16748. }
  16749. }
  16750. // binding to window is necessary to make hot reload work in IE in strict mode
  16751. var raf = inBrowser && window.requestAnimationFrame
  16752. ? window.requestAnimationFrame.bind(window)
  16753. : setTimeout;
  16754. function nextFrame (fn) {
  16755. raf(function () {
  16756. raf(fn);
  16757. });
  16758. }
  16759. function addTransitionClass (el, cls) {
  16760. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  16761. addClass(el, cls);
  16762. }
  16763. function removeTransitionClass (el, cls) {
  16764. if (el._transitionClasses) {
  16765. remove$1(el._transitionClasses, cls);
  16766. }
  16767. removeClass(el, cls);
  16768. }
  16769. function whenTransitionEnds (
  16770. el,
  16771. expectedType,
  16772. cb
  16773. ) {
  16774. var ref = getTransitionInfo(el, expectedType);
  16775. var type = ref.type;
  16776. var timeout = ref.timeout;
  16777. var propCount = ref.propCount;
  16778. if (!type) { return cb() }
  16779. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  16780. var ended = 0;
  16781. var end = function () {
  16782. el.removeEventListener(event, onEnd);
  16783. cb();
  16784. };
  16785. var onEnd = function (e) {
  16786. if (e.target === el) {
  16787. if (++ended >= propCount) {
  16788. end();
  16789. }
  16790. }
  16791. };
  16792. setTimeout(function () {
  16793. if (ended < propCount) {
  16794. end();
  16795. }
  16796. }, timeout + 1);
  16797. el.addEventListener(event, onEnd);
  16798. }
  16799. var transformRE = /\b(transform|all)(,|$)/;
  16800. function getTransitionInfo (el, expectedType) {
  16801. var styles = window.getComputedStyle(el);
  16802. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  16803. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  16804. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  16805. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  16806. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  16807. var animationTimeout = getTimeout(animationDelays, animationDurations);
  16808. var type;
  16809. var timeout = 0;
  16810. var propCount = 0;
  16811. /* istanbul ignore if */
  16812. if (expectedType === TRANSITION) {
  16813. if (transitionTimeout > 0) {
  16814. type = TRANSITION;
  16815. timeout = transitionTimeout;
  16816. propCount = transitionDurations.length;
  16817. }
  16818. } else if (expectedType === ANIMATION) {
  16819. if (animationTimeout > 0) {
  16820. type = ANIMATION;
  16821. timeout = animationTimeout;
  16822. propCount = animationDurations.length;
  16823. }
  16824. } else {
  16825. timeout = Math.max(transitionTimeout, animationTimeout);
  16826. type = timeout > 0
  16827. ? transitionTimeout > animationTimeout
  16828. ? TRANSITION
  16829. : ANIMATION
  16830. : null;
  16831. propCount = type
  16832. ? type === TRANSITION
  16833. ? transitionDurations.length
  16834. : animationDurations.length
  16835. : 0;
  16836. }
  16837. var hasTransform =
  16838. type === TRANSITION &&
  16839. transformRE.test(styles[transitionProp + 'Property']);
  16840. return {
  16841. type: type,
  16842. timeout: timeout,
  16843. propCount: propCount,
  16844. hasTransform: hasTransform
  16845. }
  16846. }
  16847. function getTimeout (delays, durations) {
  16848. /* istanbul ignore next */
  16849. while (delays.length < durations.length) {
  16850. delays = delays.concat(delays);
  16851. }
  16852. return Math.max.apply(null, durations.map(function (d, i) {
  16853. return toMs(d) + toMs(delays[i])
  16854. }))
  16855. }
  16856. function toMs (s) {
  16857. return Number(s.slice(0, -1)) * 1000
  16858. }
  16859. /* */
  16860. function enter (vnode, toggleDisplay) {
  16861. var el = vnode.elm;
  16862. // call leave callback now
  16863. if (el._leaveCb) {
  16864. el._leaveCb.cancelled = true;
  16865. el._leaveCb();
  16866. }
  16867. var data = resolveTransition(vnode.data.transition);
  16868. if (!data) {
  16869. return
  16870. }
  16871. /* istanbul ignore if */
  16872. if (el._enterCb || el.nodeType !== 1) {
  16873. return
  16874. }
  16875. var css = data.css;
  16876. var type = data.type;
  16877. var enterClass = data.enterClass;
  16878. var enterToClass = data.enterToClass;
  16879. var enterActiveClass = data.enterActiveClass;
  16880. var appearClass = data.appearClass;
  16881. var appearToClass = data.appearToClass;
  16882. var appearActiveClass = data.appearActiveClass;
  16883. var beforeEnter = data.beforeEnter;
  16884. var enter = data.enter;
  16885. var afterEnter = data.afterEnter;
  16886. var enterCancelled = data.enterCancelled;
  16887. var beforeAppear = data.beforeAppear;
  16888. var appear = data.appear;
  16889. var afterAppear = data.afterAppear;
  16890. var appearCancelled = data.appearCancelled;
  16891. // activeInstance will always be the <transition> component managing this
  16892. // transition. One edge case to check is when the <transition> is placed
  16893. // as the root node of a child component. In that case we need to check
  16894. // <transition>'s parent for appear check.
  16895. var context = activeInstance;
  16896. var transitionNode = activeInstance.$vnode;
  16897. while (transitionNode && transitionNode.parent) {
  16898. transitionNode = transitionNode.parent;
  16899. context = transitionNode.context;
  16900. }
  16901. var isAppear = !context._isMounted || !vnode.isRootInsert;
  16902. if (isAppear && !appear && appear !== '') {
  16903. return
  16904. }
  16905. var startClass = isAppear ? appearClass : enterClass;
  16906. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  16907. var toClass = isAppear ? appearToClass : enterToClass;
  16908. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  16909. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  16910. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  16911. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  16912. var expectsCSS = css !== false && !isIE9;
  16913. var userWantsControl =
  16914. enterHook &&
  16915. // enterHook may be a bound method which exposes
  16916. // the length of original fn as _length
  16917. (enterHook._length || enterHook.length) > 1;
  16918. var cb = el._enterCb = once(function () {
  16919. if (expectsCSS) {
  16920. removeTransitionClass(el, toClass);
  16921. removeTransitionClass(el, activeClass);
  16922. }
  16923. if (cb.cancelled) {
  16924. if (expectsCSS) {
  16925. removeTransitionClass(el, startClass);
  16926. }
  16927. enterCancelledHook && enterCancelledHook(el);
  16928. } else {
  16929. afterEnterHook && afterEnterHook(el);
  16930. }
  16931. el._enterCb = null;
  16932. });
  16933. if (!vnode.data.show) {
  16934. // remove pending leave element on enter by injecting an insert hook
  16935. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  16936. var parent = el.parentNode;
  16937. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  16938. if (pendingNode &&
  16939. pendingNode.tag === vnode.tag &&
  16940. pendingNode.elm._leaveCb) {
  16941. pendingNode.elm._leaveCb();
  16942. }
  16943. enterHook && enterHook(el, cb);
  16944. }, 'transition-insert');
  16945. }
  16946. // start enter transition
  16947. beforeEnterHook && beforeEnterHook(el);
  16948. if (expectsCSS) {
  16949. addTransitionClass(el, startClass);
  16950. addTransitionClass(el, activeClass);
  16951. nextFrame(function () {
  16952. addTransitionClass(el, toClass);
  16953. removeTransitionClass(el, startClass);
  16954. if (!cb.cancelled && !userWantsControl) {
  16955. whenTransitionEnds(el, type, cb);
  16956. }
  16957. });
  16958. }
  16959. if (vnode.data.show) {
  16960. toggleDisplay && toggleDisplay();
  16961. enterHook && enterHook(el, cb);
  16962. }
  16963. if (!expectsCSS && !userWantsControl) {
  16964. cb();
  16965. }
  16966. }
  16967. function leave (vnode, rm) {
  16968. var el = vnode.elm;
  16969. // call enter callback now
  16970. if (el._enterCb) {
  16971. el._enterCb.cancelled = true;
  16972. el._enterCb();
  16973. }
  16974. var data = resolveTransition(vnode.data.transition);
  16975. if (!data) {
  16976. return rm()
  16977. }
  16978. /* istanbul ignore if */
  16979. if (el._leaveCb || el.nodeType !== 1) {
  16980. return
  16981. }
  16982. var css = data.css;
  16983. var type = data.type;
  16984. var leaveClass = data.leaveClass;
  16985. var leaveToClass = data.leaveToClass;
  16986. var leaveActiveClass = data.leaveActiveClass;
  16987. var beforeLeave = data.beforeLeave;
  16988. var leave = data.leave;
  16989. var afterLeave = data.afterLeave;
  16990. var leaveCancelled = data.leaveCancelled;
  16991. var delayLeave = data.delayLeave;
  16992. var expectsCSS = css !== false && !isIE9;
  16993. var userWantsControl =
  16994. leave &&
  16995. // leave hook may be a bound method which exposes
  16996. // the length of original fn as _length
  16997. (leave._length || leave.length) > 1;
  16998. var cb = el._leaveCb = once(function () {
  16999. if (el.parentNode && el.parentNode._pending) {
  17000. el.parentNode._pending[vnode.key] = null;
  17001. }
  17002. if (expectsCSS) {
  17003. removeTransitionClass(el, leaveToClass);
  17004. removeTransitionClass(el, leaveActiveClass);
  17005. }
  17006. if (cb.cancelled) {
  17007. if (expectsCSS) {
  17008. removeTransitionClass(el, leaveClass);
  17009. }
  17010. leaveCancelled && leaveCancelled(el);
  17011. } else {
  17012. rm();
  17013. afterLeave && afterLeave(el);
  17014. }
  17015. el._leaveCb = null;
  17016. });
  17017. if (delayLeave) {
  17018. delayLeave(performLeave);
  17019. } else {
  17020. performLeave();
  17021. }
  17022. function performLeave () {
  17023. // the delayed leave may have already been cancelled
  17024. if (cb.cancelled) {
  17025. return
  17026. }
  17027. // record leaving element
  17028. if (!vnode.data.show) {
  17029. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  17030. }
  17031. beforeLeave && beforeLeave(el);
  17032. if (expectsCSS) {
  17033. addTransitionClass(el, leaveClass);
  17034. addTransitionClass(el, leaveActiveClass);
  17035. nextFrame(function () {
  17036. addTransitionClass(el, leaveToClass);
  17037. removeTransitionClass(el, leaveClass);
  17038. if (!cb.cancelled && !userWantsControl) {
  17039. whenTransitionEnds(el, type, cb);
  17040. }
  17041. });
  17042. }
  17043. leave && leave(el, cb);
  17044. if (!expectsCSS && !userWantsControl) {
  17045. cb();
  17046. }
  17047. }
  17048. }
  17049. function resolveTransition (def$$1) {
  17050. if (!def$$1) {
  17051. return
  17052. }
  17053. /* istanbul ignore else */
  17054. if (typeof def$$1 === 'object') {
  17055. var res = {};
  17056. if (def$$1.css !== false) {
  17057. extend(res, autoCssTransition(def$$1.name || 'v'));
  17058. }
  17059. extend(res, def$$1);
  17060. return res
  17061. } else if (typeof def$$1 === 'string') {
  17062. return autoCssTransition(def$$1)
  17063. }
  17064. }
  17065. var autoCssTransition = cached(function (name) {
  17066. return {
  17067. enterClass: (name + "-enter"),
  17068. leaveClass: (name + "-leave"),
  17069. appearClass: (name + "-enter"),
  17070. enterToClass: (name + "-enter-to"),
  17071. leaveToClass: (name + "-leave-to"),
  17072. appearToClass: (name + "-enter-to"),
  17073. enterActiveClass: (name + "-enter-active"),
  17074. leaveActiveClass: (name + "-leave-active"),
  17075. appearActiveClass: (name + "-enter-active")
  17076. }
  17077. });
  17078. function once (fn) {
  17079. var called = false;
  17080. return function () {
  17081. if (!called) {
  17082. called = true;
  17083. fn();
  17084. }
  17085. }
  17086. }
  17087. function _enter (_, vnode) {
  17088. if (!vnode.data.show) {
  17089. enter(vnode);
  17090. }
  17091. }
  17092. var transition = inBrowser ? {
  17093. create: _enter,
  17094. activate: _enter,
  17095. remove: function remove (vnode, rm) {
  17096. /* istanbul ignore else */
  17097. if (!vnode.data.show) {
  17098. leave(vnode, rm);
  17099. } else {
  17100. rm();
  17101. }
  17102. }
  17103. } : {};
  17104. var platformModules = [
  17105. attrs,
  17106. klass,
  17107. events,
  17108. domProps,
  17109. style,
  17110. transition
  17111. ];
  17112. /* */
  17113. // the directive module should be applied last, after all
  17114. // built-in modules have been applied.
  17115. var modules = platformModules.concat(baseModules);
  17116. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  17117. /**
  17118. * Not type checking this file because flow doesn't like attaching
  17119. * properties to Elements.
  17120. */
  17121. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  17122. /* istanbul ignore if */
  17123. if (isIE9) {
  17124. // http://www.matts411.com/post/internet-explorer-9-oninput/
  17125. document.addEventListener('selectionchange', function () {
  17126. var el = document.activeElement;
  17127. if (el && el.vmodel) {
  17128. trigger(el, 'input');
  17129. }
  17130. });
  17131. }
  17132. var model = {
  17133. inserted: function inserted (el, binding, vnode) {
  17134. if (process.env.NODE_ENV !== 'production') {
  17135. if (!modelableTagRE.test(vnode.tag)) {
  17136. warn(
  17137. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  17138. 'If you are working with contenteditable, it\'s recommended to ' +
  17139. 'wrap a library dedicated for that purpose inside a custom component.',
  17140. vnode.context
  17141. );
  17142. }
  17143. }
  17144. if (vnode.tag === 'select') {
  17145. var cb = function () {
  17146. setSelected(el, binding, vnode.context);
  17147. };
  17148. cb();
  17149. /* istanbul ignore if */
  17150. if (isIE || isEdge) {
  17151. setTimeout(cb, 0);
  17152. }
  17153. } else if (vnode.tag === 'textarea' || el.type === 'text') {
  17154. el._vModifiers = binding.modifiers;
  17155. if (!binding.modifiers.lazy) {
  17156. if (!isAndroid) {
  17157. el.addEventListener('compositionstart', onCompositionStart);
  17158. el.addEventListener('compositionend', onCompositionEnd);
  17159. }
  17160. /* istanbul ignore if */
  17161. if (isIE9) {
  17162. el.vmodel = true;
  17163. }
  17164. }
  17165. }
  17166. },
  17167. componentUpdated: function componentUpdated (el, binding, vnode) {
  17168. if (vnode.tag === 'select') {
  17169. setSelected(el, binding, vnode.context);
  17170. // in case the options rendered by v-for have changed,
  17171. // it's possible that the value is out-of-sync with the rendered options.
  17172. // detect such cases and filter out values that no longer has a matching
  17173. // option in the DOM.
  17174. var needReset = el.multiple
  17175. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  17176. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  17177. if (needReset) {
  17178. trigger(el, 'change');
  17179. }
  17180. }
  17181. }
  17182. };
  17183. function setSelected (el, binding, vm) {
  17184. var value = binding.value;
  17185. var isMultiple = el.multiple;
  17186. if (isMultiple && !Array.isArray(value)) {
  17187. process.env.NODE_ENV !== 'production' && warn(
  17188. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  17189. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  17190. vm
  17191. );
  17192. return
  17193. }
  17194. var selected, option;
  17195. for (var i = 0, l = el.options.length; i < l; i++) {
  17196. option = el.options[i];
  17197. if (isMultiple) {
  17198. selected = looseIndexOf(value, getValue(option)) > -1;
  17199. if (option.selected !== selected) {
  17200. option.selected = selected;
  17201. }
  17202. } else {
  17203. if (looseEqual(getValue(option), value)) {
  17204. if (el.selectedIndex !== i) {
  17205. el.selectedIndex = i;
  17206. }
  17207. return
  17208. }
  17209. }
  17210. }
  17211. if (!isMultiple) {
  17212. el.selectedIndex = -1;
  17213. }
  17214. }
  17215. function hasNoMatchingOption (value, options) {
  17216. for (var i = 0, l = options.length; i < l; i++) {
  17217. if (looseEqual(getValue(options[i]), value)) {
  17218. return false
  17219. }
  17220. }
  17221. return true
  17222. }
  17223. function getValue (option) {
  17224. return '_value' in option
  17225. ? option._value
  17226. : option.value
  17227. }
  17228. function onCompositionStart (e) {
  17229. e.target.composing = true;
  17230. }
  17231. function onCompositionEnd (e) {
  17232. e.target.composing = false;
  17233. trigger(e.target, 'input');
  17234. }
  17235. function trigger (el, type) {
  17236. var e = document.createEvent('HTMLEvents');
  17237. e.initEvent(type, true, true);
  17238. el.dispatchEvent(e);
  17239. }
  17240. /* */
  17241. // recursively search for possible transition defined inside the component root
  17242. function locateNode (vnode) {
  17243. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  17244. ? locateNode(vnode.componentInstance._vnode)
  17245. : vnode
  17246. }
  17247. var show = {
  17248. bind: function bind (el, ref, vnode) {
  17249. var value = ref.value;
  17250. vnode = locateNode(vnode);
  17251. var transition = vnode.data && vnode.data.transition;
  17252. var originalDisplay = el.__vOriginalDisplay =
  17253. el.style.display === 'none' ? '' : el.style.display;
  17254. if (value && transition && !isIE9) {
  17255. vnode.data.show = true;
  17256. enter(vnode, function () {
  17257. el.style.display = originalDisplay;
  17258. });
  17259. } else {
  17260. el.style.display = value ? originalDisplay : 'none';
  17261. }
  17262. },
  17263. update: function update (el, ref, vnode) {
  17264. var value = ref.value;
  17265. var oldValue = ref.oldValue;
  17266. /* istanbul ignore if */
  17267. if (value === oldValue) { return }
  17268. vnode = locateNode(vnode);
  17269. var transition = vnode.data && vnode.data.transition;
  17270. if (transition && !isIE9) {
  17271. vnode.data.show = true;
  17272. if (value) {
  17273. enter(vnode, function () {
  17274. el.style.display = el.__vOriginalDisplay;
  17275. });
  17276. } else {
  17277. leave(vnode, function () {
  17278. el.style.display = 'none';
  17279. });
  17280. }
  17281. } else {
  17282. el.style.display = value ? el.__vOriginalDisplay : 'none';
  17283. }
  17284. },
  17285. unbind: function unbind (
  17286. el,
  17287. binding,
  17288. vnode,
  17289. oldVnode,
  17290. isDestroy
  17291. ) {
  17292. if (!isDestroy) {
  17293. el.style.display = el.__vOriginalDisplay;
  17294. }
  17295. }
  17296. };
  17297. var platformDirectives = {
  17298. model: model,
  17299. show: show
  17300. };
  17301. /* */
  17302. // Provides transition support for a single element/component.
  17303. // supports transition mode (out-in / in-out)
  17304. var transitionProps = {
  17305. name: String,
  17306. appear: Boolean,
  17307. css: Boolean,
  17308. mode: String,
  17309. type: String,
  17310. enterClass: String,
  17311. leaveClass: String,
  17312. enterToClass: String,
  17313. leaveToClass: String,
  17314. enterActiveClass: String,
  17315. leaveActiveClass: String,
  17316. appearClass: String,
  17317. appearActiveClass: String,
  17318. appearToClass: String
  17319. };
  17320. // in case the child is also an abstract component, e.g. <keep-alive>
  17321. // we want to recursively retrieve the real component to be rendered
  17322. function getRealChild (vnode) {
  17323. var compOptions = vnode && vnode.componentOptions;
  17324. if (compOptions && compOptions.Ctor.options.abstract) {
  17325. return getRealChild(getFirstComponentChild(compOptions.children))
  17326. } else {
  17327. return vnode
  17328. }
  17329. }
  17330. function extractTransitionData (comp) {
  17331. var data = {};
  17332. var options = comp.$options;
  17333. // props
  17334. for (var key in options.propsData) {
  17335. data[key] = comp[key];
  17336. }
  17337. // events.
  17338. // extract listeners and pass them directly to the transition methods
  17339. var listeners = options._parentListeners;
  17340. for (var key$1 in listeners) {
  17341. data[camelize(key$1)] = listeners[key$1].fn;
  17342. }
  17343. return data
  17344. }
  17345. function placeholder (h, rawChild) {
  17346. return /\d-keep-alive$/.test(rawChild.tag)
  17347. ? h('keep-alive')
  17348. : null
  17349. }
  17350. function hasParentTransition (vnode) {
  17351. while ((vnode = vnode.parent)) {
  17352. if (vnode.data.transition) {
  17353. return true
  17354. }
  17355. }
  17356. }
  17357. function isSameChild (child, oldChild) {
  17358. return oldChild.key === child.key && oldChild.tag === child.tag
  17359. }
  17360. var Transition = {
  17361. name: 'transition',
  17362. props: transitionProps,
  17363. abstract: true,
  17364. render: function render (h) {
  17365. var this$1 = this;
  17366. var children = this.$slots.default;
  17367. if (!children) {
  17368. return
  17369. }
  17370. // filter out text nodes (possible whitespaces)
  17371. children = children.filter(function (c) { return c.tag; });
  17372. /* istanbul ignore if */
  17373. if (!children.length) {
  17374. return
  17375. }
  17376. // warn multiple elements
  17377. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  17378. warn(
  17379. '<transition> can only be used on a single element. Use ' +
  17380. '<transition-group> for lists.',
  17381. this.$parent
  17382. );
  17383. }
  17384. var mode = this.mode;
  17385. // warn invalid mode
  17386. if (process.env.NODE_ENV !== 'production' &&
  17387. mode && mode !== 'in-out' && mode !== 'out-in') {
  17388. warn(
  17389. 'invalid <transition> mode: ' + mode,
  17390. this.$parent
  17391. );
  17392. }
  17393. var rawChild = children[0];
  17394. // if this is a component root node and the component's
  17395. // parent container node also has transition, skip.
  17396. if (hasParentTransition(this.$vnode)) {
  17397. return rawChild
  17398. }
  17399. // apply transition data to child
  17400. // use getRealChild() to ignore abstract components e.g. keep-alive
  17401. var child = getRealChild(rawChild);
  17402. /* istanbul ignore if */
  17403. if (!child) {
  17404. return rawChild
  17405. }
  17406. if (this._leaving) {
  17407. return placeholder(h, rawChild)
  17408. }
  17409. // ensure a key that is unique to the vnode type and to this transition
  17410. // component instance. This key will be used to remove pending leaving nodes
  17411. // during entering.
  17412. var id = "__transition-" + (this._uid) + "-";
  17413. var key = child.key = child.key == null
  17414. ? id + child.tag
  17415. : isPrimitive(child.key)
  17416. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  17417. : child.key;
  17418. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  17419. var oldRawChild = this._vnode;
  17420. var oldChild = getRealChild(oldRawChild);
  17421. // mark v-show
  17422. // so that the transition module can hand over the control to the directive
  17423. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  17424. child.data.show = true;
  17425. }
  17426. if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
  17427. // replace old child transition data with fresh one
  17428. // important for dynamic transitions!
  17429. var oldData = oldChild && (oldChild.data.transition = extend({}, data));
  17430. // handle transition mode
  17431. if (mode === 'out-in') {
  17432. // return placeholder node and queue update when leave finishes
  17433. this._leaving = true;
  17434. mergeVNodeHook(oldData, 'afterLeave', function () {
  17435. this$1._leaving = false;
  17436. this$1.$forceUpdate();
  17437. }, key);
  17438. return placeholder(h, rawChild)
  17439. } else if (mode === 'in-out') {
  17440. var delayedLeave;
  17441. var performLeave = function () { delayedLeave(); };
  17442. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  17443. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  17444. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  17445. delayedLeave = leave;
  17446. }, key);
  17447. }
  17448. }
  17449. return rawChild
  17450. }
  17451. };
  17452. /* */
  17453. // Provides transition support for list items.
  17454. // supports move transitions using the FLIP technique.
  17455. // Because the vdom's children update algorithm is "unstable" - i.e.
  17456. // it doesn't guarantee the relative positioning of removed elements,
  17457. // we force transition-group to update its children into two passes:
  17458. // in the first pass, we remove all nodes that need to be removed,
  17459. // triggering their leaving transition; in the second pass, we insert/move
  17460. // into the final disired state. This way in the second pass removed
  17461. // nodes will remain where they should be.
  17462. var props = extend({
  17463. tag: String,
  17464. moveClass: String
  17465. }, transitionProps);
  17466. delete props.mode;
  17467. var TransitionGroup = {
  17468. props: props,
  17469. render: function render (h) {
  17470. var tag = this.tag || this.$vnode.data.tag || 'span';
  17471. var map = Object.create(null);
  17472. var prevChildren = this.prevChildren = this.children;
  17473. var rawChildren = this.$slots.default || [];
  17474. var children = this.children = [];
  17475. var transitionData = extractTransitionData(this);
  17476. for (var i = 0; i < rawChildren.length; i++) {
  17477. var c = rawChildren[i];
  17478. if (c.tag) {
  17479. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  17480. children.push(c);
  17481. map[c.key] = c
  17482. ;(c.data || (c.data = {})).transition = transitionData;
  17483. } else if (process.env.NODE_ENV !== 'production') {
  17484. var opts = c.componentOptions;
  17485. var name = opts
  17486. ? (opts.Ctor.options.name || opts.tag)
  17487. : c.tag;
  17488. warn(("<transition-group> children must be keyed: <" + name + ">"));
  17489. }
  17490. }
  17491. }
  17492. if (prevChildren) {
  17493. var kept = [];
  17494. var removed = [];
  17495. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  17496. var c$1 = prevChildren[i$1];
  17497. c$1.data.transition = transitionData;
  17498. c$1.data.pos = c$1.elm.getBoundingClientRect();
  17499. if (map[c$1.key]) {
  17500. kept.push(c$1);
  17501. } else {
  17502. removed.push(c$1);
  17503. }
  17504. }
  17505. this.kept = h(tag, null, kept);
  17506. this.removed = removed;
  17507. }
  17508. return h(tag, null, children)
  17509. },
  17510. beforeUpdate: function beforeUpdate () {
  17511. // force removing pass
  17512. this.__patch__(
  17513. this._vnode,
  17514. this.kept,
  17515. false, // hydrating
  17516. true // removeOnly (!important, avoids unnecessary moves)
  17517. );
  17518. this._vnode = this.kept;
  17519. },
  17520. updated: function updated () {
  17521. var children = this.prevChildren;
  17522. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  17523. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  17524. return
  17525. }
  17526. // we divide the work into three loops to avoid mixing DOM reads and writes
  17527. // in each iteration - which helps prevent layout thrashing.
  17528. children.forEach(callPendingCbs);
  17529. children.forEach(recordPosition);
  17530. children.forEach(applyTranslation);
  17531. // force reflow to put everything in position
  17532. var f = document.body.offsetHeight; // eslint-disable-line
  17533. children.forEach(function (c) {
  17534. if (c.data.moved) {
  17535. var el = c.elm;
  17536. var s = el.style;
  17537. addTransitionClass(el, moveClass);
  17538. s.transform = s.WebkitTransform = s.transitionDuration = '';
  17539. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  17540. if (!e || /transform$/.test(e.propertyName)) {
  17541. el.removeEventListener(transitionEndEvent, cb);
  17542. el._moveCb = null;
  17543. removeTransitionClass(el, moveClass);
  17544. }
  17545. });
  17546. }
  17547. });
  17548. },
  17549. methods: {
  17550. hasMove: function hasMove (el, moveClass) {
  17551. /* istanbul ignore if */
  17552. if (!hasTransition) {
  17553. return false
  17554. }
  17555. if (this._hasMove != null) {
  17556. return this._hasMove
  17557. }
  17558. addTransitionClass(el, moveClass);
  17559. var info = getTransitionInfo(el);
  17560. removeTransitionClass(el, moveClass);
  17561. return (this._hasMove = info.hasTransform)
  17562. }
  17563. }
  17564. };
  17565. function callPendingCbs (c) {
  17566. /* istanbul ignore if */
  17567. if (c.elm._moveCb) {
  17568. c.elm._moveCb();
  17569. }
  17570. /* istanbul ignore if */
  17571. if (c.elm._enterCb) {
  17572. c.elm._enterCb();
  17573. }
  17574. }
  17575. function recordPosition (c) {
  17576. c.data.newPos = c.elm.getBoundingClientRect();
  17577. }
  17578. function applyTranslation (c) {
  17579. var oldPos = c.data.pos;
  17580. var newPos = c.data.newPos;
  17581. var dx = oldPos.left - newPos.left;
  17582. var dy = oldPos.top - newPos.top;
  17583. if (dx || dy) {
  17584. c.data.moved = true;
  17585. var s = c.elm.style;
  17586. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  17587. s.transitionDuration = '0s';
  17588. }
  17589. }
  17590. var platformComponents = {
  17591. Transition: Transition,
  17592. TransitionGroup: TransitionGroup
  17593. };
  17594. /* */
  17595. // install platform specific utils
  17596. Vue$3.config.isUnknownElement = isUnknownElement;
  17597. Vue$3.config.isReservedTag = isReservedTag;
  17598. Vue$3.config.getTagNamespace = getTagNamespace;
  17599. Vue$3.config.mustUseProp = mustUseProp;
  17600. // install platform runtime directives & components
  17601. extend(Vue$3.options.directives, platformDirectives);
  17602. extend(Vue$3.options.components, platformComponents);
  17603. // install platform patch function
  17604. Vue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;
  17605. // wrap mount
  17606. Vue$3.prototype.$mount = function (
  17607. el,
  17608. hydrating
  17609. ) {
  17610. el = el && inBrowser ? query(el) : undefined;
  17611. return this._mount(el, hydrating)
  17612. };
  17613. if (process.env.NODE_ENV !== 'production' &&
  17614. inBrowser && typeof console !== 'undefined') {
  17615. console[console.info ? 'info' : 'log'](
  17616. "You are running Vue in development mode.\n" +
  17617. "Make sure to turn on production mode when deploying for production.\n" +
  17618. "See more tips at https://vuejs.org/guide/deployment.html"
  17619. );
  17620. }
  17621. // devtools global hook
  17622. /* istanbul ignore next */
  17623. setTimeout(function () {
  17624. if (config.devtools) {
  17625. if (devtools) {
  17626. devtools.emit('init', Vue$3);
  17627. } else if (
  17628. process.env.NODE_ENV !== 'production' &&
  17629. inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
  17630. ) {
  17631. console[console.info ? 'info' : 'log'](
  17632. 'Download the Vue Devtools extension for a better development experience:\n' +
  17633. 'https://github.com/vuejs/vue-devtools'
  17634. );
  17635. }
  17636. }
  17637. }, 0);
  17638. /* */
  17639. // check whether current browser encodes a char inside attribute values
  17640. function shouldDecode (content, encoded) {
  17641. var div = document.createElement('div');
  17642. div.innerHTML = "<div a=\"" + content + "\">";
  17643. return div.innerHTML.indexOf(encoded) > 0
  17644. }
  17645. // #3663
  17646. // IE encodes newlines inside attribute values while other browsers don't
  17647. var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
  17648. /* */
  17649. var decoder;
  17650. function decode (html) {
  17651. decoder = decoder || document.createElement('div');
  17652. decoder.innerHTML = html;
  17653. return decoder.textContent
  17654. }
  17655. /* */
  17656. var isUnaryTag = makeMap(
  17657. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  17658. 'link,meta,param,source,track,wbr',
  17659. true
  17660. );
  17661. // Elements that you can, intentionally, leave open
  17662. // (and which close themselves)
  17663. var canBeLeftOpenTag = makeMap(
  17664. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  17665. true
  17666. );
  17667. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  17668. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  17669. var isNonPhrasingTag = makeMap(
  17670. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  17671. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  17672. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  17673. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  17674. 'title,tr,track',
  17675. true
  17676. );
  17677. /**
  17678. * Not type-checking this file because it's mostly vendor code.
  17679. */
  17680. /*!
  17681. * HTML Parser By John Resig (ejohn.org)
  17682. * Modified by Juriy "kangax" Zaytsev
  17683. * Original code by Erik Arvidsson, Mozilla Public License
  17684. * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
  17685. */
  17686. // Regular Expressions for parsing tags and attributes
  17687. var singleAttrIdentifier = /([^\s"'<>/=]+)/;
  17688. var singleAttrAssign = /(?:=)/;
  17689. var singleAttrValues = [
  17690. // attr value double quotes
  17691. /"([^"]*)"+/.source,
  17692. // attr value, single quotes
  17693. /'([^']*)'+/.source,
  17694. // attr value, no quotes
  17695. /([^\s"'=<>`]+)/.source
  17696. ];
  17697. var attribute = new RegExp(
  17698. '^\\s*' + singleAttrIdentifier.source +
  17699. '(?:\\s*(' + singleAttrAssign.source + ')' +
  17700. '\\s*(?:' + singleAttrValues.join('|') + '))?'
  17701. );
  17702. // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
  17703. // but for Vue templates we can enforce a simple charset
  17704. var ncname = '[a-zA-Z_][\\w\\-\\.]*';
  17705. var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
  17706. var startTagOpen = new RegExp('^<' + qnameCapture);
  17707. var startTagClose = /^\s*(\/?)>/;
  17708. var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
  17709. var doctype = /^<!DOCTYPE [^>]+>/i;
  17710. var comment = /^<!--/;
  17711. var conditionalComment = /^<!\[/;
  17712. var IS_REGEX_CAPTURING_BROKEN = false;
  17713. 'x'.replace(/x(.)?/g, function (m, g) {
  17714. IS_REGEX_CAPTURING_BROKEN = g === '';
  17715. });
  17716. // Special Elements (can contain anything)
  17717. var isScriptOrStyle = makeMap('script,style', true);
  17718. var reCache = {};
  17719. var ltRE = /&lt;/g;
  17720. var gtRE = /&gt;/g;
  17721. var nlRE = /&#10;/g;
  17722. var ampRE = /&amp;/g;
  17723. var quoteRE = /&quot;/g;
  17724. function decodeAttr (value, shouldDecodeNewlines) {
  17725. if (shouldDecodeNewlines) {
  17726. value = value.replace(nlRE, '\n');
  17727. }
  17728. return value
  17729. .replace(ltRE, '<')
  17730. .replace(gtRE, '>')
  17731. .replace(ampRE, '&')
  17732. .replace(quoteRE, '"')
  17733. }
  17734. function parseHTML (html, options) {
  17735. var stack = [];
  17736. var expectHTML = options.expectHTML;
  17737. var isUnaryTag$$1 = options.isUnaryTag || no;
  17738. var index = 0;
  17739. var last, lastTag;
  17740. while (html) {
  17741. last = html;
  17742. // Make sure we're not in a script or style element
  17743. if (!lastTag || !isScriptOrStyle(lastTag)) {
  17744. var textEnd = html.indexOf('<');
  17745. if (textEnd === 0) {
  17746. // Comment:
  17747. if (comment.test(html)) {
  17748. var commentEnd = html.indexOf('-->');
  17749. if (commentEnd >= 0) {
  17750. advance(commentEnd + 3);
  17751. continue
  17752. }
  17753. }
  17754. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  17755. if (conditionalComment.test(html)) {
  17756. var conditionalEnd = html.indexOf(']>');
  17757. if (conditionalEnd >= 0) {
  17758. advance(conditionalEnd + 2);
  17759. continue
  17760. }
  17761. }
  17762. // Doctype:
  17763. var doctypeMatch = html.match(doctype);
  17764. if (doctypeMatch) {
  17765. advance(doctypeMatch[0].length);
  17766. continue
  17767. }
  17768. // End tag:
  17769. var endTagMatch = html.match(endTag);
  17770. if (endTagMatch) {
  17771. var curIndex = index;
  17772. advance(endTagMatch[0].length);
  17773. parseEndTag(endTagMatch[1], curIndex, index);
  17774. continue
  17775. }
  17776. // Start tag:
  17777. var startTagMatch = parseStartTag();
  17778. if (startTagMatch) {
  17779. handleStartTag(startTagMatch);
  17780. continue
  17781. }
  17782. }
  17783. var text = (void 0), rest$1 = (void 0), next = (void 0);
  17784. if (textEnd > 0) {
  17785. rest$1 = html.slice(textEnd);
  17786. while (
  17787. !endTag.test(rest$1) &&
  17788. !startTagOpen.test(rest$1) &&
  17789. !comment.test(rest$1) &&
  17790. !conditionalComment.test(rest$1)
  17791. ) {
  17792. // < in plain text, be forgiving and treat it as text
  17793. next = rest$1.indexOf('<', 1);
  17794. if (next < 0) { break }
  17795. textEnd += next;
  17796. rest$1 = html.slice(textEnd);
  17797. }
  17798. text = html.substring(0, textEnd);
  17799. advance(textEnd);
  17800. }
  17801. if (textEnd < 0) {
  17802. text = html;
  17803. html = '';
  17804. }
  17805. if (options.chars && text) {
  17806. options.chars(text);
  17807. }
  17808. } else {
  17809. var stackedTag = lastTag.toLowerCase();
  17810. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  17811. var endTagLength = 0;
  17812. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  17813. endTagLength = endTag.length;
  17814. if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
  17815. text = text
  17816. .replace(/<!--([\s\S]*?)-->/g, '$1')
  17817. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  17818. }
  17819. if (options.chars) {
  17820. options.chars(text);
  17821. }
  17822. return ''
  17823. });
  17824. index += html.length - rest.length;
  17825. html = rest;
  17826. parseEndTag(stackedTag, index - endTagLength, index);
  17827. }
  17828. if (html === last && options.chars) {
  17829. options.chars(html);
  17830. break
  17831. }
  17832. }
  17833. // Clean up any remaining tags
  17834. parseEndTag();
  17835. function advance (n) {
  17836. index += n;
  17837. html = html.substring(n);
  17838. }
  17839. function parseStartTag () {
  17840. var start = html.match(startTagOpen);
  17841. if (start) {
  17842. var match = {
  17843. tagName: start[1],
  17844. attrs: [],
  17845. start: index
  17846. };
  17847. advance(start[0].length);
  17848. var end, attr;
  17849. while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
  17850. advance(attr[0].length);
  17851. match.attrs.push(attr);
  17852. }
  17853. if (end) {
  17854. match.unarySlash = end[1];
  17855. advance(end[0].length);
  17856. match.end = index;
  17857. return match
  17858. }
  17859. }
  17860. }
  17861. function handleStartTag (match) {
  17862. var tagName = match.tagName;
  17863. var unarySlash = match.unarySlash;
  17864. if (expectHTML) {
  17865. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  17866. parseEndTag(lastTag);
  17867. }
  17868. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  17869. parseEndTag(tagName);
  17870. }
  17871. }
  17872. var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
  17873. var l = match.attrs.length;
  17874. var attrs = new Array(l);
  17875. for (var i = 0; i < l; i++) {
  17876. var args = match.attrs[i];
  17877. // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
  17878. if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
  17879. if (args[3] === '') { delete args[3]; }
  17880. if (args[4] === '') { delete args[4]; }
  17881. if (args[5] === '') { delete args[5]; }
  17882. }
  17883. var value = args[3] || args[4] || args[5] || '';
  17884. attrs[i] = {
  17885. name: args[1],
  17886. value: decodeAttr(
  17887. value,
  17888. options.shouldDecodeNewlines
  17889. )
  17890. };
  17891. }
  17892. if (!unary) {
  17893. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
  17894. lastTag = tagName;
  17895. unarySlash = '';
  17896. }
  17897. if (options.start) {
  17898. options.start(tagName, attrs, unary, match.start, match.end);
  17899. }
  17900. }
  17901. function parseEndTag (tagName, start, end) {
  17902. var pos, lowerCasedTagName;
  17903. if (start == null) { start = index; }
  17904. if (end == null) { end = index; }
  17905. if (tagName) {
  17906. lowerCasedTagName = tagName.toLowerCase();
  17907. }
  17908. // Find the closest opened tag of the same type
  17909. if (tagName) {
  17910. for (pos = stack.length - 1; pos >= 0; pos--) {
  17911. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  17912. break
  17913. }
  17914. }
  17915. } else {
  17916. // If no tag name is provided, clean shop
  17917. pos = 0;
  17918. }
  17919. if (pos >= 0) {
  17920. // Close all the open elements, up the stack
  17921. for (var i = stack.length - 1; i >= pos; i--) {
  17922. if (options.end) {
  17923. options.end(stack[i].tag, start, end);
  17924. }
  17925. }
  17926. // Remove the open elements from the stack
  17927. stack.length = pos;
  17928. lastTag = pos && stack[pos - 1].tag;
  17929. } else if (lowerCasedTagName === 'br') {
  17930. if (options.start) {
  17931. options.start(tagName, [], true, start, end);
  17932. }
  17933. } else if (lowerCasedTagName === 'p') {
  17934. if (options.start) {
  17935. options.start(tagName, [], false, start, end);
  17936. }
  17937. if (options.end) {
  17938. options.end(tagName, start, end);
  17939. }
  17940. }
  17941. }
  17942. }
  17943. /* */
  17944. function parseFilters (exp) {
  17945. var inSingle = false;
  17946. var inDouble = false;
  17947. var inTemplateString = false;
  17948. var inRegex = false;
  17949. var curly = 0;
  17950. var square = 0;
  17951. var paren = 0;
  17952. var lastFilterIndex = 0;
  17953. var c, prev, i, expression, filters;
  17954. for (i = 0; i < exp.length; i++) {
  17955. prev = c;
  17956. c = exp.charCodeAt(i);
  17957. if (inSingle) {
  17958. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  17959. } else if (inDouble) {
  17960. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  17961. } else if (inTemplateString) {
  17962. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  17963. } else if (inRegex) {
  17964. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  17965. } else if (
  17966. c === 0x7C && // pipe
  17967. exp.charCodeAt(i + 1) !== 0x7C &&
  17968. exp.charCodeAt(i - 1) !== 0x7C &&
  17969. !curly && !square && !paren
  17970. ) {
  17971. if (expression === undefined) {
  17972. // first filter, end of expression
  17973. lastFilterIndex = i + 1;
  17974. expression = exp.slice(0, i).trim();
  17975. } else {
  17976. pushFilter();
  17977. }
  17978. } else {
  17979. switch (c) {
  17980. case 0x22: inDouble = true; break // "
  17981. case 0x27: inSingle = true; break // '
  17982. case 0x60: inTemplateString = true; break // `
  17983. case 0x28: paren++; break // (
  17984. case 0x29: paren--; break // )
  17985. case 0x5B: square++; break // [
  17986. case 0x5D: square--; break // ]
  17987. case 0x7B: curly++; break // {
  17988. case 0x7D: curly--; break // }
  17989. }
  17990. if (c === 0x2f) { // /
  17991. var j = i - 1;
  17992. var p = (void 0);
  17993. // find first non-whitespace prev char
  17994. for (; j >= 0; j--) {
  17995. p = exp.charAt(j);
  17996. if (p !== ' ') { break }
  17997. }
  17998. if (!p || !/[\w$]/.test(p)) {
  17999. inRegex = true;
  18000. }
  18001. }
  18002. }
  18003. }
  18004. if (expression === undefined) {
  18005. expression = exp.slice(0, i).trim();
  18006. } else if (lastFilterIndex !== 0) {
  18007. pushFilter();
  18008. }
  18009. function pushFilter () {
  18010. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  18011. lastFilterIndex = i + 1;
  18012. }
  18013. if (filters) {
  18014. for (i = 0; i < filters.length; i++) {
  18015. expression = wrapFilter(expression, filters[i]);
  18016. }
  18017. }
  18018. return expression
  18019. }
  18020. function wrapFilter (exp, filter) {
  18021. var i = filter.indexOf('(');
  18022. if (i < 0) {
  18023. // _f: resolveFilter
  18024. return ("_f(\"" + filter + "\")(" + exp + ")")
  18025. } else {
  18026. var name = filter.slice(0, i);
  18027. var args = filter.slice(i + 1);
  18028. return ("_f(\"" + name + "\")(" + exp + "," + args)
  18029. }
  18030. }
  18031. /* */
  18032. var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
  18033. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  18034. var buildRegex = cached(function (delimiters) {
  18035. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  18036. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  18037. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  18038. });
  18039. function parseText (
  18040. text,
  18041. delimiters
  18042. ) {
  18043. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  18044. if (!tagRE.test(text)) {
  18045. return
  18046. }
  18047. var tokens = [];
  18048. var lastIndex = tagRE.lastIndex = 0;
  18049. var match, index;
  18050. while ((match = tagRE.exec(text))) {
  18051. index = match.index;
  18052. // push text token
  18053. if (index > lastIndex) {
  18054. tokens.push(JSON.stringify(text.slice(lastIndex, index)));
  18055. }
  18056. // tag token
  18057. var exp = parseFilters(match[1].trim());
  18058. tokens.push(("_s(" + exp + ")"));
  18059. lastIndex = index + match[0].length;
  18060. }
  18061. if (lastIndex < text.length) {
  18062. tokens.push(JSON.stringify(text.slice(lastIndex)));
  18063. }
  18064. return tokens.join('+')
  18065. }
  18066. /* */
  18067. function baseWarn (msg) {
  18068. console.error(("[Vue parser]: " + msg));
  18069. }
  18070. function pluckModuleFunction (
  18071. modules,
  18072. key
  18073. ) {
  18074. return modules
  18075. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  18076. : []
  18077. }
  18078. function addProp (el, name, value) {
  18079. (el.props || (el.props = [])).push({ name: name, value: value });
  18080. }
  18081. function addAttr (el, name, value) {
  18082. (el.attrs || (el.attrs = [])).push({ name: name, value: value });
  18083. }
  18084. function addDirective (
  18085. el,
  18086. name,
  18087. rawName,
  18088. value,
  18089. arg,
  18090. modifiers
  18091. ) {
  18092. (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
  18093. }
  18094. function addHandler (
  18095. el,
  18096. name,
  18097. value,
  18098. modifiers,
  18099. important
  18100. ) {
  18101. // check capture modifier
  18102. if (modifiers && modifiers.capture) {
  18103. delete modifiers.capture;
  18104. name = '!' + name; // mark the event as captured
  18105. }
  18106. if (modifiers && modifiers.once) {
  18107. delete modifiers.once;
  18108. name = '~' + name; // mark the event as once
  18109. }
  18110. var events;
  18111. if (modifiers && modifiers.native) {
  18112. delete modifiers.native;
  18113. events = el.nativeEvents || (el.nativeEvents = {});
  18114. } else {
  18115. events = el.events || (el.events = {});
  18116. }
  18117. var newHandler = { value: value, modifiers: modifiers };
  18118. var handlers = events[name];
  18119. /* istanbul ignore if */
  18120. if (Array.isArray(handlers)) {
  18121. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  18122. } else if (handlers) {
  18123. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  18124. } else {
  18125. events[name] = newHandler;
  18126. }
  18127. }
  18128. function getBindingAttr (
  18129. el,
  18130. name,
  18131. getStatic
  18132. ) {
  18133. var dynamicValue =
  18134. getAndRemoveAttr(el, ':' + name) ||
  18135. getAndRemoveAttr(el, 'v-bind:' + name);
  18136. if (dynamicValue != null) {
  18137. return parseFilters(dynamicValue)
  18138. } else if (getStatic !== false) {
  18139. var staticValue = getAndRemoveAttr(el, name);
  18140. if (staticValue != null) {
  18141. return JSON.stringify(staticValue)
  18142. }
  18143. }
  18144. }
  18145. function getAndRemoveAttr (el, name) {
  18146. var val;
  18147. if ((val = el.attrsMap[name]) != null) {
  18148. var list = el.attrsList;
  18149. for (var i = 0, l = list.length; i < l; i++) {
  18150. if (list[i].name === name) {
  18151. list.splice(i, 1);
  18152. break
  18153. }
  18154. }
  18155. }
  18156. return val
  18157. }
  18158. var len;
  18159. var str;
  18160. var chr;
  18161. var index$1;
  18162. var expressionPos;
  18163. var expressionEndPos;
  18164. /**
  18165. * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
  18166. *
  18167. * for loop possible cases:
  18168. *
  18169. * - test
  18170. * - test[idx]
  18171. * - test[test1[idx]]
  18172. * - test["a"][idx]
  18173. * - xxx.test[a[a].test1[idx]]
  18174. * - test.xxx.a["asa"][test1[idx]]
  18175. *
  18176. */
  18177. function parseModel (val) {
  18178. str = val;
  18179. len = str.length;
  18180. index$1 = expressionPos = expressionEndPos = 0;
  18181. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  18182. return {
  18183. exp: val,
  18184. idx: null
  18185. }
  18186. }
  18187. while (!eof()) {
  18188. chr = next();
  18189. /* istanbul ignore if */
  18190. if (isStringStart(chr)) {
  18191. parseString(chr);
  18192. } else if (chr === 0x5B) {
  18193. parseBracket(chr);
  18194. }
  18195. }
  18196. return {
  18197. exp: val.substring(0, expressionPos),
  18198. idx: val.substring(expressionPos + 1, expressionEndPos)
  18199. }
  18200. }
  18201. function next () {
  18202. return str.charCodeAt(++index$1)
  18203. }
  18204. function eof () {
  18205. return index$1 >= len
  18206. }
  18207. function isStringStart (chr) {
  18208. return chr === 0x22 || chr === 0x27
  18209. }
  18210. function parseBracket (chr) {
  18211. var inBracket = 1;
  18212. expressionPos = index$1;
  18213. while (!eof()) {
  18214. chr = next();
  18215. if (isStringStart(chr)) {
  18216. parseString(chr);
  18217. continue
  18218. }
  18219. if (chr === 0x5B) { inBracket++; }
  18220. if (chr === 0x5D) { inBracket--; }
  18221. if (inBracket === 0) {
  18222. expressionEndPos = index$1;
  18223. break
  18224. }
  18225. }
  18226. }
  18227. function parseString (chr) {
  18228. var stringQuote = chr;
  18229. while (!eof()) {
  18230. chr = next();
  18231. if (chr === stringQuote) {
  18232. break
  18233. }
  18234. }
  18235. }
  18236. /* */
  18237. var dirRE = /^v-|^@|^:/;
  18238. var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
  18239. var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
  18240. var bindRE = /^:|^v-bind:/;
  18241. var onRE = /^@|^v-on:/;
  18242. var argRE = /:(.*)$/;
  18243. var modifierRE = /\.[^.]+/g;
  18244. var decodeHTMLCached = cached(decode);
  18245. // configurable state
  18246. var warn$1;
  18247. var platformGetTagNamespace;
  18248. var platformMustUseProp;
  18249. var platformIsPreTag;
  18250. var preTransforms;
  18251. var transforms;
  18252. var postTransforms;
  18253. var delimiters;
  18254. /**
  18255. * Convert HTML string to AST.
  18256. */
  18257. function parse (
  18258. template,
  18259. options
  18260. ) {
  18261. warn$1 = options.warn || baseWarn;
  18262. platformGetTagNamespace = options.getTagNamespace || no;
  18263. platformMustUseProp = options.mustUseProp || no;
  18264. platformIsPreTag = options.isPreTag || no;
  18265. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  18266. transforms = pluckModuleFunction(options.modules, 'transformNode');
  18267. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  18268. delimiters = options.delimiters;
  18269. var stack = [];
  18270. var preserveWhitespace = options.preserveWhitespace !== false;
  18271. var root;
  18272. var currentParent;
  18273. var inVPre = false;
  18274. var inPre = false;
  18275. var warned = false;
  18276. parseHTML(template, {
  18277. expectHTML: options.expectHTML,
  18278. isUnaryTag: options.isUnaryTag,
  18279. shouldDecodeNewlines: options.shouldDecodeNewlines,
  18280. start: function start (tag, attrs, unary) {
  18281. // check namespace.
  18282. // inherit parent ns if there is one
  18283. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  18284. // handle IE svg bug
  18285. /* istanbul ignore if */
  18286. if (isIE && ns === 'svg') {
  18287. attrs = guardIESVGBug(attrs);
  18288. }
  18289. var element = {
  18290. type: 1,
  18291. tag: tag,
  18292. attrsList: attrs,
  18293. attrsMap: makeAttrsMap(attrs),
  18294. parent: currentParent,
  18295. children: []
  18296. };
  18297. if (ns) {
  18298. element.ns = ns;
  18299. }
  18300. if (isForbiddenTag(element) && !isServerRendering()) {
  18301. element.forbidden = true;
  18302. process.env.NODE_ENV !== 'production' && warn$1(
  18303. 'Templates should only be responsible for mapping the state to the ' +
  18304. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  18305. "<" + tag + ">" + ', as they will not be parsed.'
  18306. );
  18307. }
  18308. // apply pre-transforms
  18309. for (var i = 0; i < preTransforms.length; i++) {
  18310. preTransforms[i](element, options);
  18311. }
  18312. if (!inVPre) {
  18313. processPre(element);
  18314. if (element.pre) {
  18315. inVPre = true;
  18316. }
  18317. }
  18318. if (platformIsPreTag(element.tag)) {
  18319. inPre = true;
  18320. }
  18321. if (inVPre) {
  18322. processRawAttrs(element);
  18323. } else {
  18324. processFor(element);
  18325. processIf(element);
  18326. processOnce(element);
  18327. processKey(element);
  18328. // determine whether this is a plain element after
  18329. // removing structural attributes
  18330. element.plain = !element.key && !attrs.length;
  18331. processRef(element);
  18332. processSlot(element);
  18333. processComponent(element);
  18334. for (var i$1 = 0; i$1 < transforms.length; i$1++) {
  18335. transforms[i$1](element, options);
  18336. }
  18337. processAttrs(element);
  18338. }
  18339. function checkRootConstraints (el) {
  18340. if (process.env.NODE_ENV !== 'production' && !warned) {
  18341. if (el.tag === 'slot' || el.tag === 'template') {
  18342. warned = true;
  18343. warn$1(
  18344. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  18345. 'contain multiple nodes:\n' + template
  18346. );
  18347. }
  18348. if (el.attrsMap.hasOwnProperty('v-for')) {
  18349. warned = true;
  18350. warn$1(
  18351. 'Cannot use v-for on stateful component root element because ' +
  18352. 'it renders multiple elements:\n' + template
  18353. );
  18354. }
  18355. }
  18356. }
  18357. // tree management
  18358. if (!root) {
  18359. root = element;
  18360. checkRootConstraints(root);
  18361. } else if (!stack.length) {
  18362. // allow root elements with v-if, v-else-if and v-else
  18363. if (root.if && (element.elseif || element.else)) {
  18364. checkRootConstraints(element);
  18365. addIfCondition(root, {
  18366. exp: element.elseif,
  18367. block: element
  18368. });
  18369. } else if (process.env.NODE_ENV !== 'production' && !warned) {
  18370. warned = true;
  18371. warn$1(
  18372. "Component template should contain exactly one root element:" +
  18373. "\n\n" + template + "\n\n" +
  18374. "If you are using v-if on multiple elements, " +
  18375. "use v-else-if to chain them instead."
  18376. );
  18377. }
  18378. }
  18379. if (currentParent && !element.forbidden) {
  18380. if (element.elseif || element.else) {
  18381. processIfConditions(element, currentParent);
  18382. } else if (element.slotScope) { // scoped slot
  18383. currentParent.plain = false;
  18384. var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  18385. } else {
  18386. currentParent.children.push(element);
  18387. element.parent = currentParent;
  18388. }
  18389. }
  18390. if (!unary) {
  18391. currentParent = element;
  18392. stack.push(element);
  18393. }
  18394. // apply post-transforms
  18395. for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
  18396. postTransforms[i$2](element, options);
  18397. }
  18398. },
  18399. end: function end () {
  18400. // remove trailing whitespace
  18401. var element = stack[stack.length - 1];
  18402. var lastNode = element.children[element.children.length - 1];
  18403. if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
  18404. element.children.pop();
  18405. }
  18406. // pop stack
  18407. stack.length -= 1;
  18408. currentParent = stack[stack.length - 1];
  18409. // check pre state
  18410. if (element.pre) {
  18411. inVPre = false;
  18412. }
  18413. if (platformIsPreTag(element.tag)) {
  18414. inPre = false;
  18415. }
  18416. },
  18417. chars: function chars (text) {
  18418. if (!currentParent) {
  18419. if (process.env.NODE_ENV !== 'production' && !warned && text === template) {
  18420. warned = true;
  18421. warn$1(
  18422. 'Component template requires a root element, rather than just text:\n\n' + template
  18423. );
  18424. }
  18425. return
  18426. }
  18427. // IE textarea placeholder bug
  18428. /* istanbul ignore if */
  18429. if (isIE &&
  18430. currentParent.tag === 'textarea' &&
  18431. currentParent.attrsMap.placeholder === text) {
  18432. return
  18433. }
  18434. var children = currentParent.children;
  18435. text = inPre || text.trim()
  18436. ? decodeHTMLCached(text)
  18437. // only preserve whitespace if its not right after a starting tag
  18438. : preserveWhitespace && children.length ? ' ' : '';
  18439. if (text) {
  18440. var expression;
  18441. if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
  18442. children.push({
  18443. type: 2,
  18444. expression: expression,
  18445. text: text
  18446. });
  18447. } else if (text !== ' ' || children[children.length - 1].text !== ' ') {
  18448. currentParent.children.push({
  18449. type: 3,
  18450. text: text
  18451. });
  18452. }
  18453. }
  18454. }
  18455. });
  18456. return root
  18457. }
  18458. function processPre (el) {
  18459. if (getAndRemoveAttr(el, 'v-pre') != null) {
  18460. el.pre = true;
  18461. }
  18462. }
  18463. function processRawAttrs (el) {
  18464. var l = el.attrsList.length;
  18465. if (l) {
  18466. var attrs = el.attrs = new Array(l);
  18467. for (var i = 0; i < l; i++) {
  18468. attrs[i] = {
  18469. name: el.attrsList[i].name,
  18470. value: JSON.stringify(el.attrsList[i].value)
  18471. };
  18472. }
  18473. } else if (!el.pre) {
  18474. // non root node in pre blocks with no attributes
  18475. el.plain = true;
  18476. }
  18477. }
  18478. function processKey (el) {
  18479. var exp = getBindingAttr(el, 'key');
  18480. if (exp) {
  18481. if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
  18482. warn$1("<template> cannot be keyed. Place the key on real elements instead.");
  18483. }
  18484. el.key = exp;
  18485. }
  18486. }
  18487. function processRef (el) {
  18488. var ref = getBindingAttr(el, 'ref');
  18489. if (ref) {
  18490. el.ref = ref;
  18491. el.refInFor = checkInFor(el);
  18492. }
  18493. }
  18494. function processFor (el) {
  18495. var exp;
  18496. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  18497. var inMatch = exp.match(forAliasRE);
  18498. if (!inMatch) {
  18499. process.env.NODE_ENV !== 'production' && warn$1(
  18500. ("Invalid v-for expression: " + exp)
  18501. );
  18502. return
  18503. }
  18504. el.for = inMatch[2].trim();
  18505. var alias = inMatch[1].trim();
  18506. var iteratorMatch = alias.match(forIteratorRE);
  18507. if (iteratorMatch) {
  18508. el.alias = iteratorMatch[1].trim();
  18509. el.iterator1 = iteratorMatch[2].trim();
  18510. if (iteratorMatch[3]) {
  18511. el.iterator2 = iteratorMatch[3].trim();
  18512. }
  18513. } else {
  18514. el.alias = alias;
  18515. }
  18516. }
  18517. }
  18518. function processIf (el) {
  18519. var exp = getAndRemoveAttr(el, 'v-if');
  18520. if (exp) {
  18521. el.if = exp;
  18522. addIfCondition(el, {
  18523. exp: exp,
  18524. block: el
  18525. });
  18526. } else {
  18527. if (getAndRemoveAttr(el, 'v-else') != null) {
  18528. el.else = true;
  18529. }
  18530. var elseif = getAndRemoveAttr(el, 'v-else-if');
  18531. if (elseif) {
  18532. el.elseif = elseif;
  18533. }
  18534. }
  18535. }
  18536. function processIfConditions (el, parent) {
  18537. var prev = findPrevElement(parent.children);
  18538. if (prev && prev.if) {
  18539. addIfCondition(prev, {
  18540. exp: el.elseif,
  18541. block: el
  18542. });
  18543. } else if (process.env.NODE_ENV !== 'production') {
  18544. warn$1(
  18545. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  18546. "used on element <" + (el.tag) + "> without corresponding v-if."
  18547. );
  18548. }
  18549. }
  18550. function findPrevElement (children) {
  18551. var i = children.length;
  18552. while (i--) {
  18553. if (children[i].type === 1) {
  18554. return children[i]
  18555. } else {
  18556. if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
  18557. warn$1(
  18558. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  18559. "will be ignored."
  18560. );
  18561. }
  18562. children.pop();
  18563. }
  18564. }
  18565. }
  18566. function addIfCondition (el, condition) {
  18567. if (!el.ifConditions) {
  18568. el.ifConditions = [];
  18569. }
  18570. el.ifConditions.push(condition);
  18571. }
  18572. function processOnce (el) {
  18573. var once = getAndRemoveAttr(el, 'v-once');
  18574. if (once != null) {
  18575. el.once = true;
  18576. }
  18577. }
  18578. function processSlot (el) {
  18579. if (el.tag === 'slot') {
  18580. el.slotName = getBindingAttr(el, 'name');
  18581. if (process.env.NODE_ENV !== 'production' && el.key) {
  18582. warn$1(
  18583. "`key` does not work on <slot> because slots are abstract outlets " +
  18584. "and can possibly expand into multiple elements. " +
  18585. "Use the key on a wrapping element instead."
  18586. );
  18587. }
  18588. } else {
  18589. var slotTarget = getBindingAttr(el, 'slot');
  18590. if (slotTarget) {
  18591. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  18592. }
  18593. if (el.tag === 'template') {
  18594. el.slotScope = getAndRemoveAttr(el, 'scope');
  18595. }
  18596. }
  18597. }
  18598. function processComponent (el) {
  18599. var binding;
  18600. if ((binding = getBindingAttr(el, 'is'))) {
  18601. el.component = binding;
  18602. }
  18603. if (getAndRemoveAttr(el, 'inline-template') != null) {
  18604. el.inlineTemplate = true;
  18605. }
  18606. }
  18607. function processAttrs (el) {
  18608. var list = el.attrsList;
  18609. var i, l, name, rawName, value, arg, modifiers, isProp;
  18610. for (i = 0, l = list.length; i < l; i++) {
  18611. name = rawName = list[i].name;
  18612. value = list[i].value;
  18613. if (dirRE.test(name)) {
  18614. // mark element as dynamic
  18615. el.hasBindings = true;
  18616. // modifiers
  18617. modifiers = parseModifiers(name);
  18618. if (modifiers) {
  18619. name = name.replace(modifierRE, '');
  18620. }
  18621. if (bindRE.test(name)) { // v-bind
  18622. name = name.replace(bindRE, '');
  18623. value = parseFilters(value);
  18624. isProp = false;
  18625. if (modifiers) {
  18626. if (modifiers.prop) {
  18627. isProp = true;
  18628. name = camelize(name);
  18629. if (name === 'innerHtml') { name = 'innerHTML'; }
  18630. }
  18631. if (modifiers.camel) {
  18632. name = camelize(name);
  18633. }
  18634. }
  18635. if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  18636. addProp(el, name, value);
  18637. } else {
  18638. addAttr(el, name, value);
  18639. }
  18640. } else if (onRE.test(name)) { // v-on
  18641. name = name.replace(onRE, '');
  18642. addHandler(el, name, value, modifiers);
  18643. } else { // normal directives
  18644. name = name.replace(dirRE, '');
  18645. // parse arg
  18646. var argMatch = name.match(argRE);
  18647. if (argMatch && (arg = argMatch[1])) {
  18648. name = name.slice(0, -(arg.length + 1));
  18649. }
  18650. addDirective(el, name, rawName, value, arg, modifiers);
  18651. if (process.env.NODE_ENV !== 'production' && name === 'model') {
  18652. checkForAliasModel(el, value);
  18653. }
  18654. }
  18655. } else {
  18656. // literal attribute
  18657. if (process.env.NODE_ENV !== 'production') {
  18658. var expression = parseText(value, delimiters);
  18659. if (expression) {
  18660. warn$1(
  18661. name + "=\"" + value + "\": " +
  18662. 'Interpolation inside attributes has been removed. ' +
  18663. 'Use v-bind or the colon shorthand instead. For example, ' +
  18664. 'instead of <div id="{{ val }}">, use <div :id="val">.'
  18665. );
  18666. }
  18667. }
  18668. addAttr(el, name, JSON.stringify(value));
  18669. }
  18670. }
  18671. }
  18672. function checkInFor (el) {
  18673. var parent = el;
  18674. while (parent) {
  18675. if (parent.for !== undefined) {
  18676. return true
  18677. }
  18678. parent = parent.parent;
  18679. }
  18680. return false
  18681. }
  18682. function parseModifiers (name) {
  18683. var match = name.match(modifierRE);
  18684. if (match) {
  18685. var ret = {};
  18686. match.forEach(function (m) { ret[m.slice(1)] = true; });
  18687. return ret
  18688. }
  18689. }
  18690. function makeAttrsMap (attrs) {
  18691. var map = {};
  18692. for (var i = 0, l = attrs.length; i < l; i++) {
  18693. if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE) {
  18694. warn$1('duplicate attribute: ' + attrs[i].name);
  18695. }
  18696. map[attrs[i].name] = attrs[i].value;
  18697. }
  18698. return map
  18699. }
  18700. function isForbiddenTag (el) {
  18701. return (
  18702. el.tag === 'style' ||
  18703. (el.tag === 'script' && (
  18704. !el.attrsMap.type ||
  18705. el.attrsMap.type === 'text/javascript'
  18706. ))
  18707. )
  18708. }
  18709. var ieNSBug = /^xmlns:NS\d+/;
  18710. var ieNSPrefix = /^NS\d+:/;
  18711. /* istanbul ignore next */
  18712. function guardIESVGBug (attrs) {
  18713. var res = [];
  18714. for (var i = 0; i < attrs.length; i++) {
  18715. var attr = attrs[i];
  18716. if (!ieNSBug.test(attr.name)) {
  18717. attr.name = attr.name.replace(ieNSPrefix, '');
  18718. res.push(attr);
  18719. }
  18720. }
  18721. return res
  18722. }
  18723. function checkForAliasModel (el, value) {
  18724. var _el = el;
  18725. while (_el) {
  18726. if (_el.for && _el.alias === value) {
  18727. warn$1(
  18728. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  18729. "You are binding v-model directly to a v-for iteration alias. " +
  18730. "This will not be able to modify the v-for source array because " +
  18731. "writing to the alias is like modifying a function local variable. " +
  18732. "Consider using an array of objects and use v-model on an object property instead."
  18733. );
  18734. }
  18735. _el = _el.parent;
  18736. }
  18737. }
  18738. /* */
  18739. var isStaticKey;
  18740. var isPlatformReservedTag;
  18741. var genStaticKeysCached = cached(genStaticKeys$1);
  18742. /**
  18743. * Goal of the optimizer: walk the generated template AST tree
  18744. * and detect sub-trees that are purely static, i.e. parts of
  18745. * the DOM that never needs to change.
  18746. *
  18747. * Once we detect these sub-trees, we can:
  18748. *
  18749. * 1. Hoist them into constants, so that we no longer need to
  18750. * create fresh nodes for them on each re-render;
  18751. * 2. Completely skip them in the patching process.
  18752. */
  18753. function optimize (root, options) {
  18754. if (!root) { return }
  18755. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  18756. isPlatformReservedTag = options.isReservedTag || no;
  18757. // first pass: mark all non-static nodes.
  18758. markStatic(root);
  18759. // second pass: mark static roots.
  18760. markStaticRoots(root, false);
  18761. }
  18762. function genStaticKeys$1 (keys) {
  18763. return makeMap(
  18764. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
  18765. (keys ? ',' + keys : '')
  18766. )
  18767. }
  18768. function markStatic (node) {
  18769. node.static = isStatic(node);
  18770. if (node.type === 1) {
  18771. // do not make component slot content static. this avoids
  18772. // 1. components not able to mutate slot nodes
  18773. // 2. static slot content fails for hot-reloading
  18774. if (
  18775. !isPlatformReservedTag(node.tag) &&
  18776. node.tag !== 'slot' &&
  18777. node.attrsMap['inline-template'] == null
  18778. ) {
  18779. return
  18780. }
  18781. for (var i = 0, l = node.children.length; i < l; i++) {
  18782. var child = node.children[i];
  18783. markStatic(child);
  18784. if (!child.static) {
  18785. node.static = false;
  18786. }
  18787. }
  18788. }
  18789. }
  18790. function markStaticRoots (node, isInFor) {
  18791. if (node.type === 1) {
  18792. if (node.static || node.once) {
  18793. node.staticInFor = isInFor;
  18794. }
  18795. // For a node to qualify as a static root, it should have children that
  18796. // are not just static text. Otherwise the cost of hoisting out will
  18797. // outweigh the benefits and it's better off to just always render it fresh.
  18798. if (node.static && node.children.length && !(
  18799. node.children.length === 1 &&
  18800. node.children[0].type === 3
  18801. )) {
  18802. node.staticRoot = true;
  18803. return
  18804. } else {
  18805. node.staticRoot = false;
  18806. }
  18807. if (node.children) {
  18808. for (var i = 0, l = node.children.length; i < l; i++) {
  18809. markStaticRoots(node.children[i], isInFor || !!node.for);
  18810. }
  18811. }
  18812. if (node.ifConditions) {
  18813. walkThroughConditionsBlocks(node.ifConditions, isInFor);
  18814. }
  18815. }
  18816. }
  18817. function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
  18818. for (var i = 1, len = conditionBlocks.length; i < len; i++) {
  18819. markStaticRoots(conditionBlocks[i].block, isInFor);
  18820. }
  18821. }
  18822. function isStatic (node) {
  18823. if (node.type === 2) { // expression
  18824. return false
  18825. }
  18826. if (node.type === 3) { // text
  18827. return true
  18828. }
  18829. return !!(node.pre || (
  18830. !node.hasBindings && // no dynamic bindings
  18831. !node.if && !node.for && // not v-if or v-for or v-else
  18832. !isBuiltInTag(node.tag) && // not a built-in
  18833. isPlatformReservedTag(node.tag) && // not a component
  18834. !isDirectChildOfTemplateFor(node) &&
  18835. Object.keys(node).every(isStaticKey)
  18836. ))
  18837. }
  18838. function isDirectChildOfTemplateFor (node) {
  18839. while (node.parent) {
  18840. node = node.parent;
  18841. if (node.tag !== 'template') {
  18842. return false
  18843. }
  18844. if (node.for) {
  18845. return true
  18846. }
  18847. }
  18848. return false
  18849. }
  18850. /* */
  18851. var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
  18852. var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
  18853. // keyCode aliases
  18854. var keyCodes = {
  18855. esc: 27,
  18856. tab: 9,
  18857. enter: 13,
  18858. space: 32,
  18859. up: 38,
  18860. left: 37,
  18861. right: 39,
  18862. down: 40,
  18863. 'delete': [8, 46]
  18864. };
  18865. var modifierCode = {
  18866. stop: '$event.stopPropagation();',
  18867. prevent: '$event.preventDefault();',
  18868. self: 'if($event.target !== $event.currentTarget)return;',
  18869. ctrl: 'if(!$event.ctrlKey)return;',
  18870. shift: 'if(!$event.shiftKey)return;',
  18871. alt: 'if(!$event.altKey)return;',
  18872. meta: 'if(!$event.metaKey)return;'
  18873. };
  18874. function genHandlers (events, native) {
  18875. var res = native ? 'nativeOn:{' : 'on:{';
  18876. for (var name in events) {
  18877. res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
  18878. }
  18879. return res.slice(0, -1) + '}'
  18880. }
  18881. function genHandler (
  18882. name,
  18883. handler
  18884. ) {
  18885. if (!handler) {
  18886. return 'function(){}'
  18887. } else if (Array.isArray(handler)) {
  18888. return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
  18889. } else if (!handler.modifiers) {
  18890. return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)
  18891. ? handler.value
  18892. : ("function($event){" + (handler.value) + "}")
  18893. } else {
  18894. var code = '';
  18895. var keys = [];
  18896. for (var key in handler.modifiers) {
  18897. if (modifierCode[key]) {
  18898. code += modifierCode[key];
  18899. } else {
  18900. keys.push(key);
  18901. }
  18902. }
  18903. if (keys.length) {
  18904. code = genKeyFilter(keys) + code;
  18905. }
  18906. var handlerCode = simplePathRE.test(handler.value)
  18907. ? handler.value + '($event)'
  18908. : handler.value;
  18909. return 'function($event){' + code + handlerCode + '}'
  18910. }
  18911. }
  18912. function genKeyFilter (keys) {
  18913. return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return;")
  18914. }
  18915. function genFilterCode (key) {
  18916. var keyVal = parseInt(key, 10);
  18917. if (keyVal) {
  18918. return ("$event.keyCode!==" + keyVal)
  18919. }
  18920. var alias = keyCodes[key];
  18921. return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
  18922. }
  18923. /* */
  18924. function bind$2 (el, dir) {
  18925. el.wrapData = function (code) {
  18926. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
  18927. };
  18928. }
  18929. /* */
  18930. var baseDirectives = {
  18931. bind: bind$2,
  18932. cloak: noop
  18933. };
  18934. /* */
  18935. // configurable state
  18936. var warn$2;
  18937. var transforms$1;
  18938. var dataGenFns;
  18939. var platformDirectives$1;
  18940. var isPlatformReservedTag$1;
  18941. var staticRenderFns;
  18942. var onceCount;
  18943. var currentOptions;
  18944. function generate (
  18945. ast,
  18946. options
  18947. ) {
  18948. // save previous staticRenderFns so generate calls can be nested
  18949. var prevStaticRenderFns = staticRenderFns;
  18950. var currentStaticRenderFns = staticRenderFns = [];
  18951. var prevOnceCount = onceCount;
  18952. onceCount = 0;
  18953. currentOptions = options;
  18954. warn$2 = options.warn || baseWarn;
  18955. transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
  18956. dataGenFns = pluckModuleFunction(options.modules, 'genData');
  18957. platformDirectives$1 = options.directives || {};
  18958. isPlatformReservedTag$1 = options.isReservedTag || no;
  18959. var code = ast ? genElement(ast) : '_c("div")';
  18960. staticRenderFns = prevStaticRenderFns;
  18961. onceCount = prevOnceCount;
  18962. return {
  18963. render: ("with(this){return " + code + "}"),
  18964. staticRenderFns: currentStaticRenderFns
  18965. }
  18966. }
  18967. function genElement (el) {
  18968. if (el.staticRoot && !el.staticProcessed) {
  18969. return genStatic(el)
  18970. } else if (el.once && !el.onceProcessed) {
  18971. return genOnce(el)
  18972. } else if (el.for && !el.forProcessed) {
  18973. return genFor(el)
  18974. } else if (el.if && !el.ifProcessed) {
  18975. return genIf(el)
  18976. } else if (el.tag === 'template' && !el.slotTarget) {
  18977. return genChildren(el) || 'void 0'
  18978. } else if (el.tag === 'slot') {
  18979. return genSlot(el)
  18980. } else {
  18981. // component or element
  18982. var code;
  18983. if (el.component) {
  18984. code = genComponent(el.component, el);
  18985. } else {
  18986. var data = el.plain ? undefined : genData(el);
  18987. var children = el.inlineTemplate ? null : genChildren(el, true);
  18988. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  18989. }
  18990. // module transforms
  18991. for (var i = 0; i < transforms$1.length; i++) {
  18992. code = transforms$1[i](el, code);
  18993. }
  18994. return code
  18995. }
  18996. }
  18997. // hoist static sub-trees out
  18998. function genStatic (el) {
  18999. el.staticProcessed = true;
  19000. staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
  19001. return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  19002. }
  19003. // v-once
  19004. function genOnce (el) {
  19005. el.onceProcessed = true;
  19006. if (el.if && !el.ifProcessed) {
  19007. return genIf(el)
  19008. } else if (el.staticInFor) {
  19009. var key = '';
  19010. var parent = el.parent;
  19011. while (parent) {
  19012. if (parent.for) {
  19013. key = parent.key;
  19014. break
  19015. }
  19016. parent = parent.parent;
  19017. }
  19018. if (!key) {
  19019. process.env.NODE_ENV !== 'production' && warn$2(
  19020. "v-once can only be used inside v-for that is keyed. "
  19021. );
  19022. return genElement(el)
  19023. }
  19024. return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
  19025. } else {
  19026. return genStatic(el)
  19027. }
  19028. }
  19029. function genIf (el) {
  19030. el.ifProcessed = true; // avoid recursion
  19031. return genIfConditions(el.ifConditions.slice())
  19032. }
  19033. function genIfConditions (conditions) {
  19034. if (!conditions.length) {
  19035. return '_e()'
  19036. }
  19037. var condition = conditions.shift();
  19038. if (condition.exp) {
  19039. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
  19040. } else {
  19041. return ("" + (genTernaryExp(condition.block)))
  19042. }
  19043. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  19044. function genTernaryExp (el) {
  19045. return el.once ? genOnce(el) : genElement(el)
  19046. }
  19047. }
  19048. function genFor (el) {
  19049. var exp = el.for;
  19050. var alias = el.alias;
  19051. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  19052. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  19053. el.forProcessed = true; // avoid recursion
  19054. return "_l((" + exp + ")," +
  19055. "function(" + alias + iterator1 + iterator2 + "){" +
  19056. "return " + (genElement(el)) +
  19057. '})'
  19058. }
  19059. function genData (el) {
  19060. var data = '{';
  19061. // directives first.
  19062. // directives may mutate the el's other properties before they are generated.
  19063. var dirs = genDirectives(el);
  19064. if (dirs) { data += dirs + ','; }
  19065. // key
  19066. if (el.key) {
  19067. data += "key:" + (el.key) + ",";
  19068. }
  19069. // ref
  19070. if (el.ref) {
  19071. data += "ref:" + (el.ref) + ",";
  19072. }
  19073. if (el.refInFor) {
  19074. data += "refInFor:true,";
  19075. }
  19076. // pre
  19077. if (el.pre) {
  19078. data += "pre:true,";
  19079. }
  19080. // record original tag name for components using "is" attribute
  19081. if (el.component) {
  19082. data += "tag:\"" + (el.tag) + "\",";
  19083. }
  19084. // module data generation functions
  19085. for (var i = 0; i < dataGenFns.length; i++) {
  19086. data += dataGenFns[i](el);
  19087. }
  19088. // attributes
  19089. if (el.attrs) {
  19090. data += "attrs:{" + (genProps(el.attrs)) + "},";
  19091. }
  19092. // DOM props
  19093. if (el.props) {
  19094. data += "domProps:{" + (genProps(el.props)) + "},";
  19095. }
  19096. // event handlers
  19097. if (el.events) {
  19098. data += (genHandlers(el.events)) + ",";
  19099. }
  19100. if (el.nativeEvents) {
  19101. data += (genHandlers(el.nativeEvents, true)) + ",";
  19102. }
  19103. // slot target
  19104. if (el.slotTarget) {
  19105. data += "slot:" + (el.slotTarget) + ",";
  19106. }
  19107. // scoped slots
  19108. if (el.scopedSlots) {
  19109. data += (genScopedSlots(el.scopedSlots)) + ",";
  19110. }
  19111. // inline-template
  19112. if (el.inlineTemplate) {
  19113. var inlineTemplate = genInlineTemplate(el);
  19114. if (inlineTemplate) {
  19115. data += inlineTemplate + ",";
  19116. }
  19117. }
  19118. data = data.replace(/,$/, '') + '}';
  19119. // v-bind data wrap
  19120. if (el.wrapData) {
  19121. data = el.wrapData(data);
  19122. }
  19123. return data
  19124. }
  19125. function genDirectives (el) {
  19126. var dirs = el.directives;
  19127. if (!dirs) { return }
  19128. var res = 'directives:[';
  19129. var hasRuntime = false;
  19130. var i, l, dir, needRuntime;
  19131. for (i = 0, l = dirs.length; i < l; i++) {
  19132. dir = dirs[i];
  19133. needRuntime = true;
  19134. var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
  19135. if (gen) {
  19136. // compile-time directive that manipulates AST.
  19137. // returns true if it also needs a runtime counterpart.
  19138. needRuntime = !!gen(el, dir, warn$2);
  19139. }
  19140. if (needRuntime) {
  19141. hasRuntime = true;
  19142. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  19143. }
  19144. }
  19145. if (hasRuntime) {
  19146. return res.slice(0, -1) + ']'
  19147. }
  19148. }
  19149. function genInlineTemplate (el) {
  19150. var ast = el.children[0];
  19151. if (process.env.NODE_ENV !== 'production' && (
  19152. el.children.length > 1 || ast.type !== 1
  19153. )) {
  19154. warn$2('Inline-template components must have exactly one child element.');
  19155. }
  19156. if (ast.type === 1) {
  19157. var inlineRenderFns = generate(ast, currentOptions);
  19158. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  19159. }
  19160. }
  19161. function genScopedSlots (slots) {
  19162. return ("scopedSlots:{" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "}")
  19163. }
  19164. function genScopedSlot (key, el) {
  19165. return key + ":function(" + (String(el.attrsMap.scope)) + "){" +
  19166. "return " + (el.tag === 'template'
  19167. ? genChildren(el) || 'void 0'
  19168. : genElement(el)) + "}"
  19169. }
  19170. function genChildren (el, checkSkip) {
  19171. var children = el.children;
  19172. if (children.length) {
  19173. var el$1 = children[0];
  19174. // optimize single v-for
  19175. if (children.length === 1 &&
  19176. el$1.for &&
  19177. el$1.tag !== 'template' &&
  19178. el$1.tag !== 'slot') {
  19179. return genElement(el$1)
  19180. }
  19181. var normalizationType = getNormalizationType(children);
  19182. return ("[" + (children.map(genNode).join(',')) + "]" + (checkSkip
  19183. ? normalizationType ? ("," + normalizationType) : ''
  19184. : ''))
  19185. }
  19186. }
  19187. // determine the normalization needed for the children array.
  19188. // 0: no normalization needed
  19189. // 1: simple normalization needed (possible 1-level deep nested array)
  19190. // 2: full normalization needed
  19191. function getNormalizationType (children) {
  19192. var res = 0;
  19193. for (var i = 0; i < children.length; i++) {
  19194. var el = children[i];
  19195. if (el.type !== 1) {
  19196. continue
  19197. }
  19198. if (needsNormalization(el) ||
  19199. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  19200. res = 2;
  19201. break
  19202. }
  19203. if (maybeComponent(el) ||
  19204. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  19205. res = 1;
  19206. }
  19207. }
  19208. return res
  19209. }
  19210. function needsNormalization (el) {
  19211. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  19212. }
  19213. function maybeComponent (el) {
  19214. return !isPlatformReservedTag$1(el.tag)
  19215. }
  19216. function genNode (node) {
  19217. if (node.type === 1) {
  19218. return genElement(node)
  19219. } else {
  19220. return genText(node)
  19221. }
  19222. }
  19223. function genText (text) {
  19224. return ("_v(" + (text.type === 2
  19225. ? text.expression // no need for () because already wrapped in _s()
  19226. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  19227. }
  19228. function genSlot (el) {
  19229. var slotName = el.slotName || '"default"';
  19230. var children = genChildren(el);
  19231. var res = "_t(" + slotName + (children ? ("," + children) : '');
  19232. var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
  19233. var bind$$1 = el.attrsMap['v-bind'];
  19234. if ((attrs || bind$$1) && !children) {
  19235. res += ",null";
  19236. }
  19237. if (attrs) {
  19238. res += "," + attrs;
  19239. }
  19240. if (bind$$1) {
  19241. res += (attrs ? '' : ',null') + "," + bind$$1;
  19242. }
  19243. return res + ')'
  19244. }
  19245. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  19246. function genComponent (componentName, el) {
  19247. var children = el.inlineTemplate ? null : genChildren(el, true);
  19248. return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
  19249. }
  19250. function genProps (props) {
  19251. var res = '';
  19252. for (var i = 0; i < props.length; i++) {
  19253. var prop = props[i];
  19254. res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
  19255. }
  19256. return res.slice(0, -1)
  19257. }
  19258. // #3895, #4268
  19259. function transformSpecialNewlines (text) {
  19260. return text
  19261. .replace(/\u2028/g, '\\u2028')
  19262. .replace(/\u2029/g, '\\u2029')
  19263. }
  19264. /* */
  19265. /**
  19266. * Compile a template.
  19267. */
  19268. function compile$1 (
  19269. template,
  19270. options
  19271. ) {
  19272. var ast = parse(template.trim(), options);
  19273. optimize(ast, options);
  19274. var code = generate(ast, options);
  19275. return {
  19276. ast: ast,
  19277. render: code.render,
  19278. staticRenderFns: code.staticRenderFns
  19279. }
  19280. }
  19281. /* */
  19282. // operators like typeof, instanceof and in are allowed
  19283. var prohibitedKeywordRE = new RegExp('\\b' + (
  19284. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  19285. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  19286. 'extends,finally,continue,debugger,function,arguments'
  19287. ).split(',').join('\\b|\\b') + '\\b');
  19288. // check valid identifier for v-for
  19289. var identRE = /[A-Za-z_$][\w$]*/;
  19290. // strip strings in expressions
  19291. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  19292. // detect problematic expressions in a template
  19293. function detectErrors (ast) {
  19294. var errors = [];
  19295. if (ast) {
  19296. checkNode(ast, errors);
  19297. }
  19298. return errors
  19299. }
  19300. function checkNode (node, errors) {
  19301. if (node.type === 1) {
  19302. for (var name in node.attrsMap) {
  19303. if (dirRE.test(name)) {
  19304. var value = node.attrsMap[name];
  19305. if (value) {
  19306. if (name === 'v-for') {
  19307. checkFor(node, ("v-for=\"" + value + "\""), errors);
  19308. } else {
  19309. checkExpression(value, (name + "=\"" + value + "\""), errors);
  19310. }
  19311. }
  19312. }
  19313. }
  19314. if (node.children) {
  19315. for (var i = 0; i < node.children.length; i++) {
  19316. checkNode(node.children[i], errors);
  19317. }
  19318. }
  19319. } else if (node.type === 2) {
  19320. checkExpression(node.expression, node.text, errors);
  19321. }
  19322. }
  19323. function checkFor (node, text, errors) {
  19324. checkExpression(node.for || '', text, errors);
  19325. checkIdentifier(node.alias, 'v-for alias', text, errors);
  19326. checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
  19327. checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
  19328. }
  19329. function checkIdentifier (ident, type, text, errors) {
  19330. if (typeof ident === 'string' && !identRE.test(ident)) {
  19331. errors.push(("- invalid " + type + " \"" + ident + "\" in expression: " + text));
  19332. }
  19333. }
  19334. function checkExpression (exp, text, errors) {
  19335. try {
  19336. new Function(("return " + exp));
  19337. } catch (e) {
  19338. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  19339. if (keywordMatch) {
  19340. errors.push(
  19341. "- avoid using JavaScript keyword as property name: " +
  19342. "\"" + (keywordMatch[0]) + "\" in expression " + text
  19343. );
  19344. } else {
  19345. errors.push(("- invalid expression: " + text));
  19346. }
  19347. }
  19348. }
  19349. /* */
  19350. function transformNode (el, options) {
  19351. var warn = options.warn || baseWarn;
  19352. var staticClass = getAndRemoveAttr(el, 'class');
  19353. if (process.env.NODE_ENV !== 'production' && staticClass) {
  19354. var expression = parseText(staticClass, options.delimiters);
  19355. if (expression) {
  19356. warn(
  19357. "class=\"" + staticClass + "\": " +
  19358. 'Interpolation inside attributes has been removed. ' +
  19359. 'Use v-bind or the colon shorthand instead. For example, ' +
  19360. 'instead of <div class="{{ val }}">, use <div :class="val">.'
  19361. );
  19362. }
  19363. }
  19364. if (staticClass) {
  19365. el.staticClass = JSON.stringify(staticClass);
  19366. }
  19367. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  19368. if (classBinding) {
  19369. el.classBinding = classBinding;
  19370. }
  19371. }
  19372. function genData$1 (el) {
  19373. var data = '';
  19374. if (el.staticClass) {
  19375. data += "staticClass:" + (el.staticClass) + ",";
  19376. }
  19377. if (el.classBinding) {
  19378. data += "class:" + (el.classBinding) + ",";
  19379. }
  19380. return data
  19381. }
  19382. var klass$1 = {
  19383. staticKeys: ['staticClass'],
  19384. transformNode: transformNode,
  19385. genData: genData$1
  19386. };
  19387. /* */
  19388. function transformNode$1 (el, options) {
  19389. var warn = options.warn || baseWarn;
  19390. var staticStyle = getAndRemoveAttr(el, 'style');
  19391. if (staticStyle) {
  19392. /* istanbul ignore if */
  19393. if (process.env.NODE_ENV !== 'production') {
  19394. var expression = parseText(staticStyle, options.delimiters);
  19395. if (expression) {
  19396. warn(
  19397. "style=\"" + staticStyle + "\": " +
  19398. 'Interpolation inside attributes has been removed. ' +
  19399. 'Use v-bind or the colon shorthand instead. For example, ' +
  19400. 'instead of <div style="{{ val }}">, use <div :style="val">.'
  19401. );
  19402. }
  19403. }
  19404. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  19405. }
  19406. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  19407. if (styleBinding) {
  19408. el.styleBinding = styleBinding;
  19409. }
  19410. }
  19411. function genData$2 (el) {
  19412. var data = '';
  19413. if (el.staticStyle) {
  19414. data += "staticStyle:" + (el.staticStyle) + ",";
  19415. }
  19416. if (el.styleBinding) {
  19417. data += "style:(" + (el.styleBinding) + "),";
  19418. }
  19419. return data
  19420. }
  19421. var style$1 = {
  19422. staticKeys: ['staticStyle'],
  19423. transformNode: transformNode$1,
  19424. genData: genData$2
  19425. };
  19426. var modules$1 = [
  19427. klass$1,
  19428. style$1
  19429. ];
  19430. /* */
  19431. var warn$3;
  19432. function model$1 (
  19433. el,
  19434. dir,
  19435. _warn
  19436. ) {
  19437. warn$3 = _warn;
  19438. var value = dir.value;
  19439. var modifiers = dir.modifiers;
  19440. var tag = el.tag;
  19441. var type = el.attrsMap.type;
  19442. if (process.env.NODE_ENV !== 'production') {
  19443. var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  19444. if (tag === 'input' && dynamicType) {
  19445. warn$3(
  19446. "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
  19447. "v-model does not support dynamic input types. Use v-if branches instead."
  19448. );
  19449. }
  19450. }
  19451. if (tag === 'select') {
  19452. genSelect(el, value, modifiers);
  19453. } else if (tag === 'input' && type === 'checkbox') {
  19454. genCheckboxModel(el, value, modifiers);
  19455. } else if (tag === 'input' && type === 'radio') {
  19456. genRadioModel(el, value, modifiers);
  19457. } else {
  19458. genDefaultModel(el, value, modifiers);
  19459. }
  19460. // ensure runtime directive metadata
  19461. return true
  19462. }
  19463. function genCheckboxModel (
  19464. el,
  19465. value,
  19466. modifiers
  19467. ) {
  19468. if (process.env.NODE_ENV !== 'production' &&
  19469. el.attrsMap.checked != null) {
  19470. warn$3(
  19471. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  19472. "inline checked attributes will be ignored when using v-model. " +
  19473. 'Declare initial values in the component\'s data option instead.'
  19474. );
  19475. }
  19476. var number = modifiers && modifiers.number;
  19477. var valueBinding = getBindingAttr(el, 'value') || 'null';
  19478. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  19479. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  19480. addProp(el, 'checked',
  19481. "Array.isArray(" + value + ")" +
  19482. "?_i(" + value + "," + valueBinding + ")>-1" + (
  19483. trueValueBinding === 'true'
  19484. ? (":(" + value + ")")
  19485. : (":_q(" + value + "," + trueValueBinding + ")")
  19486. )
  19487. );
  19488. addHandler(el, 'click',
  19489. "var $$a=" + value + "," +
  19490. '$$el=$event.target,' +
  19491. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  19492. 'if(Array.isArray($$a)){' +
  19493. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  19494. '$$i=_i($$a,$$v);' +
  19495. "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
  19496. "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
  19497. "}else{" + value + "=$$c}",
  19498. null, true
  19499. );
  19500. }
  19501. function genRadioModel (
  19502. el,
  19503. value,
  19504. modifiers
  19505. ) {
  19506. if (process.env.NODE_ENV !== 'production' &&
  19507. el.attrsMap.checked != null) {
  19508. warn$3(
  19509. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  19510. "inline checked attributes will be ignored when using v-model. " +
  19511. 'Declare initial values in the component\'s data option instead.'
  19512. );
  19513. }
  19514. var number = modifiers && modifiers.number;
  19515. var valueBinding = getBindingAttr(el, 'value') || 'null';
  19516. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  19517. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  19518. addHandler(el, 'click', genAssignmentCode(value, valueBinding), null, true);
  19519. }
  19520. function genDefaultModel (
  19521. el,
  19522. value,
  19523. modifiers
  19524. ) {
  19525. if (process.env.NODE_ENV !== 'production') {
  19526. if (el.tag === 'input' && el.attrsMap.value) {
  19527. warn$3(
  19528. "<" + (el.tag) + " v-model=\"" + value + "\" value=\"" + (el.attrsMap.value) + "\">:\n" +
  19529. 'inline value attributes will be ignored when using v-model. ' +
  19530. 'Declare initial values in the component\'s data option instead.'
  19531. );
  19532. }
  19533. if (el.tag === 'textarea' && el.children.length) {
  19534. warn$3(
  19535. "<textarea v-model=\"" + value + "\">:\n" +
  19536. 'inline content inside <textarea> will be ignored when using v-model. ' +
  19537. 'Declare initial values in the component\'s data option instead.'
  19538. );
  19539. }
  19540. }
  19541. var type = el.attrsMap.type;
  19542. var ref = modifiers || {};
  19543. var lazy = ref.lazy;
  19544. var number = ref.number;
  19545. var trim = ref.trim;
  19546. var event = lazy || (isIE && type === 'range') ? 'change' : 'input';
  19547. var needCompositionGuard = !lazy && type !== 'range';
  19548. var isNative = el.tag === 'input' || el.tag === 'textarea';
  19549. var valueExpression = isNative
  19550. ? ("$event.target.value" + (trim ? '.trim()' : ''))
  19551. : trim ? "(typeof $event === 'string' ? $event.trim() : $event)" : "$event";
  19552. valueExpression = number || type === 'number'
  19553. ? ("_n(" + valueExpression + ")")
  19554. : valueExpression;
  19555. var code = genAssignmentCode(value, valueExpression);
  19556. if (isNative && needCompositionGuard) {
  19557. code = "if($event.target.composing)return;" + code;
  19558. }
  19559. // inputs with type="file" are read only and setting the input's
  19560. // value will throw an error.
  19561. if (process.env.NODE_ENV !== 'production' &&
  19562. type === 'file') {
  19563. warn$3(
  19564. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  19565. "File inputs are read only. Use a v-on:change listener instead."
  19566. );
  19567. }
  19568. addProp(el, 'value', isNative ? ("_s(" + value + ")") : ("(" + value + ")"));
  19569. addHandler(el, event, code, null, true);
  19570. if (trim || number || type === 'number') {
  19571. addHandler(el, 'blur', '$forceUpdate()');
  19572. }
  19573. }
  19574. function genSelect (
  19575. el,
  19576. value,
  19577. modifiers
  19578. ) {
  19579. if (process.env.NODE_ENV !== 'production') {
  19580. el.children.some(checkOptionWarning);
  19581. }
  19582. var number = modifiers && modifiers.number;
  19583. var assignment = "Array.prototype.filter" +
  19584. ".call($event.target.options,function(o){return o.selected})" +
  19585. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  19586. "return " + (number ? '_n(val)' : 'val') + "})" +
  19587. (el.attrsMap.multiple == null ? '[0]' : '');
  19588. var code = genAssignmentCode(value, assignment);
  19589. addHandler(el, 'change', code, null, true);
  19590. }
  19591. function checkOptionWarning (option) {
  19592. if (option.type === 1 &&
  19593. option.tag === 'option' &&
  19594. option.attrsMap.selected != null) {
  19595. warn$3(
  19596. "<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
  19597. 'inline selected attributes on <option> will be ignored when using v-model. ' +
  19598. 'Declare initial values in the component\'s data option instead.'
  19599. );
  19600. return true
  19601. }
  19602. return false
  19603. }
  19604. function genAssignmentCode (value, assignment) {
  19605. var modelRs = parseModel(value);
  19606. if (modelRs.idx === null) {
  19607. return (value + "=" + assignment)
  19608. } else {
  19609. return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
  19610. "if (!Array.isArray($$exp)){" +
  19611. value + "=" + assignment + "}" +
  19612. "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  19613. }
  19614. }
  19615. /* */
  19616. function text (el, dir) {
  19617. if (dir.value) {
  19618. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
  19619. }
  19620. }
  19621. /* */
  19622. function html (el, dir) {
  19623. if (dir.value) {
  19624. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
  19625. }
  19626. }
  19627. var directives$1 = {
  19628. model: model$1,
  19629. text: text,
  19630. html: html
  19631. };
  19632. /* */
  19633. var cache = Object.create(null);
  19634. var baseOptions = {
  19635. expectHTML: true,
  19636. modules: modules$1,
  19637. staticKeys: genStaticKeys(modules$1),
  19638. directives: directives$1,
  19639. isReservedTag: isReservedTag,
  19640. isUnaryTag: isUnaryTag,
  19641. mustUseProp: mustUseProp,
  19642. getTagNamespace: getTagNamespace,
  19643. isPreTag: isPreTag
  19644. };
  19645. function compile$$1 (
  19646. template,
  19647. options
  19648. ) {
  19649. options = options
  19650. ? extend(extend({}, baseOptions), options)
  19651. : baseOptions;
  19652. return compile$1(template, options)
  19653. }
  19654. function compileToFunctions (
  19655. template,
  19656. options,
  19657. vm
  19658. ) {
  19659. var _warn = (options && options.warn) || warn;
  19660. // detect possible CSP restriction
  19661. /* istanbul ignore if */
  19662. if (process.env.NODE_ENV !== 'production') {
  19663. try {
  19664. new Function('return 1');
  19665. } catch (e) {
  19666. if (e.toString().match(/unsafe-eval|CSP/)) {
  19667. _warn(
  19668. 'It seems you are using the standalone build of Vue.js in an ' +
  19669. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  19670. 'The template compiler cannot work in this environment. Consider ' +
  19671. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  19672. 'templates into render functions.'
  19673. );
  19674. }
  19675. }
  19676. }
  19677. var key = options && options.delimiters
  19678. ? String(options.delimiters) + template
  19679. : template;
  19680. if (cache[key]) {
  19681. return cache[key]
  19682. }
  19683. var res = {};
  19684. var compiled = compile$$1(template, options);
  19685. res.render = makeFunction(compiled.render);
  19686. var l = compiled.staticRenderFns.length;
  19687. res.staticRenderFns = new Array(l);
  19688. for (var i = 0; i < l; i++) {
  19689. res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);
  19690. }
  19691. if (process.env.NODE_ENV !== 'production') {
  19692. if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {
  19693. _warn(
  19694. "failed to compile template:\n\n" + template + "\n\n" +
  19695. detectErrors(compiled.ast).join('\n') +
  19696. '\n\n',
  19697. vm
  19698. );
  19699. }
  19700. }
  19701. return (cache[key] = res)
  19702. }
  19703. function makeFunction (code) {
  19704. try {
  19705. return new Function(code)
  19706. } catch (e) {
  19707. return noop
  19708. }
  19709. }
  19710. /* */
  19711. var idToTemplate = cached(function (id) {
  19712. var el = query(id);
  19713. return el && el.innerHTML
  19714. });
  19715. var mount = Vue$3.prototype.$mount;
  19716. Vue$3.prototype.$mount = function (
  19717. el,
  19718. hydrating
  19719. ) {
  19720. el = el && query(el);
  19721. /* istanbul ignore if */
  19722. if (el === document.body || el === document.documentElement) {
  19723. process.env.NODE_ENV !== 'production' && warn(
  19724. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  19725. );
  19726. return this
  19727. }
  19728. var options = this.$options;
  19729. // resolve template/el and convert to render function
  19730. if (!options.render) {
  19731. var template = options.template;
  19732. if (template) {
  19733. if (typeof template === 'string') {
  19734. if (template.charAt(0) === '#') {
  19735. template = idToTemplate(template);
  19736. /* istanbul ignore if */
  19737. if (process.env.NODE_ENV !== 'production' && !template) {
  19738. warn(
  19739. ("Template element not found or is empty: " + (options.template)),
  19740. this
  19741. );
  19742. }
  19743. }
  19744. } else if (template.nodeType) {
  19745. template = template.innerHTML;
  19746. } else {
  19747. if (process.env.NODE_ENV !== 'production') {
  19748. warn('invalid template option:' + template, this);
  19749. }
  19750. return this
  19751. }
  19752. } else if (el) {
  19753. template = getOuterHTML(el);
  19754. }
  19755. if (template) {
  19756. var ref = compileToFunctions(template, {
  19757. warn: warn,
  19758. shouldDecodeNewlines: shouldDecodeNewlines,
  19759. delimiters: options.delimiters
  19760. }, this);
  19761. var render = ref.render;
  19762. var staticRenderFns = ref.staticRenderFns;
  19763. options.render = render;
  19764. options.staticRenderFns = staticRenderFns;
  19765. }
  19766. }
  19767. return mount.call(this, el, hydrating)
  19768. };
  19769. /**
  19770. * Get outerHTML of elements, taking care
  19771. * of SVG elements in IE as well.
  19772. */
  19773. function getOuterHTML (el) {
  19774. if (el.outerHTML) {
  19775. return el.outerHTML
  19776. } else {
  19777. var container = document.createElement('div');
  19778. container.appendChild(el.cloneNode(true));
  19779. return container.innerHTML
  19780. }
  19781. }
  19782. Vue$3.compile = compileToFunctions;
  19783. module.exports = Vue$3;
  19784. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(25)))
  19785. /***/ }),
  19786. /* 12 */
  19787. /***/ (function(module, exports, __webpack_require__) {
  19788. exports = module.exports = __webpack_require__(13)();
  19789. // imports
  19790. // module
  19791. exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
  19792. // exports
  19793. /***/ }),
  19794. /* 13 */
  19795. /***/ (function(module, exports) {
  19796. /*
  19797. MIT License http://www.opensource.org/licenses/mit-license.php
  19798. Author Tobias Koppers @sokra
  19799. */
  19800. // css base code, injected by the css-loader
  19801. module.exports = function() {
  19802. var list = [];
  19803. // return the list of modules as css string
  19804. list.toString = function toString() {
  19805. var result = [];
  19806. for(var i = 0; i < this.length; i++) {
  19807. var item = this[i];
  19808. if(item[2]) {
  19809. result.push("@media " + item[2] + "{" + item[1] + "}");
  19810. } else {
  19811. result.push(item[1]);
  19812. }
  19813. }
  19814. return result.join("");
  19815. };
  19816. // import a list of modules into the list
  19817. list.i = function(modules, mediaQuery) {
  19818. if(typeof modules === "string")
  19819. modules = [[null, modules, ""]];
  19820. var alreadyImportedModules = {};
  19821. for(var i = 0; i < this.length; i++) {
  19822. var id = this[i][0];
  19823. if(typeof id === "number")
  19824. alreadyImportedModules[id] = true;
  19825. }
  19826. for(i = 0; i < modules.length; i++) {
  19827. var item = modules[i];
  19828. // skip already imported module
  19829. // this implementation is not 100% perfect for weird media query combinations
  19830. // when a module is imported multiple times with different media queries.
  19831. // I hope this will never occur (Hey this way we have smaller bundles)
  19832. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  19833. if(mediaQuery && !item[2]) {
  19834. item[2] = mediaQuery;
  19835. } else if(mediaQuery) {
  19836. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  19837. }
  19838. list.push(item);
  19839. }
  19840. }
  19841. };
  19842. return list;
  19843. };
  19844. /***/ }),
  19845. /* 14 */
  19846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19847. "use strict";
  19848. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(2);
  19850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  19851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(1);
  19852. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  19853. //
  19854. //
  19855. //
  19856. //
  19857. //
  19858. //
  19859. //
  19860. //
  19861. //
  19862. //
  19863. //
  19864. //
  19865. //
  19866. //
  19867. //
  19868. //
  19869. //
  19870. //
  19871. //
  19872. //
  19873. //
  19874. //
  19875. /* harmony default export */ __webpack_exports__["default"] = {
  19876. props: {
  19877. server: {
  19878. type: Object,
  19879. default:function () {
  19880. return {
  19881. id:0,
  19882. name: "Name",
  19883. address: "Address",
  19884. players: 0,
  19885. maxPlayers: 0,
  19886. isPassword: false
  19887. };
  19888. }
  19889. },
  19890. update: {
  19891. type: Function
  19892. }
  19893. },
  19894. data: function () {
  19895. return {};
  19896. },
  19897. methods: {
  19898. remove: function (id) {
  19899. var self = this;
  19900. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  19901. title: 'Are you sure?',
  19902. text: "You won't be able to revert this!",
  19903. type: 'warning',
  19904. showCancelButton: true,
  19905. confirmButtonColor: '#3085d6',
  19906. cancelButtonColor: '#d33',
  19907. confirmButtonText: 'Yes, delete it!'
  19908. }).then(function () {
  19909. var req = new XMLHttpRequest();
  19910. req.open('GET', '/api/servers/remove/'+ id);
  19911. req.send(null);
  19912. req.onreadystatechange = function () {
  19913. if (req.readyState == XMLHttpRequest.DONE &&
  19914. req.status === 200) {
  19915. self.update();
  19916. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(self.$el);
  19917. el.css("opacity", 0.5);
  19918. var actions = el.find("#actions");
  19919. actions.children().hide();
  19920. actions.append('<img src="svg/loading.svg"></img>');
  19921. }
  19922. };
  19923. }, function () {
  19924. }).catch(console.log);
  19925. }
  19926. }
  19927. };
  19928. /***/ }),
  19929. /* 15 */
  19930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19931. "use strict";
  19932. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19933. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(2);
  19934. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  19935. //
  19936. //
  19937. //
  19938. //
  19939. //
  19940. //
  19941. //
  19942. //
  19943. //
  19944. //
  19945. //
  19946. //
  19947. //
  19948. //
  19949. //
  19950. //
  19951. //
  19952. //
  19953. //
  19954. //
  19955. //
  19956. //
  19957. //
  19958. //
  19959. //
  19960. //
  19961. //
  19962. //
  19963. //
  19964. //
  19965. //
  19966. //
  19967. //
  19968. //
  19969. //
  19970. //
  19971. //
  19972. //
  19973. //
  19974. /* harmony default export */ __webpack_exports__["default"] = {
  19975. created: function () {
  19976. this.update();
  19977. },
  19978. data: function () {
  19979. return {
  19980. details: {},
  19981. server: {}
  19982. }
  19983. },
  19984. methods: {
  19985. update: function () {
  19986. if(this.$root.servers.length !== 0 && this.$root.serversId){
  19987. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  19988. }
  19989. var self = this;
  19990. var req = new XMLHttpRequest();
  19991. req.open('GET', '/api/servers/get/'+this.$route.params.id);
  19992. req.send(null);
  19993. req.onreadystatechange = function () {
  19994. if (req.readyState == XMLHttpRequest.DONE &&
  19995. req.status === 200) {
  19996. self.details = JSON.parse(req.response);
  19997. }
  19998. };
  19999. },
  20000. remove: function (id) {
  20001. var self = this;
  20002. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  20003. title: 'Are you sure?',
  20004. text: "You won't be able to revert this!",
  20005. type: 'warning',
  20006. showCancelButton: true,
  20007. confirmButtonColor: '#3085d6',
  20008. cancelButtonColor: '#d33',
  20009. confirmButtonText: 'Yes, delete it!'
  20010. }).then(function () {
  20011. var req = new XMLHttpRequest();
  20012. req.open('GET', '/api/servers/remove/'+ id);
  20013. req.send(null);
  20014. req.onreadystatechange = function () {
  20015. if (req.readyState == XMLHttpRequest.DONE &&
  20016. req.status === 200) {
  20017. }
  20018. };
  20019. self.$router.push("/");
  20020. }, function () {
  20021. }).catch(console.log);
  20022. }
  20023. }
  20024. };
  20025. /***/ }),
  20026. /* 16 */
  20027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20028. "use strict";
  20029. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20030. //
  20031. //
  20032. //
  20033. //
  20034. //
  20035. //
  20036. //
  20037. //
  20038. //
  20039. //
  20040. //
  20041. //
  20042. //
  20043. //
  20044. //
  20045. //
  20046. //
  20047. //
  20048. //
  20049. //
  20050. //
  20051. /* harmony default export */ __webpack_exports__["default"] = {
  20052. created: function () {
  20053. this.servers = this.$root.servers;
  20054. this.update();
  20055. },
  20056. data: function () {
  20057. return {
  20058. servers: [],
  20059. serversId: {}
  20060. }
  20061. },
  20062. methods: {
  20063. update: function () {
  20064. var self = this;
  20065. var req = new XMLHttpRequest();
  20066. req.open('GET', '/api/details');
  20067. req.send(null);
  20068. req.onreadystatechange = function () {
  20069. if (req.readyState == XMLHttpRequest.DONE &&
  20070. req.status === 200) {
  20071. self.servers = JSON.parse(req.response);
  20072. var a;
  20073. self.$root.servers = self.servers;
  20074. self.$root.serversId = {};
  20075. for (a in self.servers) {
  20076. if (!self.servers.hasOwnProperty(a)) {
  20077. continue;
  20078. }
  20079. var obj = self.servers[a];
  20080. self.$root.serversId[obj.id] = a;
  20081. }
  20082. }
  20083. };
  20084. }
  20085. }
  20086. };
  20087. /***/ }),
  20088. /* 17 */
  20089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20090. "use strict";
  20091. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20092. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(2);
  20093. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  20094. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(1);
  20095. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  20096. //
  20097. //
  20098. //
  20099. //
  20100. //
  20101. //
  20102. //
  20103. //
  20104. //
  20105. //
  20106. //
  20107. //
  20108. //
  20109. //
  20110. //
  20111. //
  20112. //
  20113. //
  20114. //
  20115. //
  20116. //
  20117. //
  20118. //
  20119. //
  20120. //
  20121. /* harmony default export */ __webpack_exports__["default"] = {
  20122. mounted: function () {
  20123. this.request();
  20124. },
  20125. props: {
  20126. server: {
  20127. type: Object,
  20128. default:function () {
  20129. return {
  20130. id:0,
  20131. name: "Name",
  20132. address: "Address",
  20133. players: 0,
  20134. maxPlayers: 0,
  20135. isPassword: false
  20136. };
  20137. }
  20138. },
  20139. update: {
  20140. type: Function
  20141. },
  20142. onSubmit: {
  20143. type: Function,
  20144. default: function () {
  20145. }
  20146. },
  20147. buttonText: {
  20148. type: String,
  20149. default: function () {
  20150. return "Add";
  20151. }
  20152. }
  20153. },
  20154. data: function () {
  20155. return {};
  20156. },
  20157. methods: {
  20158. request: function () {
  20159. var self = this;
  20160. var form = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.$el);
  20161. form.submit(function(e){
  20162. e.preventDefault();
  20163. // Validation
  20164. var ar = form.serializeArray();
  20165. var flags = {
  20166. name: 0,
  20167. type: 0,
  20168. address: 0
  20169. }
  20170. ar.forEach(function (obj) {
  20171. if(!obj.value){
  20172. flags[obj.name] = 1;
  20173. }
  20174. });
  20175. var wrong = false;
  20176. for (var name in flags) {
  20177. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('[name="'+name+'"]')
  20178. if (!flags.hasOwnProperty(name)) {
  20179. continue;
  20180. }
  20181. if(flags[name]){
  20182. wrong = true;
  20183. el.addClass("form-control-danger");
  20184. el.parent().addClass("has-danger");
  20185. }else{
  20186. el.removeClass("form-control-danger");
  20187. el.parent().removeClass("has-danger")
  20188. }
  20189. }
  20190. if(wrong){
  20191. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  20192. titleText: "Wrong input",
  20193. text:"Provide all data about server",
  20194. type:"error"
  20195. });
  20196. return;
  20197. }
  20198. // Request
  20199. var req_add = new XMLHttpRequest();
  20200. req_add.open('POST', '/api/servers/add');
  20201. req_add.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  20202. req_add.onreadystatechange = function () {
  20203. if (req_add.readyState == XMLHttpRequest.DONE &&
  20204. req_add.status === 200) {
  20205. self.$router.push("/");
  20206. form.find("input, select").val("");
  20207. self.onSubmit();
  20208. }
  20209. };
  20210. req_add.send(form.serialize());
  20211. });
  20212. }
  20213. }
  20214. };
  20215. /***/ }),
  20216. /* 18 */
  20217. /***/ (function(module, exports, __webpack_require__) {
  20218. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20219. return _c('div', {
  20220. staticClass: "container no-gutters"
  20221. }, [_c('div', {
  20222. staticClass: "row"
  20223. }, [_c('h1', [_vm._v(_vm._s(_vm.server.name) + " "), _c('small', {
  20224. staticClass: "text-muted"
  20225. }, [_vm._v(_vm._s(_vm.details.name))])])]), _vm._v(" "), _c('div', {
  20226. staticClass: "row"
  20227. }, [_c('div', {
  20228. staticClass: "col-5"
  20229. }, [_c('ul', {
  20230. staticClass: "list-unstyled"
  20231. }, [(_vm.server && _vm.server.address !== undefined) ? _c('li', [_vm._v("\n Address: " + _vm._s(_vm.server.address) + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.map !== undefined) ? _c('li', [_vm._v("\n Map: " + _vm._s(_vm.details.map) + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.password !== undefined) ? _c('li', [_vm._v("\n Password: " + _vm._s(_vm.details.password ? "true" : "false") + "\n ")]) : _vm._e(), _vm._v(" "), (_vm.details && _vm.details.traffic !== undefined) ? _c('li', [_vm._v("\n Actual: " + _vm._s(_vm.details.traffic.players) + "/" + _vm._s(_vm.details.traffic.maxplayers) + "\n ")]) : _vm._e()])]), _vm._v(" "), _c('div', {
  20232. staticClass: "col-5"
  20233. }, [(_vm.details.players !== undefined && _vm.details.traffic) ? _c('div', [_vm._v("\n Players:"), _c('span', [_vm._v(_vm._s(_vm.details.players.length) + "/" + _vm._s(_vm.details.traffic.maxplayers))])]) : _vm._e(), _vm._v(" "), (_vm.details.players !== undefined) ? _c('ul', {
  20234. staticClass: "list-group"
  20235. }, _vm._l((_vm.details.players), function(player) {
  20236. return _c('li', {
  20237. staticClass: "list-group-item"
  20238. }, [_vm._v(_vm._s(player))])
  20239. })) : _vm._e()]), _vm._v(" "), _c('div', {
  20240. staticClass: "col-2"
  20241. }, [_c('button', {
  20242. staticClass: "btn btn-danger",
  20243. attrs: {
  20244. "type": "button"
  20245. },
  20246. on: {
  20247. "click": function($event) {
  20248. _vm.remove(_vm.$route.params.id)
  20249. }
  20250. }
  20251. }, [_vm._v("Remove")])])]), _vm._v(" "), _c('div', {
  20252. staticClass: "row"
  20253. })])
  20254. },staticRenderFns: []}
  20255. module.exports.render._withStripped = true
  20256. if (false) {
  20257. module.hot.accept()
  20258. if (module.hot.data) {
  20259. require("vue-hot-reload-api").rerender("data-v-04a2f200", module.exports)
  20260. }
  20261. }
  20262. /***/ }),
  20263. /* 19 */
  20264. /***/ (function(module, exports, __webpack_require__) {
  20265. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20266. return _c('div', {
  20267. staticClass: "row"
  20268. }, [_c('div', {
  20269. staticClass: "col-4"
  20270. }, [_c('div', {
  20271. attrs: {
  20272. "id": "actions"
  20273. }
  20274. }, [_c('a', {
  20275. on: {
  20276. "click": function($event) {
  20277. _vm.remove(_vm.server.id)
  20278. }
  20279. }
  20280. }, [_c('img', {
  20281. attrs: {
  20282. "src": "svg/x.svg"
  20283. }
  20284. })]), _vm._v(" "), _vm._m(0)]), _vm._v(" "), _c('router-link', {
  20285. attrs: {
  20286. "server": _vm.server,
  20287. "to": {
  20288. path: '/server/' + _vm.server.id
  20289. }
  20290. }
  20291. }, [_vm._v("\n " + _vm._s(_vm.server.name) + " "), _c('img', {
  20292. directives: [{
  20293. name: "show",
  20294. rawName: "v-show",
  20295. value: (_vm.server.isPassword),
  20296. expression: "server.isPassword"
  20297. }],
  20298. staticClass: "icon",
  20299. attrs: {
  20300. "src": "svg/lock.svg"
  20301. }
  20302. })])], 1), _vm._v(" "), _c('div', {
  20303. staticClass: "col-3"
  20304. }, [_vm._v("\n " + _vm._s(_vm.server.fullType) + "\n ")]), _vm._v(" "), _c('div', {
  20305. staticClass: "col-3"
  20306. }, [_vm._v("\n " + _vm._s(_vm.server.address) + "\n ")]), _vm._v(" "), _c('div', {
  20307. staticClass: "col-2"
  20308. }, [_vm._v("\n " + _vm._s(_vm.server.players) + "/" + _vm._s(_vm.server.maxPlayers) + "\n ")])])
  20309. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20310. return _c('a', [_c('img', {
  20311. attrs: {
  20312. "src": "svg/pencil.svg"
  20313. }
  20314. })])
  20315. }]}
  20316. module.exports.render._withStripped = true
  20317. if (false) {
  20318. module.hot.accept()
  20319. if (module.hot.data) {
  20320. require("vue-hot-reload-api").rerender("data-v-49b001dc", module.exports)
  20321. }
  20322. }
  20323. /***/ }),
  20324. /* 20 */
  20325. /***/ (function(module, exports, __webpack_require__) {
  20326. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20327. return _c('div', {
  20328. staticClass: "container no-gutters",
  20329. attrs: {
  20330. "id": "serverList"
  20331. }
  20332. }, [_vm._m(0), _vm._v(" "), _vm._l((_vm.servers), function(server) {
  20333. return _c('server', {
  20334. attrs: {
  20335. "server": server,
  20336. "update": _vm.update
  20337. }
  20338. })
  20339. }), _vm._v(" "), _c('serveredit', {
  20340. attrs: {
  20341. "update": _vm.update,
  20342. "onSubmit": _vm.update
  20343. }
  20344. })], 2)
  20345. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20346. return _c('div', {
  20347. staticClass: "row",
  20348. attrs: {
  20349. "id": "titles"
  20350. }
  20351. }, [_c('div', {
  20352. staticClass: "col-4"
  20353. }, [_vm._v("\n Server name\n ")]), _vm._v(" "), _c('div', {
  20354. staticClass: "col-3"
  20355. }, [_vm._v("\n Server Type\n ")]), _vm._v(" "), _c('div', {
  20356. staticClass: "col-3"
  20357. }, [_vm._v("\n Address\n ")]), _vm._v(" "), _c('div', {
  20358. staticClass: "col-2"
  20359. }, [_vm._v("\n Players\n ")])])
  20360. }]}
  20361. module.exports.render._withStripped = true
  20362. if (false) {
  20363. module.hot.accept()
  20364. if (module.hot.data) {
  20365. require("vue-hot-reload-api").rerender("data-v-7440c7d0", module.exports)
  20366. }
  20367. }
  20368. /***/ }),
  20369. /* 21 */
  20370. /***/ (function(module, exports, __webpack_require__) {
  20371. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20372. return _c('form', {
  20373. attrs: {
  20374. "action": "/api/servers/add",
  20375. "method": "post"
  20376. }
  20377. }, [_c('div', {
  20378. staticClass: "row editor form-group"
  20379. }, [_vm._m(0), _vm._v(" "), _c('div', {
  20380. staticClass: "col-3"
  20381. }, [_c('select', {
  20382. staticClass: "form-control",
  20383. attrs: {
  20384. "name": "type"
  20385. }
  20386. }, [_c('option', {
  20387. attrs: {
  20388. "value": ""
  20389. }
  20390. }, [_vm._v("Server type")]), _vm._v(" "), _vm._l((_vm.$root.types), function(option, key) {
  20391. return _c('option', {
  20392. domProps: {
  20393. "value": option
  20394. }
  20395. }, [_vm._v("\n " + _vm._s(key) + "\n ")])
  20396. })], 2)]), _vm._v(" "), _vm._m(1), _vm._v(" "), _c('div', {
  20397. staticClass: "col-2"
  20398. }, [_c('button', {
  20399. staticClass: "btn btn-primary",
  20400. attrs: {
  20401. "type": "submit"
  20402. }
  20403. }, [_vm._v(_vm._s(_vm.buttonText))])])])])
  20404. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20405. return _c('div', {
  20406. staticClass: "col-4"
  20407. }, [_c('input', {
  20408. staticClass: "form-control",
  20409. attrs: {
  20410. "placeholder": "Name",
  20411. "name": "name"
  20412. }
  20413. })])
  20414. },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  20415. return _c('div', {
  20416. staticClass: "col-3"
  20417. }, [_c('input', {
  20418. staticClass: "form-control",
  20419. attrs: {
  20420. "placeholder": "Address",
  20421. "name": "address"
  20422. }
  20423. })])
  20424. }]}
  20425. module.exports.render._withStripped = true
  20426. if (false) {
  20427. module.hot.accept()
  20428. if (module.hot.data) {
  20429. require("vue-hot-reload-api").rerender("data-v-7fae8b1c", module.exports)
  20430. }
  20431. }
  20432. /***/ }),
  20433. /* 22 */
  20434. /***/ (function(module, exports, __webpack_require__) {
  20435. // style-loader: Adds some css to the DOM by adding a <style> tag
  20436. // load the styles
  20437. var content = __webpack_require__(12);
  20438. if(typeof content === 'string') content = [[module.i, content, '']];
  20439. if(content.locals) module.exports = content.locals;
  20440. // add the styles to the DOM
  20441. var update = __webpack_require__(23)("2b78970d", content, false);
  20442. // Hot Module Replacement
  20443. if(false) {
  20444. // When the styles change, update the <style> tags
  20445. if(!content.locals) {
  20446. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7440c7d0\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue", function() {
  20447. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-7440c7d0\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./serverList.vue");
  20448. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20449. update(newContent);
  20450. });
  20451. }
  20452. // When the module is disposed, remove the <style> tags
  20453. module.hot.dispose(function() { update(); });
  20454. }
  20455. /***/ }),
  20456. /* 23 */
  20457. /***/ (function(module, exports, __webpack_require__) {
  20458. /*
  20459. MIT License http://www.opensource.org/licenses/mit-license.php
  20460. Author Tobias Koppers @sokra
  20461. Modified by Evan You @yyx990803
  20462. */
  20463. var hasDocument = typeof document !== 'undefined'
  20464. if (typeof DEBUG !== 'undefined' && DEBUG) {
  20465. if (!hasDocument) {
  20466. throw new Error(
  20467. 'vue-style-loader cannot be used in a non-browser environment. ' +
  20468. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  20469. ) }
  20470. }
  20471. var listToStyles = __webpack_require__(24)
  20472. /*
  20473. type StyleObject = {
  20474. id: number;
  20475. parts: Array<StyleObjectPart>
  20476. }
  20477. type StyleObjectPart = {
  20478. css: string;
  20479. media: string;
  20480. sourceMap: ?string
  20481. }
  20482. */
  20483. var stylesInDom = {/*
  20484. [id: number]: {
  20485. id: number,
  20486. refs: number,
  20487. parts: Array<(obj?: StyleObjectPart) => void>
  20488. }
  20489. */}
  20490. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  20491. var singletonElement = null
  20492. var singletonCounter = 0
  20493. var isProduction = false
  20494. var noop = function () {}
  20495. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  20496. // tags it will allow on a page
  20497. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  20498. module.exports = function (parentId, list, _isProduction) {
  20499. isProduction = _isProduction
  20500. var styles = listToStyles(parentId, list)
  20501. addStylesToDom(styles)
  20502. return function update (newList) {
  20503. var mayRemove = []
  20504. for (var i = 0; i < styles.length; i++) {
  20505. var item = styles[i]
  20506. var domStyle = stylesInDom[item.id]
  20507. domStyle.refs--
  20508. mayRemove.push(domStyle)
  20509. }
  20510. if (newList) {
  20511. styles = listToStyles(parentId, newList)
  20512. addStylesToDom(styles)
  20513. } else {
  20514. styles = []
  20515. }
  20516. for (var i = 0; i < mayRemove.length; i++) {
  20517. var domStyle = mayRemove[i]
  20518. if (domStyle.refs === 0) {
  20519. for (var j = 0; j < domStyle.parts.length; j++) {
  20520. domStyle.parts[j]()
  20521. }
  20522. delete stylesInDom[domStyle.id]
  20523. }
  20524. }
  20525. }
  20526. }
  20527. function addStylesToDom (styles /* Array<StyleObject> */) {
  20528. for (var i = 0; i < styles.length; i++) {
  20529. var item = styles[i]
  20530. var domStyle = stylesInDom[item.id]
  20531. if (domStyle) {
  20532. domStyle.refs++
  20533. for (var j = 0; j < domStyle.parts.length; j++) {
  20534. domStyle.parts[j](item.parts[j])
  20535. }
  20536. for (; j < item.parts.length; j++) {
  20537. domStyle.parts.push(addStyle(item.parts[j]))
  20538. }
  20539. if (domStyle.parts.length > item.parts.length) {
  20540. domStyle.parts.length = item.parts.length
  20541. }
  20542. } else {
  20543. var parts = []
  20544. for (var j = 0; j < item.parts.length; j++) {
  20545. parts.push(addStyle(item.parts[j]))
  20546. }
  20547. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  20548. }
  20549. }
  20550. }
  20551. function listToStyles (parentId, list) {
  20552. var styles = []
  20553. var newStyles = {}
  20554. for (var i = 0; i < list.length; i++) {
  20555. var item = list[i]
  20556. var id = item[0]
  20557. var css = item[1]
  20558. var media = item[2]
  20559. var sourceMap = item[3]
  20560. var part = { css: css, media: media, sourceMap: sourceMap }
  20561. if (!newStyles[id]) {
  20562. part.id = parentId + ':0'
  20563. styles.push(newStyles[id] = { id: id, parts: [part] })
  20564. } else {
  20565. part.id = parentId + ':' + newStyles[id].parts.length
  20566. newStyles[id].parts.push(part)
  20567. }
  20568. }
  20569. return styles
  20570. }
  20571. function createStyleElement () {
  20572. var styleElement = document.createElement('style')
  20573. styleElement.type = 'text/css'
  20574. head.appendChild(styleElement)
  20575. return styleElement
  20576. }
  20577. function addStyle (obj /* StyleObjectPart */) {
  20578. var update, remove
  20579. var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
  20580. var hasSSR = styleElement != null
  20581. // if in production mode and style is already provided by SSR,
  20582. // simply do nothing.
  20583. if (hasSSR && isProduction) {
  20584. return noop
  20585. }
  20586. if (isOldIE) {
  20587. // use singleton mode for IE9.
  20588. var styleIndex = singletonCounter++
  20589. styleElement = singletonElement || (singletonElement = createStyleElement())
  20590. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  20591. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  20592. } else {
  20593. // use multi-style-tag mode in all other cases
  20594. styleElement = styleElement || createStyleElement()
  20595. update = applyToTag.bind(null, styleElement)
  20596. remove = function () {
  20597. styleElement.parentNode.removeChild(styleElement)
  20598. }
  20599. }
  20600. if (!hasSSR) {
  20601. update(obj)
  20602. }
  20603. return function updateStyle (newObj /* StyleObjectPart */) {
  20604. if (newObj) {
  20605. if (newObj.css === obj.css &&
  20606. newObj.media === obj.media &&
  20607. newObj.sourceMap === obj.sourceMap) {
  20608. return
  20609. }
  20610. update(obj = newObj)
  20611. } else {
  20612. remove()
  20613. }
  20614. }
  20615. }
  20616. var replaceText = (function () {
  20617. var textStore = []
  20618. return function (index, replacement) {
  20619. textStore[index] = replacement
  20620. return textStore.filter(Boolean).join('\n')
  20621. }
  20622. })()
  20623. function applyToSingletonTag (styleElement, index, remove, obj) {
  20624. var css = remove ? '' : obj.css
  20625. if (styleElement.styleSheet) {
  20626. styleElement.styleSheet.cssText = replaceText(index, css)
  20627. } else {
  20628. var cssNode = document.createTextNode(css)
  20629. var childNodes = styleElement.childNodes
  20630. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  20631. if (childNodes.length) {
  20632. styleElement.insertBefore(cssNode, childNodes[index])
  20633. } else {
  20634. styleElement.appendChild(cssNode)
  20635. }
  20636. }
  20637. }
  20638. function applyToTag (styleElement, obj) {
  20639. var css = obj.css
  20640. var media = obj.media
  20641. var sourceMap = obj.sourceMap
  20642. if (media) {
  20643. styleElement.setAttribute('media', media)
  20644. }
  20645. if (sourceMap) {
  20646. // https://developer.chrome.com/devtools/docs/javascript-debugging
  20647. // this makes source maps inside style tags work properly in Chrome
  20648. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  20649. // http://stackoverflow.com/a/26603875
  20650. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  20651. }
  20652. if (styleElement.styleSheet) {
  20653. styleElement.styleSheet.cssText = css
  20654. } else {
  20655. while (styleElement.firstChild) {
  20656. styleElement.removeChild(styleElement.firstChild)
  20657. }
  20658. styleElement.appendChild(document.createTextNode(css))
  20659. }
  20660. }
  20661. /***/ }),
  20662. /* 24 */
  20663. /***/ (function(module, exports) {
  20664. /**
  20665. * Translates the list format produced by css-loader into something
  20666. * easier to manipulate.
  20667. */
  20668. module.exports = function listToStyles (parentId, list) {
  20669. var styles = []
  20670. var newStyles = {}
  20671. for (var i = 0; i < list.length; i++) {
  20672. var item = list[i]
  20673. var id = item[0]
  20674. var css = item[1]
  20675. var media = item[2]
  20676. var sourceMap = item[3]
  20677. var part = {
  20678. id: parentId + ':' + i,
  20679. css: css,
  20680. media: media,
  20681. sourceMap: sourceMap
  20682. }
  20683. if (!newStyles[id]) {
  20684. styles.push(newStyles[id] = { id: id, parts: [part] })
  20685. } else {
  20686. newStyles[id].parts.push(part)
  20687. }
  20688. }
  20689. return styles
  20690. }
  20691. /***/ }),
  20692. /* 25 */
  20693. /***/ (function(module, exports) {
  20694. var g;
  20695. // This works in non-strict mode
  20696. g = (function() {
  20697. return this;
  20698. })();
  20699. try {
  20700. // This works if eval is allowed (see CSP)
  20701. g = g || Function("return this")() || (1,eval)("this");
  20702. } catch(e) {
  20703. // This works if the window reference is available
  20704. if(typeof window === "object")
  20705. g = window;
  20706. }
  20707. // g can still be undefined, but nothing to do about it...
  20708. // We return undefined, instead of nothing here, so it's
  20709. // easier to handle this case. if(!global) { ...}
  20710. module.exports = g;
  20711. /***/ }),
  20712. /* 26 */
  20713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20714. "use strict";
  20715. /* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__ = __webpack_require__(4);
  20717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__);
  20718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__ = __webpack_require__(5);
  20719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__);
  20720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(11);
  20721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);
  20722. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(10);
  20723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_router__);
  20724. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__serverList_vue__ = __webpack_require__(8);
  20725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__serverList_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__serverList_vue__);
  20726. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverDetails_vue__ = __webpack_require__(7);
  20727. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serverDetails_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__serverDetails_vue__);
  20728. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__server_vue__ = __webpack_require__(6);
  20729. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__server_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__server_vue__);
  20730. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__serveredit_vue__ = __webpack_require__(9);
  20731. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__serveredit_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__serveredit_vue__);
  20732. // import $ from "jquery";
  20733. // import "bootstrap/dist/js/bootstrap.js";
  20734. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router___default.a);
  20735. // Debug mode
  20736. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.debug = true;
  20737. // Devtools enabled
  20738. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.devtools = true;
  20739. // Silence logs and warnings
  20740. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.silent = false;
  20741. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('server', __WEBPACK_IMPORTED_MODULE_6__server_vue___default.a);
  20742. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('serveredit', __WEBPACK_IMPORTED_MODULE_7__serveredit_vue___default.a);
  20743. var routes = [
  20744. { path: "/", component: __WEBPACK_IMPORTED_MODULE_4__serverList_vue___default.a },
  20745. { path: "/server/:id", component: __WEBPACK_IMPORTED_MODULE_5__serverDetails_vue___default.a }
  20746. ];
  20747. const router = new __WEBPACK_IMPORTED_MODULE_3_vue_router___default.a({
  20748. routes: routes,
  20749. mode: 'history'
  20750. });
  20751. $(function () {
  20752. var app = new __WEBPACK_IMPORTED_MODULE_2_vue___default.a({
  20753. router: router,
  20754. el: "#statsApp",
  20755. data: {
  20756. servers: [],
  20757. serversId: {},
  20758. types: []
  20759. },
  20760. created: function(){
  20761. var self = this;
  20762. var types = new XMLHttpRequest();
  20763. types.open('GET', '/api/types');
  20764. types.send(null);
  20765. types.onreadystatechange = function () {
  20766. if (types.readyState == XMLHttpRequest.DONE &&
  20767. types.status === 200) {
  20768. self.types = JSON.parse(types.response);
  20769. }
  20770. };
  20771. }
  20772. });//.$mount("#statsApp");
  20773. });
  20774. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
  20775. /***/ })
  20776. /******/ ]);