bundle.js 1.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194
  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 = 192);
  52. /******/ })
  53. /************************************************************************/
  54. /******/ ([
  55. /* 0 */
  56. /***/ (function(module, exports, __webpack_require__) {
  57. /* WEBPACK VAR INJECTION */(function(module) {//! moment.js
  58. //! version : 2.17.1
  59. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  60. //! license : MIT
  61. //! momentjs.com
  62. ;(function (global, factory) {
  63. true ? module.exports = factory() :
  64. typeof define === 'function' && define.amd ? define(factory) :
  65. global.moment = factory()
  66. }(this, (function () { 'use strict';
  67. var hookCallback;
  68. function hooks () {
  69. return hookCallback.apply(null, arguments);
  70. }
  71. // This is done to register the method called with moment()
  72. // without creating circular dependencies.
  73. function setHookCallback (callback) {
  74. hookCallback = callback;
  75. }
  76. function isArray(input) {
  77. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  78. }
  79. function isObject(input) {
  80. // IE8 will treat undefined and null as object if it wasn't for
  81. // input != null
  82. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  83. }
  84. function isObjectEmpty(obj) {
  85. var k;
  86. for (k in obj) {
  87. // even if its not own property I'd still call it non-empty
  88. return false;
  89. }
  90. return true;
  91. }
  92. function isNumber(input) {
  93. return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  94. }
  95. function isDate(input) {
  96. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  97. }
  98. function map(arr, fn) {
  99. var res = [], i;
  100. for (i = 0; i < arr.length; ++i) {
  101. res.push(fn(arr[i], i));
  102. }
  103. return res;
  104. }
  105. function hasOwnProp(a, b) {
  106. return Object.prototype.hasOwnProperty.call(a, b);
  107. }
  108. function extend(a, b) {
  109. for (var i in b) {
  110. if (hasOwnProp(b, i)) {
  111. a[i] = b[i];
  112. }
  113. }
  114. if (hasOwnProp(b, 'toString')) {
  115. a.toString = b.toString;
  116. }
  117. if (hasOwnProp(b, 'valueOf')) {
  118. a.valueOf = b.valueOf;
  119. }
  120. return a;
  121. }
  122. function createUTC (input, format, locale, strict) {
  123. return createLocalOrUTC(input, format, locale, strict, true).utc();
  124. }
  125. function defaultParsingFlags() {
  126. // We need to deep clone this object.
  127. return {
  128. empty : false,
  129. unusedTokens : [],
  130. unusedInput : [],
  131. overflow : -2,
  132. charsLeftOver : 0,
  133. nullInput : false,
  134. invalidMonth : null,
  135. invalidFormat : false,
  136. userInvalidated : false,
  137. iso : false,
  138. parsedDateParts : [],
  139. meridiem : null
  140. };
  141. }
  142. function getParsingFlags(m) {
  143. if (m._pf == null) {
  144. m._pf = defaultParsingFlags();
  145. }
  146. return m._pf;
  147. }
  148. var some;
  149. if (Array.prototype.some) {
  150. some = Array.prototype.some;
  151. } else {
  152. some = function (fun) {
  153. var t = Object(this);
  154. var len = t.length >>> 0;
  155. for (var i = 0; i < len; i++) {
  156. if (i in t && fun.call(this, t[i], i, t)) {
  157. return true;
  158. }
  159. }
  160. return false;
  161. };
  162. }
  163. var some$1 = some;
  164. function isValid(m) {
  165. if (m._isValid == null) {
  166. var flags = getParsingFlags(m);
  167. var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
  168. return i != null;
  169. });
  170. var isNowValid = !isNaN(m._d.getTime()) &&
  171. flags.overflow < 0 &&
  172. !flags.empty &&
  173. !flags.invalidMonth &&
  174. !flags.invalidWeekday &&
  175. !flags.nullInput &&
  176. !flags.invalidFormat &&
  177. !flags.userInvalidated &&
  178. (!flags.meridiem || (flags.meridiem && parsedParts));
  179. if (m._strict) {
  180. isNowValid = isNowValid &&
  181. flags.charsLeftOver === 0 &&
  182. flags.unusedTokens.length === 0 &&
  183. flags.bigHour === undefined;
  184. }
  185. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  186. m._isValid = isNowValid;
  187. }
  188. else {
  189. return isNowValid;
  190. }
  191. }
  192. return m._isValid;
  193. }
  194. function createInvalid (flags) {
  195. var m = createUTC(NaN);
  196. if (flags != null) {
  197. extend(getParsingFlags(m), flags);
  198. }
  199. else {
  200. getParsingFlags(m).userInvalidated = true;
  201. }
  202. return m;
  203. }
  204. function isUndefined(input) {
  205. return input === void 0;
  206. }
  207. // Plugins that add properties should also add the key here (null value),
  208. // so we can properly clone ourselves.
  209. var momentProperties = hooks.momentProperties = [];
  210. function copyConfig(to, from) {
  211. var i, prop, val;
  212. if (!isUndefined(from._isAMomentObject)) {
  213. to._isAMomentObject = from._isAMomentObject;
  214. }
  215. if (!isUndefined(from._i)) {
  216. to._i = from._i;
  217. }
  218. if (!isUndefined(from._f)) {
  219. to._f = from._f;
  220. }
  221. if (!isUndefined(from._l)) {
  222. to._l = from._l;
  223. }
  224. if (!isUndefined(from._strict)) {
  225. to._strict = from._strict;
  226. }
  227. if (!isUndefined(from._tzm)) {
  228. to._tzm = from._tzm;
  229. }
  230. if (!isUndefined(from._isUTC)) {
  231. to._isUTC = from._isUTC;
  232. }
  233. if (!isUndefined(from._offset)) {
  234. to._offset = from._offset;
  235. }
  236. if (!isUndefined(from._pf)) {
  237. to._pf = getParsingFlags(from);
  238. }
  239. if (!isUndefined(from._locale)) {
  240. to._locale = from._locale;
  241. }
  242. if (momentProperties.length > 0) {
  243. for (i in momentProperties) {
  244. prop = momentProperties[i];
  245. val = from[prop];
  246. if (!isUndefined(val)) {
  247. to[prop] = val;
  248. }
  249. }
  250. }
  251. return to;
  252. }
  253. var updateInProgress = false;
  254. // Moment prototype object
  255. function Moment(config) {
  256. copyConfig(this, config);
  257. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  258. if (!this.isValid()) {
  259. this._d = new Date(NaN);
  260. }
  261. // Prevent infinite loop in case updateOffset creates new moment
  262. // objects.
  263. if (updateInProgress === false) {
  264. updateInProgress = true;
  265. hooks.updateOffset(this);
  266. updateInProgress = false;
  267. }
  268. }
  269. function isMoment (obj) {
  270. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  271. }
  272. function absFloor (number) {
  273. if (number < 0) {
  274. // -0 -> 0
  275. return Math.ceil(number) || 0;
  276. } else {
  277. return Math.floor(number);
  278. }
  279. }
  280. function toInt(argumentForCoercion) {
  281. var coercedNumber = +argumentForCoercion,
  282. value = 0;
  283. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  284. value = absFloor(coercedNumber);
  285. }
  286. return value;
  287. }
  288. // compare two arrays, return the number of differences
  289. function compareArrays(array1, array2, dontConvert) {
  290. var len = Math.min(array1.length, array2.length),
  291. lengthDiff = Math.abs(array1.length - array2.length),
  292. diffs = 0,
  293. i;
  294. for (i = 0; i < len; i++) {
  295. if ((dontConvert && array1[i] !== array2[i]) ||
  296. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  297. diffs++;
  298. }
  299. }
  300. return diffs + lengthDiff;
  301. }
  302. function warn(msg) {
  303. if (hooks.suppressDeprecationWarnings === false &&
  304. (typeof console !== 'undefined') && console.warn) {
  305. console.warn('Deprecation warning: ' + msg);
  306. }
  307. }
  308. function deprecate(msg, fn) {
  309. var firstTime = true;
  310. return extend(function () {
  311. if (hooks.deprecationHandler != null) {
  312. hooks.deprecationHandler(null, msg);
  313. }
  314. if (firstTime) {
  315. var args = [];
  316. var arg;
  317. for (var i = 0; i < arguments.length; i++) {
  318. arg = '';
  319. if (typeof arguments[i] === 'object') {
  320. arg += '\n[' + i + '] ';
  321. for (var key in arguments[0]) {
  322. arg += key + ': ' + arguments[0][key] + ', ';
  323. }
  324. arg = arg.slice(0, -2); // Remove trailing comma and space
  325. } else {
  326. arg = arguments[i];
  327. }
  328. args.push(arg);
  329. }
  330. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  331. firstTime = false;
  332. }
  333. return fn.apply(this, arguments);
  334. }, fn);
  335. }
  336. var deprecations = {};
  337. function deprecateSimple(name, msg) {
  338. if (hooks.deprecationHandler != null) {
  339. hooks.deprecationHandler(name, msg);
  340. }
  341. if (!deprecations[name]) {
  342. warn(msg);
  343. deprecations[name] = true;
  344. }
  345. }
  346. hooks.suppressDeprecationWarnings = false;
  347. hooks.deprecationHandler = null;
  348. function isFunction(input) {
  349. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  350. }
  351. function set (config) {
  352. var prop, i;
  353. for (i in config) {
  354. prop = config[i];
  355. if (isFunction(prop)) {
  356. this[i] = prop;
  357. } else {
  358. this['_' + i] = prop;
  359. }
  360. }
  361. this._config = config;
  362. // Lenient ordinal parsing accepts just a number in addition to
  363. // number + (possibly) stuff coming from _ordinalParseLenient.
  364. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  365. }
  366. function mergeConfigs(parentConfig, childConfig) {
  367. var res = extend({}, parentConfig), prop;
  368. for (prop in childConfig) {
  369. if (hasOwnProp(childConfig, prop)) {
  370. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  371. res[prop] = {};
  372. extend(res[prop], parentConfig[prop]);
  373. extend(res[prop], childConfig[prop]);
  374. } else if (childConfig[prop] != null) {
  375. res[prop] = childConfig[prop];
  376. } else {
  377. delete res[prop];
  378. }
  379. }
  380. }
  381. for (prop in parentConfig) {
  382. if (hasOwnProp(parentConfig, prop) &&
  383. !hasOwnProp(childConfig, prop) &&
  384. isObject(parentConfig[prop])) {
  385. // make sure changes to properties don't modify parent config
  386. res[prop] = extend({}, res[prop]);
  387. }
  388. }
  389. return res;
  390. }
  391. function Locale(config) {
  392. if (config != null) {
  393. this.set(config);
  394. }
  395. }
  396. var keys;
  397. if (Object.keys) {
  398. keys = Object.keys;
  399. } else {
  400. keys = function (obj) {
  401. var i, res = [];
  402. for (i in obj) {
  403. if (hasOwnProp(obj, i)) {
  404. res.push(i);
  405. }
  406. }
  407. return res;
  408. };
  409. }
  410. var keys$1 = keys;
  411. var defaultCalendar = {
  412. sameDay : '[Today at] LT',
  413. nextDay : '[Tomorrow at] LT',
  414. nextWeek : 'dddd [at] LT',
  415. lastDay : '[Yesterday at] LT',
  416. lastWeek : '[Last] dddd [at] LT',
  417. sameElse : 'L'
  418. };
  419. function calendar (key, mom, now) {
  420. var output = this._calendar[key] || this._calendar['sameElse'];
  421. return isFunction(output) ? output.call(mom, now) : output;
  422. }
  423. var defaultLongDateFormat = {
  424. LTS : 'h:mm:ss A',
  425. LT : 'h:mm A',
  426. L : 'MM/DD/YYYY',
  427. LL : 'MMMM D, YYYY',
  428. LLL : 'MMMM D, YYYY h:mm A',
  429. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  430. };
  431. function longDateFormat (key) {
  432. var format = this._longDateFormat[key],
  433. formatUpper = this._longDateFormat[key.toUpperCase()];
  434. if (format || !formatUpper) {
  435. return format;
  436. }
  437. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  438. return val.slice(1);
  439. });
  440. return this._longDateFormat[key];
  441. }
  442. var defaultInvalidDate = 'Invalid date';
  443. function invalidDate () {
  444. return this._invalidDate;
  445. }
  446. var defaultOrdinal = '%d';
  447. var defaultOrdinalParse = /\d{1,2}/;
  448. function ordinal (number) {
  449. return this._ordinal.replace('%d', number);
  450. }
  451. var defaultRelativeTime = {
  452. future : 'in %s',
  453. past : '%s ago',
  454. s : 'a few seconds',
  455. m : 'a minute',
  456. mm : '%d minutes',
  457. h : 'an hour',
  458. hh : '%d hours',
  459. d : 'a day',
  460. dd : '%d days',
  461. M : 'a month',
  462. MM : '%d months',
  463. y : 'a year',
  464. yy : '%d years'
  465. };
  466. function relativeTime (number, withoutSuffix, string, isFuture) {
  467. var output = this._relativeTime[string];
  468. return (isFunction(output)) ?
  469. output(number, withoutSuffix, string, isFuture) :
  470. output.replace(/%d/i, number);
  471. }
  472. function pastFuture (diff, output) {
  473. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  474. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  475. }
  476. var aliases = {};
  477. function addUnitAlias (unit, shorthand) {
  478. var lowerCase = unit.toLowerCase();
  479. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  480. }
  481. function normalizeUnits(units) {
  482. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  483. }
  484. function normalizeObjectUnits(inputObject) {
  485. var normalizedInput = {},
  486. normalizedProp,
  487. prop;
  488. for (prop in inputObject) {
  489. if (hasOwnProp(inputObject, prop)) {
  490. normalizedProp = normalizeUnits(prop);
  491. if (normalizedProp) {
  492. normalizedInput[normalizedProp] = inputObject[prop];
  493. }
  494. }
  495. }
  496. return normalizedInput;
  497. }
  498. var priorities = {};
  499. function addUnitPriority(unit, priority) {
  500. priorities[unit] = priority;
  501. }
  502. function getPrioritizedUnits(unitsObj) {
  503. var units = [];
  504. for (var u in unitsObj) {
  505. units.push({unit: u, priority: priorities[u]});
  506. }
  507. units.sort(function (a, b) {
  508. return a.priority - b.priority;
  509. });
  510. return units;
  511. }
  512. function makeGetSet (unit, keepTime) {
  513. return function (value) {
  514. if (value != null) {
  515. set$1(this, unit, value);
  516. hooks.updateOffset(this, keepTime);
  517. return this;
  518. } else {
  519. return get(this, unit);
  520. }
  521. };
  522. }
  523. function get (mom, unit) {
  524. return mom.isValid() ?
  525. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  526. }
  527. function set$1 (mom, unit, value) {
  528. if (mom.isValid()) {
  529. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  530. }
  531. }
  532. // MOMENTS
  533. function stringGet (units) {
  534. units = normalizeUnits(units);
  535. if (isFunction(this[units])) {
  536. return this[units]();
  537. }
  538. return this;
  539. }
  540. function stringSet (units, value) {
  541. if (typeof units === 'object') {
  542. units = normalizeObjectUnits(units);
  543. var prioritized = getPrioritizedUnits(units);
  544. for (var i = 0; i < prioritized.length; i++) {
  545. this[prioritized[i].unit](units[prioritized[i].unit]);
  546. }
  547. } else {
  548. units = normalizeUnits(units);
  549. if (isFunction(this[units])) {
  550. return this[units](value);
  551. }
  552. }
  553. return this;
  554. }
  555. function zeroFill(number, targetLength, forceSign) {
  556. var absNumber = '' + Math.abs(number),
  557. zerosToFill = targetLength - absNumber.length,
  558. sign = number >= 0;
  559. return (sign ? (forceSign ? '+' : '') : '-') +
  560. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  561. }
  562. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  563. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  564. var formatFunctions = {};
  565. var formatTokenFunctions = {};
  566. // token: 'M'
  567. // padded: ['MM', 2]
  568. // ordinal: 'Mo'
  569. // callback: function () { this.month() + 1 }
  570. function addFormatToken (token, padded, ordinal, callback) {
  571. var func = callback;
  572. if (typeof callback === 'string') {
  573. func = function () {
  574. return this[callback]();
  575. };
  576. }
  577. if (token) {
  578. formatTokenFunctions[token] = func;
  579. }
  580. if (padded) {
  581. formatTokenFunctions[padded[0]] = function () {
  582. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  583. };
  584. }
  585. if (ordinal) {
  586. formatTokenFunctions[ordinal] = function () {
  587. return this.localeData().ordinal(func.apply(this, arguments), token);
  588. };
  589. }
  590. }
  591. function removeFormattingTokens(input) {
  592. if (input.match(/\[[\s\S]/)) {
  593. return input.replace(/^\[|\]$/g, '');
  594. }
  595. return input.replace(/\\/g, '');
  596. }
  597. function makeFormatFunction(format) {
  598. var array = format.match(formattingTokens), i, length;
  599. for (i = 0, length = array.length; i < length; i++) {
  600. if (formatTokenFunctions[array[i]]) {
  601. array[i] = formatTokenFunctions[array[i]];
  602. } else {
  603. array[i] = removeFormattingTokens(array[i]);
  604. }
  605. }
  606. return function (mom) {
  607. var output = '', i;
  608. for (i = 0; i < length; i++) {
  609. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  610. }
  611. return output;
  612. };
  613. }
  614. // format date using native date object
  615. function formatMoment(m, format) {
  616. if (!m.isValid()) {
  617. return m.localeData().invalidDate();
  618. }
  619. format = expandFormat(format, m.localeData());
  620. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  621. return formatFunctions[format](m);
  622. }
  623. function expandFormat(format, locale) {
  624. var i = 5;
  625. function replaceLongDateFormatTokens(input) {
  626. return locale.longDateFormat(input) || input;
  627. }
  628. localFormattingTokens.lastIndex = 0;
  629. while (i >= 0 && localFormattingTokens.test(format)) {
  630. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  631. localFormattingTokens.lastIndex = 0;
  632. i -= 1;
  633. }
  634. return format;
  635. }
  636. var match1 = /\d/; // 0 - 9
  637. var match2 = /\d\d/; // 00 - 99
  638. var match3 = /\d{3}/; // 000 - 999
  639. var match4 = /\d{4}/; // 0000 - 9999
  640. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  641. var match1to2 = /\d\d?/; // 0 - 99
  642. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  643. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  644. var match1to3 = /\d{1,3}/; // 0 - 999
  645. var match1to4 = /\d{1,4}/; // 0 - 9999
  646. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  647. var matchUnsigned = /\d+/; // 0 - inf
  648. var matchSigned = /[+-]?\d+/; // -inf - inf
  649. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  650. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  651. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  652. // any word (or two) characters or numbers including two/three word month in arabic.
  653. // includes scottish gaelic two word and hyphenated months
  654. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  655. var regexes = {};
  656. function addRegexToken (token, regex, strictRegex) {
  657. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  658. return (isStrict && strictRegex) ? strictRegex : regex;
  659. };
  660. }
  661. function getParseRegexForToken (token, config) {
  662. if (!hasOwnProp(regexes, token)) {
  663. return new RegExp(unescapeFormat(token));
  664. }
  665. return regexes[token](config._strict, config._locale);
  666. }
  667. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  668. function unescapeFormat(s) {
  669. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  670. return p1 || p2 || p3 || p4;
  671. }));
  672. }
  673. function regexEscape(s) {
  674. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  675. }
  676. var tokens = {};
  677. function addParseToken (token, callback) {
  678. var i, func = callback;
  679. if (typeof token === 'string') {
  680. token = [token];
  681. }
  682. if (isNumber(callback)) {
  683. func = function (input, array) {
  684. array[callback] = toInt(input);
  685. };
  686. }
  687. for (i = 0; i < token.length; i++) {
  688. tokens[token[i]] = func;
  689. }
  690. }
  691. function addWeekParseToken (token, callback) {
  692. addParseToken(token, function (input, array, config, token) {
  693. config._w = config._w || {};
  694. callback(input, config._w, config, token);
  695. });
  696. }
  697. function addTimeToArrayFromToken(token, input, config) {
  698. if (input != null && hasOwnProp(tokens, token)) {
  699. tokens[token](input, config._a, config, token);
  700. }
  701. }
  702. var YEAR = 0;
  703. var MONTH = 1;
  704. var DATE = 2;
  705. var HOUR = 3;
  706. var MINUTE = 4;
  707. var SECOND = 5;
  708. var MILLISECOND = 6;
  709. var WEEK = 7;
  710. var WEEKDAY = 8;
  711. var indexOf;
  712. if (Array.prototype.indexOf) {
  713. indexOf = Array.prototype.indexOf;
  714. } else {
  715. indexOf = function (o) {
  716. // I know
  717. var i;
  718. for (i = 0; i < this.length; ++i) {
  719. if (this[i] === o) {
  720. return i;
  721. }
  722. }
  723. return -1;
  724. };
  725. }
  726. var indexOf$1 = indexOf;
  727. function daysInMonth(year, month) {
  728. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  729. }
  730. // FORMATTING
  731. addFormatToken('M', ['MM', 2], 'Mo', function () {
  732. return this.month() + 1;
  733. });
  734. addFormatToken('MMM', 0, 0, function (format) {
  735. return this.localeData().monthsShort(this, format);
  736. });
  737. addFormatToken('MMMM', 0, 0, function (format) {
  738. return this.localeData().months(this, format);
  739. });
  740. // ALIASES
  741. addUnitAlias('month', 'M');
  742. // PRIORITY
  743. addUnitPriority('month', 8);
  744. // PARSING
  745. addRegexToken('M', match1to2);
  746. addRegexToken('MM', match1to2, match2);
  747. addRegexToken('MMM', function (isStrict, locale) {
  748. return locale.monthsShortRegex(isStrict);
  749. });
  750. addRegexToken('MMMM', function (isStrict, locale) {
  751. return locale.monthsRegex(isStrict);
  752. });
  753. addParseToken(['M', 'MM'], function (input, array) {
  754. array[MONTH] = toInt(input) - 1;
  755. });
  756. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  757. var month = config._locale.monthsParse(input, token, config._strict);
  758. // if we didn't find a month name, mark the date as invalid.
  759. if (month != null) {
  760. array[MONTH] = month;
  761. } else {
  762. getParsingFlags(config).invalidMonth = input;
  763. }
  764. });
  765. // LOCALES
  766. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  767. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  768. function localeMonths (m, format) {
  769. if (!m) {
  770. return this._months;
  771. }
  772. return isArray(this._months) ? this._months[m.month()] :
  773. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  774. }
  775. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  776. function localeMonthsShort (m, format) {
  777. if (!m) {
  778. return this._monthsShort;
  779. }
  780. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  781. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  782. }
  783. function handleStrictParse(monthName, format, strict) {
  784. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  785. if (!this._monthsParse) {
  786. // this is not used
  787. this._monthsParse = [];
  788. this._longMonthsParse = [];
  789. this._shortMonthsParse = [];
  790. for (i = 0; i < 12; ++i) {
  791. mom = createUTC([2000, i]);
  792. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  793. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  794. }
  795. }
  796. if (strict) {
  797. if (format === 'MMM') {
  798. ii = indexOf$1.call(this._shortMonthsParse, llc);
  799. return ii !== -1 ? ii : null;
  800. } else {
  801. ii = indexOf$1.call(this._longMonthsParse, llc);
  802. return ii !== -1 ? ii : null;
  803. }
  804. } else {
  805. if (format === 'MMM') {
  806. ii = indexOf$1.call(this._shortMonthsParse, llc);
  807. if (ii !== -1) {
  808. return ii;
  809. }
  810. ii = indexOf$1.call(this._longMonthsParse, llc);
  811. return ii !== -1 ? ii : null;
  812. } else {
  813. ii = indexOf$1.call(this._longMonthsParse, llc);
  814. if (ii !== -1) {
  815. return ii;
  816. }
  817. ii = indexOf$1.call(this._shortMonthsParse, llc);
  818. return ii !== -1 ? ii : null;
  819. }
  820. }
  821. }
  822. function localeMonthsParse (monthName, format, strict) {
  823. var i, mom, regex;
  824. if (this._monthsParseExact) {
  825. return handleStrictParse.call(this, monthName, format, strict);
  826. }
  827. if (!this._monthsParse) {
  828. this._monthsParse = [];
  829. this._longMonthsParse = [];
  830. this._shortMonthsParse = [];
  831. }
  832. // TODO: add sorting
  833. // Sorting makes sure if one month (or abbr) is a prefix of another
  834. // see sorting in computeMonthsParse
  835. for (i = 0; i < 12; i++) {
  836. // make the regex if we don't have it already
  837. mom = createUTC([2000, i]);
  838. if (strict && !this._longMonthsParse[i]) {
  839. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  840. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  841. }
  842. if (!strict && !this._monthsParse[i]) {
  843. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  844. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  845. }
  846. // test the regex
  847. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  848. return i;
  849. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  850. return i;
  851. } else if (!strict && this._monthsParse[i].test(monthName)) {
  852. return i;
  853. }
  854. }
  855. }
  856. // MOMENTS
  857. function setMonth (mom, value) {
  858. var dayOfMonth;
  859. if (!mom.isValid()) {
  860. // No op
  861. return mom;
  862. }
  863. if (typeof value === 'string') {
  864. if (/^\d+$/.test(value)) {
  865. value = toInt(value);
  866. } else {
  867. value = mom.localeData().monthsParse(value);
  868. // TODO: Another silent failure?
  869. if (!isNumber(value)) {
  870. return mom;
  871. }
  872. }
  873. }
  874. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  875. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  876. return mom;
  877. }
  878. function getSetMonth (value) {
  879. if (value != null) {
  880. setMonth(this, value);
  881. hooks.updateOffset(this, true);
  882. return this;
  883. } else {
  884. return get(this, 'Month');
  885. }
  886. }
  887. function getDaysInMonth () {
  888. return daysInMonth(this.year(), this.month());
  889. }
  890. var defaultMonthsShortRegex = matchWord;
  891. function monthsShortRegex (isStrict) {
  892. if (this._monthsParseExact) {
  893. if (!hasOwnProp(this, '_monthsRegex')) {
  894. computeMonthsParse.call(this);
  895. }
  896. if (isStrict) {
  897. return this._monthsShortStrictRegex;
  898. } else {
  899. return this._monthsShortRegex;
  900. }
  901. } else {
  902. if (!hasOwnProp(this, '_monthsShortRegex')) {
  903. this._monthsShortRegex = defaultMonthsShortRegex;
  904. }
  905. return this._monthsShortStrictRegex && isStrict ?
  906. this._monthsShortStrictRegex : this._monthsShortRegex;
  907. }
  908. }
  909. var defaultMonthsRegex = matchWord;
  910. function monthsRegex (isStrict) {
  911. if (this._monthsParseExact) {
  912. if (!hasOwnProp(this, '_monthsRegex')) {
  913. computeMonthsParse.call(this);
  914. }
  915. if (isStrict) {
  916. return this._monthsStrictRegex;
  917. } else {
  918. return this._monthsRegex;
  919. }
  920. } else {
  921. if (!hasOwnProp(this, '_monthsRegex')) {
  922. this._monthsRegex = defaultMonthsRegex;
  923. }
  924. return this._monthsStrictRegex && isStrict ?
  925. this._monthsStrictRegex : this._monthsRegex;
  926. }
  927. }
  928. function computeMonthsParse () {
  929. function cmpLenRev(a, b) {
  930. return b.length - a.length;
  931. }
  932. var shortPieces = [], longPieces = [], mixedPieces = [],
  933. i, mom;
  934. for (i = 0; i < 12; i++) {
  935. // make the regex if we don't have it already
  936. mom = createUTC([2000, i]);
  937. shortPieces.push(this.monthsShort(mom, ''));
  938. longPieces.push(this.months(mom, ''));
  939. mixedPieces.push(this.months(mom, ''));
  940. mixedPieces.push(this.monthsShort(mom, ''));
  941. }
  942. // Sorting makes sure if one month (or abbr) is a prefix of another it
  943. // will match the longer piece.
  944. shortPieces.sort(cmpLenRev);
  945. longPieces.sort(cmpLenRev);
  946. mixedPieces.sort(cmpLenRev);
  947. for (i = 0; i < 12; i++) {
  948. shortPieces[i] = regexEscape(shortPieces[i]);
  949. longPieces[i] = regexEscape(longPieces[i]);
  950. }
  951. for (i = 0; i < 24; i++) {
  952. mixedPieces[i] = regexEscape(mixedPieces[i]);
  953. }
  954. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  955. this._monthsShortRegex = this._monthsRegex;
  956. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  957. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  958. }
  959. // FORMATTING
  960. addFormatToken('Y', 0, 0, function () {
  961. var y = this.year();
  962. return y <= 9999 ? '' + y : '+' + y;
  963. });
  964. addFormatToken(0, ['YY', 2], 0, function () {
  965. return this.year() % 100;
  966. });
  967. addFormatToken(0, ['YYYY', 4], 0, 'year');
  968. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  969. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  970. // ALIASES
  971. addUnitAlias('year', 'y');
  972. // PRIORITIES
  973. addUnitPriority('year', 1);
  974. // PARSING
  975. addRegexToken('Y', matchSigned);
  976. addRegexToken('YY', match1to2, match2);
  977. addRegexToken('YYYY', match1to4, match4);
  978. addRegexToken('YYYYY', match1to6, match6);
  979. addRegexToken('YYYYYY', match1to6, match6);
  980. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  981. addParseToken('YYYY', function (input, array) {
  982. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  983. });
  984. addParseToken('YY', function (input, array) {
  985. array[YEAR] = hooks.parseTwoDigitYear(input);
  986. });
  987. addParseToken('Y', function (input, array) {
  988. array[YEAR] = parseInt(input, 10);
  989. });
  990. // HELPERS
  991. function daysInYear(year) {
  992. return isLeapYear(year) ? 366 : 365;
  993. }
  994. function isLeapYear(year) {
  995. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  996. }
  997. // HOOKS
  998. hooks.parseTwoDigitYear = function (input) {
  999. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  1000. };
  1001. // MOMENTS
  1002. var getSetYear = makeGetSet('FullYear', true);
  1003. function getIsLeapYear () {
  1004. return isLeapYear(this.year());
  1005. }
  1006. function createDate (y, m, d, h, M, s, ms) {
  1007. //can't just apply() to create a date:
  1008. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  1009. var date = new Date(y, m, d, h, M, s, ms);
  1010. //the date constructor remaps years 0-99 to 1900-1999
  1011. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  1012. date.setFullYear(y);
  1013. }
  1014. return date;
  1015. }
  1016. function createUTCDate (y) {
  1017. var date = new Date(Date.UTC.apply(null, arguments));
  1018. //the Date.UTC function remaps years 0-99 to 1900-1999
  1019. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  1020. date.setUTCFullYear(y);
  1021. }
  1022. return date;
  1023. }
  1024. // start-of-first-week - start-of-year
  1025. function firstWeekOffset(year, dow, doy) {
  1026. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1027. fwd = 7 + dow - doy,
  1028. // first-week day local weekday -- which local weekday is fwd
  1029. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1030. return -fwdlw + fwd - 1;
  1031. }
  1032. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1033. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1034. var localWeekday = (7 + weekday - dow) % 7,
  1035. weekOffset = firstWeekOffset(year, dow, doy),
  1036. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  1037. resYear, resDayOfYear;
  1038. if (dayOfYear <= 0) {
  1039. resYear = year - 1;
  1040. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1041. } else if (dayOfYear > daysInYear(year)) {
  1042. resYear = year + 1;
  1043. resDayOfYear = dayOfYear - daysInYear(year);
  1044. } else {
  1045. resYear = year;
  1046. resDayOfYear = dayOfYear;
  1047. }
  1048. return {
  1049. year: resYear,
  1050. dayOfYear: resDayOfYear
  1051. };
  1052. }
  1053. function weekOfYear(mom, dow, doy) {
  1054. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  1055. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  1056. resWeek, resYear;
  1057. if (week < 1) {
  1058. resYear = mom.year() - 1;
  1059. resWeek = week + weeksInYear(resYear, dow, doy);
  1060. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1061. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1062. resYear = mom.year() + 1;
  1063. } else {
  1064. resYear = mom.year();
  1065. resWeek = week;
  1066. }
  1067. return {
  1068. week: resWeek,
  1069. year: resYear
  1070. };
  1071. }
  1072. function weeksInYear(year, dow, doy) {
  1073. var weekOffset = firstWeekOffset(year, dow, doy),
  1074. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1075. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1076. }
  1077. // FORMATTING
  1078. addFormatToken('w', ['ww', 2], 'wo', 'week');
  1079. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1080. // ALIASES
  1081. addUnitAlias('week', 'w');
  1082. addUnitAlias('isoWeek', 'W');
  1083. // PRIORITIES
  1084. addUnitPriority('week', 5);
  1085. addUnitPriority('isoWeek', 5);
  1086. // PARSING
  1087. addRegexToken('w', match1to2);
  1088. addRegexToken('ww', match1to2, match2);
  1089. addRegexToken('W', match1to2);
  1090. addRegexToken('WW', match1to2, match2);
  1091. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  1092. week[token.substr(0, 1)] = toInt(input);
  1093. });
  1094. // HELPERS
  1095. // LOCALES
  1096. function localeWeek (mom) {
  1097. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  1098. }
  1099. var defaultLocaleWeek = {
  1100. dow : 0, // Sunday is the first day of the week.
  1101. doy : 6 // The week that contains Jan 1st is the first week of the year.
  1102. };
  1103. function localeFirstDayOfWeek () {
  1104. return this._week.dow;
  1105. }
  1106. function localeFirstDayOfYear () {
  1107. return this._week.doy;
  1108. }
  1109. // MOMENTS
  1110. function getSetWeek (input) {
  1111. var week = this.localeData().week(this);
  1112. return input == null ? week : this.add((input - week) * 7, 'd');
  1113. }
  1114. function getSetISOWeek (input) {
  1115. var week = weekOfYear(this, 1, 4).week;
  1116. return input == null ? week : this.add((input - week) * 7, 'd');
  1117. }
  1118. // FORMATTING
  1119. addFormatToken('d', 0, 'do', 'day');
  1120. addFormatToken('dd', 0, 0, function (format) {
  1121. return this.localeData().weekdaysMin(this, format);
  1122. });
  1123. addFormatToken('ddd', 0, 0, function (format) {
  1124. return this.localeData().weekdaysShort(this, format);
  1125. });
  1126. addFormatToken('dddd', 0, 0, function (format) {
  1127. return this.localeData().weekdays(this, format);
  1128. });
  1129. addFormatToken('e', 0, 0, 'weekday');
  1130. addFormatToken('E', 0, 0, 'isoWeekday');
  1131. // ALIASES
  1132. addUnitAlias('day', 'd');
  1133. addUnitAlias('weekday', 'e');
  1134. addUnitAlias('isoWeekday', 'E');
  1135. // PRIORITY
  1136. addUnitPriority('day', 11);
  1137. addUnitPriority('weekday', 11);
  1138. addUnitPriority('isoWeekday', 11);
  1139. // PARSING
  1140. addRegexToken('d', match1to2);
  1141. addRegexToken('e', match1to2);
  1142. addRegexToken('E', match1to2);
  1143. addRegexToken('dd', function (isStrict, locale) {
  1144. return locale.weekdaysMinRegex(isStrict);
  1145. });
  1146. addRegexToken('ddd', function (isStrict, locale) {
  1147. return locale.weekdaysShortRegex(isStrict);
  1148. });
  1149. addRegexToken('dddd', function (isStrict, locale) {
  1150. return locale.weekdaysRegex(isStrict);
  1151. });
  1152. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  1153. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  1154. // if we didn't get a weekday name, mark the date as invalid
  1155. if (weekday != null) {
  1156. week.d = weekday;
  1157. } else {
  1158. getParsingFlags(config).invalidWeekday = input;
  1159. }
  1160. });
  1161. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  1162. week[token] = toInt(input);
  1163. });
  1164. // HELPERS
  1165. function parseWeekday(input, locale) {
  1166. if (typeof input !== 'string') {
  1167. return input;
  1168. }
  1169. if (!isNaN(input)) {
  1170. return parseInt(input, 10);
  1171. }
  1172. input = locale.weekdaysParse(input);
  1173. if (typeof input === 'number') {
  1174. return input;
  1175. }
  1176. return null;
  1177. }
  1178. function parseIsoWeekday(input, locale) {
  1179. if (typeof input === 'string') {
  1180. return locale.weekdaysParse(input) % 7 || 7;
  1181. }
  1182. return isNaN(input) ? null : input;
  1183. }
  1184. // LOCALES
  1185. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  1186. function localeWeekdays (m, format) {
  1187. if (!m) {
  1188. return this._weekdays;
  1189. }
  1190. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  1191. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  1192. }
  1193. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  1194. function localeWeekdaysShort (m) {
  1195. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  1196. }
  1197. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  1198. function localeWeekdaysMin (m) {
  1199. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  1200. }
  1201. function handleStrictParse$1(weekdayName, format, strict) {
  1202. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  1203. if (!this._weekdaysParse) {
  1204. this._weekdaysParse = [];
  1205. this._shortWeekdaysParse = [];
  1206. this._minWeekdaysParse = [];
  1207. for (i = 0; i < 7; ++i) {
  1208. mom = createUTC([2000, 1]).day(i);
  1209. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  1210. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  1211. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  1212. }
  1213. }
  1214. if (strict) {
  1215. if (format === 'dddd') {
  1216. ii = indexOf$1.call(this._weekdaysParse, llc);
  1217. return ii !== -1 ? ii : null;
  1218. } else if (format === 'ddd') {
  1219. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1220. return ii !== -1 ? ii : null;
  1221. } else {
  1222. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1223. return ii !== -1 ? ii : null;
  1224. }
  1225. } else {
  1226. if (format === 'dddd') {
  1227. ii = indexOf$1.call(this._weekdaysParse, llc);
  1228. if (ii !== -1) {
  1229. return ii;
  1230. }
  1231. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1232. if (ii !== -1) {
  1233. return ii;
  1234. }
  1235. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1236. return ii !== -1 ? ii : null;
  1237. } else if (format === 'ddd') {
  1238. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1239. if (ii !== -1) {
  1240. return ii;
  1241. }
  1242. ii = indexOf$1.call(this._weekdaysParse, llc);
  1243. if (ii !== -1) {
  1244. return ii;
  1245. }
  1246. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1247. return ii !== -1 ? ii : null;
  1248. } else {
  1249. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1250. if (ii !== -1) {
  1251. return ii;
  1252. }
  1253. ii = indexOf$1.call(this._weekdaysParse, llc);
  1254. if (ii !== -1) {
  1255. return ii;
  1256. }
  1257. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1258. return ii !== -1 ? ii : null;
  1259. }
  1260. }
  1261. }
  1262. function localeWeekdaysParse (weekdayName, format, strict) {
  1263. var i, mom, regex;
  1264. if (this._weekdaysParseExact) {
  1265. return handleStrictParse$1.call(this, weekdayName, format, strict);
  1266. }
  1267. if (!this._weekdaysParse) {
  1268. this._weekdaysParse = [];
  1269. this._minWeekdaysParse = [];
  1270. this._shortWeekdaysParse = [];
  1271. this._fullWeekdaysParse = [];
  1272. }
  1273. for (i = 0; i < 7; i++) {
  1274. // make the regex if we don't have it already
  1275. mom = createUTC([2000, 1]).day(i);
  1276. if (strict && !this._fullWeekdaysParse[i]) {
  1277. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  1278. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  1279. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  1280. }
  1281. if (!this._weekdaysParse[i]) {
  1282. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  1283. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1284. }
  1285. // test the regex
  1286. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  1287. return i;
  1288. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  1289. return i;
  1290. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  1291. return i;
  1292. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  1293. return i;
  1294. }
  1295. }
  1296. }
  1297. // MOMENTS
  1298. function getSetDayOfWeek (input) {
  1299. if (!this.isValid()) {
  1300. return input != null ? this : NaN;
  1301. }
  1302. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  1303. if (input != null) {
  1304. input = parseWeekday(input, this.localeData());
  1305. return this.add(input - day, 'd');
  1306. } else {
  1307. return day;
  1308. }
  1309. }
  1310. function getSetLocaleDayOfWeek (input) {
  1311. if (!this.isValid()) {
  1312. return input != null ? this : NaN;
  1313. }
  1314. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  1315. return input == null ? weekday : this.add(input - weekday, 'd');
  1316. }
  1317. function getSetISODayOfWeek (input) {
  1318. if (!this.isValid()) {
  1319. return input != null ? this : NaN;
  1320. }
  1321. // behaves the same as moment#day except
  1322. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  1323. // as a setter, sunday should belong to the previous week.
  1324. if (input != null) {
  1325. var weekday = parseIsoWeekday(input, this.localeData());
  1326. return this.day(this.day() % 7 ? weekday : weekday - 7);
  1327. } else {
  1328. return this.day() || 7;
  1329. }
  1330. }
  1331. var defaultWeekdaysRegex = matchWord;
  1332. function weekdaysRegex (isStrict) {
  1333. if (this._weekdaysParseExact) {
  1334. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1335. computeWeekdaysParse.call(this);
  1336. }
  1337. if (isStrict) {
  1338. return this._weekdaysStrictRegex;
  1339. } else {
  1340. return this._weekdaysRegex;
  1341. }
  1342. } else {
  1343. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1344. this._weekdaysRegex = defaultWeekdaysRegex;
  1345. }
  1346. return this._weekdaysStrictRegex && isStrict ?
  1347. this._weekdaysStrictRegex : this._weekdaysRegex;
  1348. }
  1349. }
  1350. var defaultWeekdaysShortRegex = matchWord;
  1351. function weekdaysShortRegex (isStrict) {
  1352. if (this._weekdaysParseExact) {
  1353. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1354. computeWeekdaysParse.call(this);
  1355. }
  1356. if (isStrict) {
  1357. return this._weekdaysShortStrictRegex;
  1358. } else {
  1359. return this._weekdaysShortRegex;
  1360. }
  1361. } else {
  1362. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  1363. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  1364. }
  1365. return this._weekdaysShortStrictRegex && isStrict ?
  1366. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  1367. }
  1368. }
  1369. var defaultWeekdaysMinRegex = matchWord;
  1370. function weekdaysMinRegex (isStrict) {
  1371. if (this._weekdaysParseExact) {
  1372. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1373. computeWeekdaysParse.call(this);
  1374. }
  1375. if (isStrict) {
  1376. return this._weekdaysMinStrictRegex;
  1377. } else {
  1378. return this._weekdaysMinRegex;
  1379. }
  1380. } else {
  1381. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  1382. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  1383. }
  1384. return this._weekdaysMinStrictRegex && isStrict ?
  1385. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  1386. }
  1387. }
  1388. function computeWeekdaysParse () {
  1389. function cmpLenRev(a, b) {
  1390. return b.length - a.length;
  1391. }
  1392. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  1393. i, mom, minp, shortp, longp;
  1394. for (i = 0; i < 7; i++) {
  1395. // make the regex if we don't have it already
  1396. mom = createUTC([2000, 1]).day(i);
  1397. minp = this.weekdaysMin(mom, '');
  1398. shortp = this.weekdaysShort(mom, '');
  1399. longp = this.weekdays(mom, '');
  1400. minPieces.push(minp);
  1401. shortPieces.push(shortp);
  1402. longPieces.push(longp);
  1403. mixedPieces.push(minp);
  1404. mixedPieces.push(shortp);
  1405. mixedPieces.push(longp);
  1406. }
  1407. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  1408. // will match the longer piece.
  1409. minPieces.sort(cmpLenRev);
  1410. shortPieces.sort(cmpLenRev);
  1411. longPieces.sort(cmpLenRev);
  1412. mixedPieces.sort(cmpLenRev);
  1413. for (i = 0; i < 7; i++) {
  1414. shortPieces[i] = regexEscape(shortPieces[i]);
  1415. longPieces[i] = regexEscape(longPieces[i]);
  1416. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1417. }
  1418. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1419. this._weekdaysShortRegex = this._weekdaysRegex;
  1420. this._weekdaysMinRegex = this._weekdaysRegex;
  1421. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  1422. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  1423. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  1424. }
  1425. // FORMATTING
  1426. function hFormat() {
  1427. return this.hours() % 12 || 12;
  1428. }
  1429. function kFormat() {
  1430. return this.hours() || 24;
  1431. }
  1432. addFormatToken('H', ['HH', 2], 0, 'hour');
  1433. addFormatToken('h', ['hh', 2], 0, hFormat);
  1434. addFormatToken('k', ['kk', 2], 0, kFormat);
  1435. addFormatToken('hmm', 0, 0, function () {
  1436. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  1437. });
  1438. addFormatToken('hmmss', 0, 0, function () {
  1439. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  1440. zeroFill(this.seconds(), 2);
  1441. });
  1442. addFormatToken('Hmm', 0, 0, function () {
  1443. return '' + this.hours() + zeroFill(this.minutes(), 2);
  1444. });
  1445. addFormatToken('Hmmss', 0, 0, function () {
  1446. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  1447. zeroFill(this.seconds(), 2);
  1448. });
  1449. function meridiem (token, lowercase) {
  1450. addFormatToken(token, 0, 0, function () {
  1451. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  1452. });
  1453. }
  1454. meridiem('a', true);
  1455. meridiem('A', false);
  1456. // ALIASES
  1457. addUnitAlias('hour', 'h');
  1458. // PRIORITY
  1459. addUnitPriority('hour', 13);
  1460. // PARSING
  1461. function matchMeridiem (isStrict, locale) {
  1462. return locale._meridiemParse;
  1463. }
  1464. addRegexToken('a', matchMeridiem);
  1465. addRegexToken('A', matchMeridiem);
  1466. addRegexToken('H', match1to2);
  1467. addRegexToken('h', match1to2);
  1468. addRegexToken('HH', match1to2, match2);
  1469. addRegexToken('hh', match1to2, match2);
  1470. addRegexToken('hmm', match3to4);
  1471. addRegexToken('hmmss', match5to6);
  1472. addRegexToken('Hmm', match3to4);
  1473. addRegexToken('Hmmss', match5to6);
  1474. addParseToken(['H', 'HH'], HOUR);
  1475. addParseToken(['a', 'A'], function (input, array, config) {
  1476. config._isPm = config._locale.isPM(input);
  1477. config._meridiem = input;
  1478. });
  1479. addParseToken(['h', 'hh'], function (input, array, config) {
  1480. array[HOUR] = toInt(input);
  1481. getParsingFlags(config).bigHour = true;
  1482. });
  1483. addParseToken('hmm', function (input, array, config) {
  1484. var pos = input.length - 2;
  1485. array[HOUR] = toInt(input.substr(0, pos));
  1486. array[MINUTE] = toInt(input.substr(pos));
  1487. getParsingFlags(config).bigHour = true;
  1488. });
  1489. addParseToken('hmmss', function (input, array, config) {
  1490. var pos1 = input.length - 4;
  1491. var pos2 = input.length - 2;
  1492. array[HOUR] = toInt(input.substr(0, pos1));
  1493. array[MINUTE] = toInt(input.substr(pos1, 2));
  1494. array[SECOND] = toInt(input.substr(pos2));
  1495. getParsingFlags(config).bigHour = true;
  1496. });
  1497. addParseToken('Hmm', function (input, array, config) {
  1498. var pos = input.length - 2;
  1499. array[HOUR] = toInt(input.substr(0, pos));
  1500. array[MINUTE] = toInt(input.substr(pos));
  1501. });
  1502. addParseToken('Hmmss', function (input, array, config) {
  1503. var pos1 = input.length - 4;
  1504. var pos2 = input.length - 2;
  1505. array[HOUR] = toInt(input.substr(0, pos1));
  1506. array[MINUTE] = toInt(input.substr(pos1, 2));
  1507. array[SECOND] = toInt(input.substr(pos2));
  1508. });
  1509. // LOCALES
  1510. function localeIsPM (input) {
  1511. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  1512. // Using charAt should be more compatible.
  1513. return ((input + '').toLowerCase().charAt(0) === 'p');
  1514. }
  1515. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  1516. function localeMeridiem (hours, minutes, isLower) {
  1517. if (hours > 11) {
  1518. return isLower ? 'pm' : 'PM';
  1519. } else {
  1520. return isLower ? 'am' : 'AM';
  1521. }
  1522. }
  1523. // MOMENTS
  1524. // Setting the hour should keep the time, because the user explicitly
  1525. // specified which hour he wants. So trying to maintain the same hour (in
  1526. // a new timezone) makes sense. Adding/subtracting hours does not follow
  1527. // this rule.
  1528. var getSetHour = makeGetSet('Hours', true);
  1529. // months
  1530. // week
  1531. // weekdays
  1532. // meridiem
  1533. var baseConfig = {
  1534. calendar: defaultCalendar,
  1535. longDateFormat: defaultLongDateFormat,
  1536. invalidDate: defaultInvalidDate,
  1537. ordinal: defaultOrdinal,
  1538. ordinalParse: defaultOrdinalParse,
  1539. relativeTime: defaultRelativeTime,
  1540. months: defaultLocaleMonths,
  1541. monthsShort: defaultLocaleMonthsShort,
  1542. week: defaultLocaleWeek,
  1543. weekdays: defaultLocaleWeekdays,
  1544. weekdaysMin: defaultLocaleWeekdaysMin,
  1545. weekdaysShort: defaultLocaleWeekdaysShort,
  1546. meridiemParse: defaultLocaleMeridiemParse
  1547. };
  1548. // internal storage for locale config files
  1549. var locales = {};
  1550. var localeFamilies = {};
  1551. var globalLocale;
  1552. function normalizeLocale(key) {
  1553. return key ? key.toLowerCase().replace('_', '-') : key;
  1554. }
  1555. // pick the locale from the array
  1556. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  1557. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  1558. function chooseLocale(names) {
  1559. var i = 0, j, next, locale, split;
  1560. while (i < names.length) {
  1561. split = normalizeLocale(names[i]).split('-');
  1562. j = split.length;
  1563. next = normalizeLocale(names[i + 1]);
  1564. next = next ? next.split('-') : null;
  1565. while (j > 0) {
  1566. locale = loadLocale(split.slice(0, j).join('-'));
  1567. if (locale) {
  1568. return locale;
  1569. }
  1570. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  1571. //the next array item is better than a shallower substring of this one
  1572. break;
  1573. }
  1574. j--;
  1575. }
  1576. i++;
  1577. }
  1578. return null;
  1579. }
  1580. function loadLocale(name) {
  1581. var oldLocale = null;
  1582. // TODO: Find a better way to register and load all the locales in Node
  1583. if (!locales[name] && (typeof module !== 'undefined') &&
  1584. module && module.exports) {
  1585. try {
  1586. oldLocale = globalLocale._abbr;
  1587. __webpack_require__(174)("./" + name);
  1588. // because defineLocale currently also sets the global locale, we
  1589. // want to undo that for lazy loaded locales
  1590. getSetGlobalLocale(oldLocale);
  1591. } catch (e) { }
  1592. }
  1593. return locales[name];
  1594. }
  1595. // This function will load locale and then set the global locale. If
  1596. // no arguments are passed in, it will simply return the current global
  1597. // locale key.
  1598. function getSetGlobalLocale (key, values) {
  1599. var data;
  1600. if (key) {
  1601. if (isUndefined(values)) {
  1602. data = getLocale(key);
  1603. }
  1604. else {
  1605. data = defineLocale(key, values);
  1606. }
  1607. if (data) {
  1608. // moment.duration._locale = moment._locale = data;
  1609. globalLocale = data;
  1610. }
  1611. }
  1612. return globalLocale._abbr;
  1613. }
  1614. function defineLocale (name, config) {
  1615. if (config !== null) {
  1616. var parentConfig = baseConfig;
  1617. config.abbr = name;
  1618. if (locales[name] != null) {
  1619. deprecateSimple('defineLocaleOverride',
  1620. 'use moment.updateLocale(localeName, config) to change ' +
  1621. 'an existing locale. moment.defineLocale(localeName, ' +
  1622. 'config) should only be used for creating a new locale ' +
  1623. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  1624. parentConfig = locales[name]._config;
  1625. } else if (config.parentLocale != null) {
  1626. if (locales[config.parentLocale] != null) {
  1627. parentConfig = locales[config.parentLocale]._config;
  1628. } else {
  1629. if (!localeFamilies[config.parentLocale]) {
  1630. localeFamilies[config.parentLocale] = [];
  1631. }
  1632. localeFamilies[config.parentLocale].push({
  1633. name: name,
  1634. config: config
  1635. });
  1636. return null;
  1637. }
  1638. }
  1639. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  1640. if (localeFamilies[name]) {
  1641. localeFamilies[name].forEach(function (x) {
  1642. defineLocale(x.name, x.config);
  1643. });
  1644. }
  1645. // backwards compat for now: also set the locale
  1646. // make sure we set the locale AFTER all child locales have been
  1647. // created, so we won't end up with the child locale set.
  1648. getSetGlobalLocale(name);
  1649. return locales[name];
  1650. } else {
  1651. // useful for testing
  1652. delete locales[name];
  1653. return null;
  1654. }
  1655. }
  1656. function updateLocale(name, config) {
  1657. if (config != null) {
  1658. var locale, parentConfig = baseConfig;
  1659. // MERGE
  1660. if (locales[name] != null) {
  1661. parentConfig = locales[name]._config;
  1662. }
  1663. config = mergeConfigs(parentConfig, config);
  1664. locale = new Locale(config);
  1665. locale.parentLocale = locales[name];
  1666. locales[name] = locale;
  1667. // backwards compat for now: also set the locale
  1668. getSetGlobalLocale(name);
  1669. } else {
  1670. // pass null for config to unupdate, useful for tests
  1671. if (locales[name] != null) {
  1672. if (locales[name].parentLocale != null) {
  1673. locales[name] = locales[name].parentLocale;
  1674. } else if (locales[name] != null) {
  1675. delete locales[name];
  1676. }
  1677. }
  1678. }
  1679. return locales[name];
  1680. }
  1681. // returns locale data
  1682. function getLocale (key) {
  1683. var locale;
  1684. if (key && key._locale && key._locale._abbr) {
  1685. key = key._locale._abbr;
  1686. }
  1687. if (!key) {
  1688. return globalLocale;
  1689. }
  1690. if (!isArray(key)) {
  1691. //short-circuit everything else
  1692. locale = loadLocale(key);
  1693. if (locale) {
  1694. return locale;
  1695. }
  1696. key = [key];
  1697. }
  1698. return chooseLocale(key);
  1699. }
  1700. function listLocales() {
  1701. return keys$1(locales);
  1702. }
  1703. function checkOverflow (m) {
  1704. var overflow;
  1705. var a = m._a;
  1706. if (a && getParsingFlags(m).overflow === -2) {
  1707. overflow =
  1708. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  1709. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  1710. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  1711. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  1712. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  1713. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  1714. -1;
  1715. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  1716. overflow = DATE;
  1717. }
  1718. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  1719. overflow = WEEK;
  1720. }
  1721. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  1722. overflow = WEEKDAY;
  1723. }
  1724. getParsingFlags(m).overflow = overflow;
  1725. }
  1726. return m;
  1727. }
  1728. // iso 8601 regex
  1729. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  1730. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1731. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1732. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  1733. var isoDates = [
  1734. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  1735. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  1736. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  1737. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  1738. ['YYYY-DDD', /\d{4}-\d{3}/],
  1739. ['YYYY-MM', /\d{4}-\d\d/, false],
  1740. ['YYYYYYMMDD', /[+-]\d{10}/],
  1741. ['YYYYMMDD', /\d{8}/],
  1742. // YYYYMM is NOT allowed by the standard
  1743. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  1744. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  1745. ['YYYYDDD', /\d{7}/]
  1746. ];
  1747. // iso time formats and regexes
  1748. var isoTimes = [
  1749. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  1750. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  1751. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  1752. ['HH:mm', /\d\d:\d\d/],
  1753. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  1754. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  1755. ['HHmmss', /\d\d\d\d\d\d/],
  1756. ['HHmm', /\d\d\d\d/],
  1757. ['HH', /\d\d/]
  1758. ];
  1759. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  1760. // date from iso format
  1761. function configFromISO(config) {
  1762. var i, l,
  1763. string = config._i,
  1764. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  1765. allowTime, dateFormat, timeFormat, tzFormat;
  1766. if (match) {
  1767. getParsingFlags(config).iso = true;
  1768. for (i = 0, l = isoDates.length; i < l; i++) {
  1769. if (isoDates[i][1].exec(match[1])) {
  1770. dateFormat = isoDates[i][0];
  1771. allowTime = isoDates[i][2] !== false;
  1772. break;
  1773. }
  1774. }
  1775. if (dateFormat == null) {
  1776. config._isValid = false;
  1777. return;
  1778. }
  1779. if (match[3]) {
  1780. for (i = 0, l = isoTimes.length; i < l; i++) {
  1781. if (isoTimes[i][1].exec(match[3])) {
  1782. // match[2] should be 'T' or space
  1783. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  1784. break;
  1785. }
  1786. }
  1787. if (timeFormat == null) {
  1788. config._isValid = false;
  1789. return;
  1790. }
  1791. }
  1792. if (!allowTime && timeFormat != null) {
  1793. config._isValid = false;
  1794. return;
  1795. }
  1796. if (match[4]) {
  1797. if (tzRegex.exec(match[4])) {
  1798. tzFormat = 'Z';
  1799. } else {
  1800. config._isValid = false;
  1801. return;
  1802. }
  1803. }
  1804. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  1805. configFromStringAndFormat(config);
  1806. } else {
  1807. config._isValid = false;
  1808. }
  1809. }
  1810. // date from iso format or fallback
  1811. function configFromString(config) {
  1812. var matched = aspNetJsonRegex.exec(config._i);
  1813. if (matched !== null) {
  1814. config._d = new Date(+matched[1]);
  1815. return;
  1816. }
  1817. configFromISO(config);
  1818. if (config._isValid === false) {
  1819. delete config._isValid;
  1820. hooks.createFromInputFallback(config);
  1821. }
  1822. }
  1823. hooks.createFromInputFallback = deprecate(
  1824. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  1825. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  1826. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  1827. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  1828. function (config) {
  1829. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  1830. }
  1831. );
  1832. // Pick the first defined of two or three arguments.
  1833. function defaults(a, b, c) {
  1834. if (a != null) {
  1835. return a;
  1836. }
  1837. if (b != null) {
  1838. return b;
  1839. }
  1840. return c;
  1841. }
  1842. function currentDateArray(config) {
  1843. // hooks is actually the exported moment object
  1844. var nowValue = new Date(hooks.now());
  1845. if (config._useUTC) {
  1846. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  1847. }
  1848. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  1849. }
  1850. // convert an array to a date.
  1851. // the array should mirror the parameters below
  1852. // note: all values past the year are optional and will default to the lowest possible value.
  1853. // [year, month, day , hour, minute, second, millisecond]
  1854. function configFromArray (config) {
  1855. var i, date, input = [], currentDate, yearToUse;
  1856. if (config._d) {
  1857. return;
  1858. }
  1859. currentDate = currentDateArray(config);
  1860. //compute day of the year from weeks and weekdays
  1861. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  1862. dayOfYearFromWeekInfo(config);
  1863. }
  1864. //if the day of the year is set, figure out what it is
  1865. if (config._dayOfYear) {
  1866. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  1867. if (config._dayOfYear > daysInYear(yearToUse)) {
  1868. getParsingFlags(config)._overflowDayOfYear = true;
  1869. }
  1870. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  1871. config._a[MONTH] = date.getUTCMonth();
  1872. config._a[DATE] = date.getUTCDate();
  1873. }
  1874. // Default to current date.
  1875. // * if no year, month, day of month are given, default to today
  1876. // * if day of month is given, default month and year
  1877. // * if month is given, default only year
  1878. // * if year is given, don't default anything
  1879. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  1880. config._a[i] = input[i] = currentDate[i];
  1881. }
  1882. // Zero out whatever was not defaulted, including time
  1883. for (; i < 7; i++) {
  1884. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  1885. }
  1886. // Check for 24:00:00.000
  1887. if (config._a[HOUR] === 24 &&
  1888. config._a[MINUTE] === 0 &&
  1889. config._a[SECOND] === 0 &&
  1890. config._a[MILLISECOND] === 0) {
  1891. config._nextDay = true;
  1892. config._a[HOUR] = 0;
  1893. }
  1894. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  1895. // Apply timezone offset from input. The actual utcOffset can be changed
  1896. // with parseZone.
  1897. if (config._tzm != null) {
  1898. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  1899. }
  1900. if (config._nextDay) {
  1901. config._a[HOUR] = 24;
  1902. }
  1903. }
  1904. function dayOfYearFromWeekInfo(config) {
  1905. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  1906. w = config._w;
  1907. if (w.GG != null || w.W != null || w.E != null) {
  1908. dow = 1;
  1909. doy = 4;
  1910. // TODO: We need to take the current isoWeekYear, but that depends on
  1911. // how we interpret now (local, utc, fixed offset). So create
  1912. // a now version of current config (take local/utc/offset flags, and
  1913. // create now).
  1914. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
  1915. week = defaults(w.W, 1);
  1916. weekday = defaults(w.E, 1);
  1917. if (weekday < 1 || weekday > 7) {
  1918. weekdayOverflow = true;
  1919. }
  1920. } else {
  1921. dow = config._locale._week.dow;
  1922. doy = config._locale._week.doy;
  1923. var curWeek = weekOfYear(createLocal(), dow, doy);
  1924. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  1925. // Default to current week.
  1926. week = defaults(w.w, curWeek.week);
  1927. if (w.d != null) {
  1928. // weekday -- low day numbers are considered next week
  1929. weekday = w.d;
  1930. if (weekday < 0 || weekday > 6) {
  1931. weekdayOverflow = true;
  1932. }
  1933. } else if (w.e != null) {
  1934. // local weekday -- counting starts from begining of week
  1935. weekday = w.e + dow;
  1936. if (w.e < 0 || w.e > 6) {
  1937. weekdayOverflow = true;
  1938. }
  1939. } else {
  1940. // default to begining of week
  1941. weekday = dow;
  1942. }
  1943. }
  1944. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  1945. getParsingFlags(config)._overflowWeeks = true;
  1946. } else if (weekdayOverflow != null) {
  1947. getParsingFlags(config)._overflowWeekday = true;
  1948. } else {
  1949. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  1950. config._a[YEAR] = temp.year;
  1951. config._dayOfYear = temp.dayOfYear;
  1952. }
  1953. }
  1954. // constant that refers to the ISO standard
  1955. hooks.ISO_8601 = function () {};
  1956. // date from string and format string
  1957. function configFromStringAndFormat(config) {
  1958. // TODO: Move this to another part of the creation flow to prevent circular deps
  1959. if (config._f === hooks.ISO_8601) {
  1960. configFromISO(config);
  1961. return;
  1962. }
  1963. config._a = [];
  1964. getParsingFlags(config).empty = true;
  1965. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  1966. var string = '' + config._i,
  1967. i, parsedInput, tokens, token, skipped,
  1968. stringLength = string.length,
  1969. totalParsedInputLength = 0;
  1970. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  1971. for (i = 0; i < tokens.length; i++) {
  1972. token = tokens[i];
  1973. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  1974. // console.log('token', token, 'parsedInput', parsedInput,
  1975. // 'regex', getParseRegexForToken(token, config));
  1976. if (parsedInput) {
  1977. skipped = string.substr(0, string.indexOf(parsedInput));
  1978. if (skipped.length > 0) {
  1979. getParsingFlags(config).unusedInput.push(skipped);
  1980. }
  1981. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  1982. totalParsedInputLength += parsedInput.length;
  1983. }
  1984. // don't parse if it's not a known token
  1985. if (formatTokenFunctions[token]) {
  1986. if (parsedInput) {
  1987. getParsingFlags(config).empty = false;
  1988. }
  1989. else {
  1990. getParsingFlags(config).unusedTokens.push(token);
  1991. }
  1992. addTimeToArrayFromToken(token, parsedInput, config);
  1993. }
  1994. else if (config._strict && !parsedInput) {
  1995. getParsingFlags(config).unusedTokens.push(token);
  1996. }
  1997. }
  1998. // add remaining unparsed input length to the string
  1999. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  2000. if (string.length > 0) {
  2001. getParsingFlags(config).unusedInput.push(string);
  2002. }
  2003. // clear _12h flag if hour is <= 12
  2004. if (config._a[HOUR] <= 12 &&
  2005. getParsingFlags(config).bigHour === true &&
  2006. config._a[HOUR] > 0) {
  2007. getParsingFlags(config).bigHour = undefined;
  2008. }
  2009. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  2010. getParsingFlags(config).meridiem = config._meridiem;
  2011. // handle meridiem
  2012. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  2013. configFromArray(config);
  2014. checkOverflow(config);
  2015. }
  2016. function meridiemFixWrap (locale, hour, meridiem) {
  2017. var isPm;
  2018. if (meridiem == null) {
  2019. // nothing to do
  2020. return hour;
  2021. }
  2022. if (locale.meridiemHour != null) {
  2023. return locale.meridiemHour(hour, meridiem);
  2024. } else if (locale.isPM != null) {
  2025. // Fallback
  2026. isPm = locale.isPM(meridiem);
  2027. if (isPm && hour < 12) {
  2028. hour += 12;
  2029. }
  2030. if (!isPm && hour === 12) {
  2031. hour = 0;
  2032. }
  2033. return hour;
  2034. } else {
  2035. // this is not supposed to happen
  2036. return hour;
  2037. }
  2038. }
  2039. // date from string and array of format strings
  2040. function configFromStringAndArray(config) {
  2041. var tempConfig,
  2042. bestMoment,
  2043. scoreToBeat,
  2044. i,
  2045. currentScore;
  2046. if (config._f.length === 0) {
  2047. getParsingFlags(config).invalidFormat = true;
  2048. config._d = new Date(NaN);
  2049. return;
  2050. }
  2051. for (i = 0; i < config._f.length; i++) {
  2052. currentScore = 0;
  2053. tempConfig = copyConfig({}, config);
  2054. if (config._useUTC != null) {
  2055. tempConfig._useUTC = config._useUTC;
  2056. }
  2057. tempConfig._f = config._f[i];
  2058. configFromStringAndFormat(tempConfig);
  2059. if (!isValid(tempConfig)) {
  2060. continue;
  2061. }
  2062. // if there is any input that was not parsed add a penalty for that format
  2063. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  2064. //or tokens
  2065. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  2066. getParsingFlags(tempConfig).score = currentScore;
  2067. if (scoreToBeat == null || currentScore < scoreToBeat) {
  2068. scoreToBeat = currentScore;
  2069. bestMoment = tempConfig;
  2070. }
  2071. }
  2072. extend(config, bestMoment || tempConfig);
  2073. }
  2074. function configFromObject(config) {
  2075. if (config._d) {
  2076. return;
  2077. }
  2078. var i = normalizeObjectUnits(config._i);
  2079. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  2080. return obj && parseInt(obj, 10);
  2081. });
  2082. configFromArray(config);
  2083. }
  2084. function createFromConfig (config) {
  2085. var res = new Moment(checkOverflow(prepareConfig(config)));
  2086. if (res._nextDay) {
  2087. // Adding is smart enough around DST
  2088. res.add(1, 'd');
  2089. res._nextDay = undefined;
  2090. }
  2091. return res;
  2092. }
  2093. function prepareConfig (config) {
  2094. var input = config._i,
  2095. format = config._f;
  2096. config._locale = config._locale || getLocale(config._l);
  2097. if (input === null || (format === undefined && input === '')) {
  2098. return createInvalid({nullInput: true});
  2099. }
  2100. if (typeof input === 'string') {
  2101. config._i = input = config._locale.preparse(input);
  2102. }
  2103. if (isMoment(input)) {
  2104. return new Moment(checkOverflow(input));
  2105. } else if (isDate(input)) {
  2106. config._d = input;
  2107. } else if (isArray(format)) {
  2108. configFromStringAndArray(config);
  2109. } else if (format) {
  2110. configFromStringAndFormat(config);
  2111. } else {
  2112. configFromInput(config);
  2113. }
  2114. if (!isValid(config)) {
  2115. config._d = null;
  2116. }
  2117. return config;
  2118. }
  2119. function configFromInput(config) {
  2120. var input = config._i;
  2121. if (input === undefined) {
  2122. config._d = new Date(hooks.now());
  2123. } else if (isDate(input)) {
  2124. config._d = new Date(input.valueOf());
  2125. } else if (typeof input === 'string') {
  2126. configFromString(config);
  2127. } else if (isArray(input)) {
  2128. config._a = map(input.slice(0), function (obj) {
  2129. return parseInt(obj, 10);
  2130. });
  2131. configFromArray(config);
  2132. } else if (typeof(input) === 'object') {
  2133. configFromObject(config);
  2134. } else if (isNumber(input)) {
  2135. // from milliseconds
  2136. config._d = new Date(input);
  2137. } else {
  2138. hooks.createFromInputFallback(config);
  2139. }
  2140. }
  2141. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  2142. var c = {};
  2143. if (locale === true || locale === false) {
  2144. strict = locale;
  2145. locale = undefined;
  2146. }
  2147. if ((isObject(input) && isObjectEmpty(input)) ||
  2148. (isArray(input) && input.length === 0)) {
  2149. input = undefined;
  2150. }
  2151. // object construction must be done this way.
  2152. // https://github.com/moment/moment/issues/1423
  2153. c._isAMomentObject = true;
  2154. c._useUTC = c._isUTC = isUTC;
  2155. c._l = locale;
  2156. c._i = input;
  2157. c._f = format;
  2158. c._strict = strict;
  2159. return createFromConfig(c);
  2160. }
  2161. function createLocal (input, format, locale, strict) {
  2162. return createLocalOrUTC(input, format, locale, strict, false);
  2163. }
  2164. var prototypeMin = deprecate(
  2165. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  2166. function () {
  2167. var other = createLocal.apply(null, arguments);
  2168. if (this.isValid() && other.isValid()) {
  2169. return other < this ? this : other;
  2170. } else {
  2171. return createInvalid();
  2172. }
  2173. }
  2174. );
  2175. var prototypeMax = deprecate(
  2176. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  2177. function () {
  2178. var other = createLocal.apply(null, arguments);
  2179. if (this.isValid() && other.isValid()) {
  2180. return other > this ? this : other;
  2181. } else {
  2182. return createInvalid();
  2183. }
  2184. }
  2185. );
  2186. // Pick a moment m from moments so that m[fn](other) is true for all
  2187. // other. This relies on the function fn to be transitive.
  2188. //
  2189. // moments should either be an array of moment objects or an array, whose
  2190. // first element is an array of moment objects.
  2191. function pickBy(fn, moments) {
  2192. var res, i;
  2193. if (moments.length === 1 && isArray(moments[0])) {
  2194. moments = moments[0];
  2195. }
  2196. if (!moments.length) {
  2197. return createLocal();
  2198. }
  2199. res = moments[0];
  2200. for (i = 1; i < moments.length; ++i) {
  2201. if (!moments[i].isValid() || moments[i][fn](res)) {
  2202. res = moments[i];
  2203. }
  2204. }
  2205. return res;
  2206. }
  2207. // TODO: Use [].sort instead?
  2208. function min () {
  2209. var args = [].slice.call(arguments, 0);
  2210. return pickBy('isBefore', args);
  2211. }
  2212. function max () {
  2213. var args = [].slice.call(arguments, 0);
  2214. return pickBy('isAfter', args);
  2215. }
  2216. var now = function () {
  2217. return Date.now ? Date.now() : +(new Date());
  2218. };
  2219. function Duration (duration) {
  2220. var normalizedInput = normalizeObjectUnits(duration),
  2221. years = normalizedInput.year || 0,
  2222. quarters = normalizedInput.quarter || 0,
  2223. months = normalizedInput.month || 0,
  2224. weeks = normalizedInput.week || 0,
  2225. days = normalizedInput.day || 0,
  2226. hours = normalizedInput.hour || 0,
  2227. minutes = normalizedInput.minute || 0,
  2228. seconds = normalizedInput.second || 0,
  2229. milliseconds = normalizedInput.millisecond || 0;
  2230. // representation for dateAddRemove
  2231. this._milliseconds = +milliseconds +
  2232. seconds * 1e3 + // 1000
  2233. minutes * 6e4 + // 1000 * 60
  2234. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  2235. // Because of dateAddRemove treats 24 hours as different from a
  2236. // day when working around DST, we need to store them separately
  2237. this._days = +days +
  2238. weeks * 7;
  2239. // It is impossible translate months into days without knowing
  2240. // which months you are are talking about, so we have to store
  2241. // it separately.
  2242. this._months = +months +
  2243. quarters * 3 +
  2244. years * 12;
  2245. this._data = {};
  2246. this._locale = getLocale();
  2247. this._bubble();
  2248. }
  2249. function isDuration (obj) {
  2250. return obj instanceof Duration;
  2251. }
  2252. function absRound (number) {
  2253. if (number < 0) {
  2254. return Math.round(-1 * number) * -1;
  2255. } else {
  2256. return Math.round(number);
  2257. }
  2258. }
  2259. // FORMATTING
  2260. function offset (token, separator) {
  2261. addFormatToken(token, 0, 0, function () {
  2262. var offset = this.utcOffset();
  2263. var sign = '+';
  2264. if (offset < 0) {
  2265. offset = -offset;
  2266. sign = '-';
  2267. }
  2268. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  2269. });
  2270. }
  2271. offset('Z', ':');
  2272. offset('ZZ', '');
  2273. // PARSING
  2274. addRegexToken('Z', matchShortOffset);
  2275. addRegexToken('ZZ', matchShortOffset);
  2276. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  2277. config._useUTC = true;
  2278. config._tzm = offsetFromString(matchShortOffset, input);
  2279. });
  2280. // HELPERS
  2281. // timezone chunker
  2282. // '+10:00' > ['10', '00']
  2283. // '-1530' > ['-15', '30']
  2284. var chunkOffset = /([\+\-]|\d\d)/gi;
  2285. function offsetFromString(matcher, string) {
  2286. var matches = (string || '').match(matcher);
  2287. if (matches === null) {
  2288. return null;
  2289. }
  2290. var chunk = matches[matches.length - 1] || [];
  2291. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  2292. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  2293. return minutes === 0 ?
  2294. 0 :
  2295. parts[0] === '+' ? minutes : -minutes;
  2296. }
  2297. // Return a moment from input, that is local/utc/zone equivalent to model.
  2298. function cloneWithOffset(input, model) {
  2299. var res, diff;
  2300. if (model._isUTC) {
  2301. res = model.clone();
  2302. diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  2303. // Use low-level api, because this fn is low-level api.
  2304. res._d.setTime(res._d.valueOf() + diff);
  2305. hooks.updateOffset(res, false);
  2306. return res;
  2307. } else {
  2308. return createLocal(input).local();
  2309. }
  2310. }
  2311. function getDateOffset (m) {
  2312. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  2313. // https://github.com/moment/moment/pull/1871
  2314. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  2315. }
  2316. // HOOKS
  2317. // This function will be called whenever a moment is mutated.
  2318. // It is intended to keep the offset in sync with the timezone.
  2319. hooks.updateOffset = function () {};
  2320. // MOMENTS
  2321. // keepLocalTime = true means only change the timezone, without
  2322. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  2323. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  2324. // +0200, so we adjust the time as needed, to be valid.
  2325. //
  2326. // Keeping the time actually adds/subtracts (one hour)
  2327. // from the actual represented time. That is why we call updateOffset
  2328. // a second time. In case it wants us to change the offset again
  2329. // _changeInProgress == true case, then we have to adjust, because
  2330. // there is no such time in the given timezone.
  2331. function getSetOffset (input, keepLocalTime) {
  2332. var offset = this._offset || 0,
  2333. localAdjust;
  2334. if (!this.isValid()) {
  2335. return input != null ? this : NaN;
  2336. }
  2337. if (input != null) {
  2338. if (typeof input === 'string') {
  2339. input = offsetFromString(matchShortOffset, input);
  2340. if (input === null) {
  2341. return this;
  2342. }
  2343. } else if (Math.abs(input) < 16) {
  2344. input = input * 60;
  2345. }
  2346. if (!this._isUTC && keepLocalTime) {
  2347. localAdjust = getDateOffset(this);
  2348. }
  2349. this._offset = input;
  2350. this._isUTC = true;
  2351. if (localAdjust != null) {
  2352. this.add(localAdjust, 'm');
  2353. }
  2354. if (offset !== input) {
  2355. if (!keepLocalTime || this._changeInProgress) {
  2356. addSubtract(this, createDuration(input - offset, 'm'), 1, false);
  2357. } else if (!this._changeInProgress) {
  2358. this._changeInProgress = true;
  2359. hooks.updateOffset(this, true);
  2360. this._changeInProgress = null;
  2361. }
  2362. }
  2363. return this;
  2364. } else {
  2365. return this._isUTC ? offset : getDateOffset(this);
  2366. }
  2367. }
  2368. function getSetZone (input, keepLocalTime) {
  2369. if (input != null) {
  2370. if (typeof input !== 'string') {
  2371. input = -input;
  2372. }
  2373. this.utcOffset(input, keepLocalTime);
  2374. return this;
  2375. } else {
  2376. return -this.utcOffset();
  2377. }
  2378. }
  2379. function setOffsetToUTC (keepLocalTime) {
  2380. return this.utcOffset(0, keepLocalTime);
  2381. }
  2382. function setOffsetToLocal (keepLocalTime) {
  2383. if (this._isUTC) {
  2384. this.utcOffset(0, keepLocalTime);
  2385. this._isUTC = false;
  2386. if (keepLocalTime) {
  2387. this.subtract(getDateOffset(this), 'm');
  2388. }
  2389. }
  2390. return this;
  2391. }
  2392. function setOffsetToParsedOffset () {
  2393. if (this._tzm != null) {
  2394. this.utcOffset(this._tzm);
  2395. } else if (typeof this._i === 'string') {
  2396. var tZone = offsetFromString(matchOffset, this._i);
  2397. if (tZone != null) {
  2398. this.utcOffset(tZone);
  2399. }
  2400. else {
  2401. this.utcOffset(0, true);
  2402. }
  2403. }
  2404. return this;
  2405. }
  2406. function hasAlignedHourOffset (input) {
  2407. if (!this.isValid()) {
  2408. return false;
  2409. }
  2410. input = input ? createLocal(input).utcOffset() : 0;
  2411. return (this.utcOffset() - input) % 60 === 0;
  2412. }
  2413. function isDaylightSavingTime () {
  2414. return (
  2415. this.utcOffset() > this.clone().month(0).utcOffset() ||
  2416. this.utcOffset() > this.clone().month(5).utcOffset()
  2417. );
  2418. }
  2419. function isDaylightSavingTimeShifted () {
  2420. if (!isUndefined(this._isDSTShifted)) {
  2421. return this._isDSTShifted;
  2422. }
  2423. var c = {};
  2424. copyConfig(c, this);
  2425. c = prepareConfig(c);
  2426. if (c._a) {
  2427. var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  2428. this._isDSTShifted = this.isValid() &&
  2429. compareArrays(c._a, other.toArray()) > 0;
  2430. } else {
  2431. this._isDSTShifted = false;
  2432. }
  2433. return this._isDSTShifted;
  2434. }
  2435. function isLocal () {
  2436. return this.isValid() ? !this._isUTC : false;
  2437. }
  2438. function isUtcOffset () {
  2439. return this.isValid() ? this._isUTC : false;
  2440. }
  2441. function isUtc () {
  2442. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  2443. }
  2444. // ASP.NET json date format regex
  2445. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  2446. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  2447. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  2448. // and further modified to allow for strings containing both week and day
  2449. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  2450. function createDuration (input, key) {
  2451. var duration = input,
  2452. // matching against regexp is expensive, do it on demand
  2453. match = null,
  2454. sign,
  2455. ret,
  2456. diffRes;
  2457. if (isDuration(input)) {
  2458. duration = {
  2459. ms : input._milliseconds,
  2460. d : input._days,
  2461. M : input._months
  2462. };
  2463. } else if (isNumber(input)) {
  2464. duration = {};
  2465. if (key) {
  2466. duration[key] = input;
  2467. } else {
  2468. duration.milliseconds = input;
  2469. }
  2470. } else if (!!(match = aspNetRegex.exec(input))) {
  2471. sign = (match[1] === '-') ? -1 : 1;
  2472. duration = {
  2473. y : 0,
  2474. d : toInt(match[DATE]) * sign,
  2475. h : toInt(match[HOUR]) * sign,
  2476. m : toInt(match[MINUTE]) * sign,
  2477. s : toInt(match[SECOND]) * sign,
  2478. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  2479. };
  2480. } else if (!!(match = isoRegex.exec(input))) {
  2481. sign = (match[1] === '-') ? -1 : 1;
  2482. duration = {
  2483. y : parseIso(match[2], sign),
  2484. M : parseIso(match[3], sign),
  2485. w : parseIso(match[4], sign),
  2486. d : parseIso(match[5], sign),
  2487. h : parseIso(match[6], sign),
  2488. m : parseIso(match[7], sign),
  2489. s : parseIso(match[8], sign)
  2490. };
  2491. } else if (duration == null) {// checks for null or undefined
  2492. duration = {};
  2493. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  2494. diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
  2495. duration = {};
  2496. duration.ms = diffRes.milliseconds;
  2497. duration.M = diffRes.months;
  2498. }
  2499. ret = new Duration(duration);
  2500. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  2501. ret._locale = input._locale;
  2502. }
  2503. return ret;
  2504. }
  2505. createDuration.fn = Duration.prototype;
  2506. function parseIso (inp, sign) {
  2507. // We'd normally use ~~inp for this, but unfortunately it also
  2508. // converts floats to ints.
  2509. // inp may be undefined, so careful calling replace on it.
  2510. var res = inp && parseFloat(inp.replace(',', '.'));
  2511. // apply sign while we're at it
  2512. return (isNaN(res) ? 0 : res) * sign;
  2513. }
  2514. function positiveMomentsDifference(base, other) {
  2515. var res = {milliseconds: 0, months: 0};
  2516. res.months = other.month() - base.month() +
  2517. (other.year() - base.year()) * 12;
  2518. if (base.clone().add(res.months, 'M').isAfter(other)) {
  2519. --res.months;
  2520. }
  2521. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  2522. return res;
  2523. }
  2524. function momentsDifference(base, other) {
  2525. var res;
  2526. if (!(base.isValid() && other.isValid())) {
  2527. return {milliseconds: 0, months: 0};
  2528. }
  2529. other = cloneWithOffset(other, base);
  2530. if (base.isBefore(other)) {
  2531. res = positiveMomentsDifference(base, other);
  2532. } else {
  2533. res = positiveMomentsDifference(other, base);
  2534. res.milliseconds = -res.milliseconds;
  2535. res.months = -res.months;
  2536. }
  2537. return res;
  2538. }
  2539. // TODO: remove 'name' arg after deprecation is removed
  2540. function createAdder(direction, name) {
  2541. return function (val, period) {
  2542. var dur, tmp;
  2543. //invert the arguments, but complain about it
  2544. if (period !== null && !isNaN(+period)) {
  2545. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  2546. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  2547. tmp = val; val = period; period = tmp;
  2548. }
  2549. val = typeof val === 'string' ? +val : val;
  2550. dur = createDuration(val, period);
  2551. addSubtract(this, dur, direction);
  2552. return this;
  2553. };
  2554. }
  2555. function addSubtract (mom, duration, isAdding, updateOffset) {
  2556. var milliseconds = duration._milliseconds,
  2557. days = absRound(duration._days),
  2558. months = absRound(duration._months);
  2559. if (!mom.isValid()) {
  2560. // No op
  2561. return;
  2562. }
  2563. updateOffset = updateOffset == null ? true : updateOffset;
  2564. if (milliseconds) {
  2565. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  2566. }
  2567. if (days) {
  2568. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  2569. }
  2570. if (months) {
  2571. setMonth(mom, get(mom, 'Month') + months * isAdding);
  2572. }
  2573. if (updateOffset) {
  2574. hooks.updateOffset(mom, days || months);
  2575. }
  2576. }
  2577. var add = createAdder(1, 'add');
  2578. var subtract = createAdder(-1, 'subtract');
  2579. function getCalendarFormat(myMoment, now) {
  2580. var diff = myMoment.diff(now, 'days', true);
  2581. return diff < -6 ? 'sameElse' :
  2582. diff < -1 ? 'lastWeek' :
  2583. diff < 0 ? 'lastDay' :
  2584. diff < 1 ? 'sameDay' :
  2585. diff < 2 ? 'nextDay' :
  2586. diff < 7 ? 'nextWeek' : 'sameElse';
  2587. }
  2588. function calendar$1 (time, formats) {
  2589. // We want to compare the start of today, vs this.
  2590. // Getting start-of-today depends on whether we're local/utc/offset or not.
  2591. var now = time || createLocal(),
  2592. sod = cloneWithOffset(now, this).startOf('day'),
  2593. format = hooks.calendarFormat(this, sod) || 'sameElse';
  2594. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  2595. return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  2596. }
  2597. function clone () {
  2598. return new Moment(this);
  2599. }
  2600. function isAfter (input, units) {
  2601. var localInput = isMoment(input) ? input : createLocal(input);
  2602. if (!(this.isValid() && localInput.isValid())) {
  2603. return false;
  2604. }
  2605. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2606. if (units === 'millisecond') {
  2607. return this.valueOf() > localInput.valueOf();
  2608. } else {
  2609. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  2610. }
  2611. }
  2612. function isBefore (input, units) {
  2613. var localInput = isMoment(input) ? input : createLocal(input);
  2614. if (!(this.isValid() && localInput.isValid())) {
  2615. return false;
  2616. }
  2617. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2618. if (units === 'millisecond') {
  2619. return this.valueOf() < localInput.valueOf();
  2620. } else {
  2621. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  2622. }
  2623. }
  2624. function isBetween (from, to, units, inclusivity) {
  2625. inclusivity = inclusivity || '()';
  2626. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  2627. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  2628. }
  2629. function isSame (input, units) {
  2630. var localInput = isMoment(input) ? input : createLocal(input),
  2631. inputMs;
  2632. if (!(this.isValid() && localInput.isValid())) {
  2633. return false;
  2634. }
  2635. units = normalizeUnits(units || 'millisecond');
  2636. if (units === 'millisecond') {
  2637. return this.valueOf() === localInput.valueOf();
  2638. } else {
  2639. inputMs = localInput.valueOf();
  2640. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  2641. }
  2642. }
  2643. function isSameOrAfter (input, units) {
  2644. return this.isSame(input, units) || this.isAfter(input,units);
  2645. }
  2646. function isSameOrBefore (input, units) {
  2647. return this.isSame(input, units) || this.isBefore(input,units);
  2648. }
  2649. function diff (input, units, asFloat) {
  2650. var that,
  2651. zoneDelta,
  2652. delta, output;
  2653. if (!this.isValid()) {
  2654. return NaN;
  2655. }
  2656. that = cloneWithOffset(input, this);
  2657. if (!that.isValid()) {
  2658. return NaN;
  2659. }
  2660. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  2661. units = normalizeUnits(units);
  2662. if (units === 'year' || units === 'month' || units === 'quarter') {
  2663. output = monthDiff(this, that);
  2664. if (units === 'quarter') {
  2665. output = output / 3;
  2666. } else if (units === 'year') {
  2667. output = output / 12;
  2668. }
  2669. } else {
  2670. delta = this - that;
  2671. output = units === 'second' ? delta / 1e3 : // 1000
  2672. units === 'minute' ? delta / 6e4 : // 1000 * 60
  2673. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  2674. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  2675. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  2676. delta;
  2677. }
  2678. return asFloat ? output : absFloor(output);
  2679. }
  2680. function monthDiff (a, b) {
  2681. // difference in months
  2682. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  2683. // b is in (anchor - 1 month, anchor + 1 month)
  2684. anchor = a.clone().add(wholeMonthDiff, 'months'),
  2685. anchor2, adjust;
  2686. if (b - anchor < 0) {
  2687. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  2688. // linear across the month
  2689. adjust = (b - anchor) / (anchor - anchor2);
  2690. } else {
  2691. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  2692. // linear across the month
  2693. adjust = (b - anchor) / (anchor2 - anchor);
  2694. }
  2695. //check for negative zero, return zero if negative zero
  2696. return -(wholeMonthDiff + adjust) || 0;
  2697. }
  2698. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  2699. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  2700. function toString () {
  2701. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  2702. }
  2703. function toISOString () {
  2704. var m = this.clone().utc();
  2705. if (0 < m.year() && m.year() <= 9999) {
  2706. if (isFunction(Date.prototype.toISOString)) {
  2707. // native implementation is ~50x faster, use it when we can
  2708. return this.toDate().toISOString();
  2709. } else {
  2710. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2711. }
  2712. } else {
  2713. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2714. }
  2715. }
  2716. /**
  2717. * Return a human readable representation of a moment that can
  2718. * also be evaluated to get a new moment which is the same
  2719. *
  2720. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  2721. */
  2722. function inspect () {
  2723. if (!this.isValid()) {
  2724. return 'moment.invalid(/* ' + this._i + ' */)';
  2725. }
  2726. var func = 'moment';
  2727. var zone = '';
  2728. if (!this.isLocal()) {
  2729. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  2730. zone = 'Z';
  2731. }
  2732. var prefix = '[' + func + '("]';
  2733. var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
  2734. var datetime = '-MM-DD[T]HH:mm:ss.SSS';
  2735. var suffix = zone + '[")]';
  2736. return this.format(prefix + year + datetime + suffix);
  2737. }
  2738. function format (inputString) {
  2739. if (!inputString) {
  2740. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  2741. }
  2742. var output = formatMoment(this, inputString);
  2743. return this.localeData().postformat(output);
  2744. }
  2745. function from (time, withoutSuffix) {
  2746. if (this.isValid() &&
  2747. ((isMoment(time) && time.isValid()) ||
  2748. createLocal(time).isValid())) {
  2749. return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  2750. } else {
  2751. return this.localeData().invalidDate();
  2752. }
  2753. }
  2754. function fromNow (withoutSuffix) {
  2755. return this.from(createLocal(), withoutSuffix);
  2756. }
  2757. function to (time, withoutSuffix) {
  2758. if (this.isValid() &&
  2759. ((isMoment(time) && time.isValid()) ||
  2760. createLocal(time).isValid())) {
  2761. return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  2762. } else {
  2763. return this.localeData().invalidDate();
  2764. }
  2765. }
  2766. function toNow (withoutSuffix) {
  2767. return this.to(createLocal(), withoutSuffix);
  2768. }
  2769. // If passed a locale key, it will set the locale for this
  2770. // instance. Otherwise, it will return the locale configuration
  2771. // variables for this instance.
  2772. function locale (key) {
  2773. var newLocaleData;
  2774. if (key === undefined) {
  2775. return this._locale._abbr;
  2776. } else {
  2777. newLocaleData = getLocale(key);
  2778. if (newLocaleData != null) {
  2779. this._locale = newLocaleData;
  2780. }
  2781. return this;
  2782. }
  2783. }
  2784. var lang = deprecate(
  2785. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  2786. function (key) {
  2787. if (key === undefined) {
  2788. return this.localeData();
  2789. } else {
  2790. return this.locale(key);
  2791. }
  2792. }
  2793. );
  2794. function localeData () {
  2795. return this._locale;
  2796. }
  2797. function startOf (units) {
  2798. units = normalizeUnits(units);
  2799. // the following switch intentionally omits break keywords
  2800. // to utilize falling through the cases.
  2801. switch (units) {
  2802. case 'year':
  2803. this.month(0);
  2804. /* falls through */
  2805. case 'quarter':
  2806. case 'month':
  2807. this.date(1);
  2808. /* falls through */
  2809. case 'week':
  2810. case 'isoWeek':
  2811. case 'day':
  2812. case 'date':
  2813. this.hours(0);
  2814. /* falls through */
  2815. case 'hour':
  2816. this.minutes(0);
  2817. /* falls through */
  2818. case 'minute':
  2819. this.seconds(0);
  2820. /* falls through */
  2821. case 'second':
  2822. this.milliseconds(0);
  2823. }
  2824. // weeks are a special case
  2825. if (units === 'week') {
  2826. this.weekday(0);
  2827. }
  2828. if (units === 'isoWeek') {
  2829. this.isoWeekday(1);
  2830. }
  2831. // quarters are also special
  2832. if (units === 'quarter') {
  2833. this.month(Math.floor(this.month() / 3) * 3);
  2834. }
  2835. return this;
  2836. }
  2837. function endOf (units) {
  2838. units = normalizeUnits(units);
  2839. if (units === undefined || units === 'millisecond') {
  2840. return this;
  2841. }
  2842. // 'date' is an alias for 'day', so it should be considered as such.
  2843. if (units === 'date') {
  2844. units = 'day';
  2845. }
  2846. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  2847. }
  2848. function valueOf () {
  2849. return this._d.valueOf() - ((this._offset || 0) * 60000);
  2850. }
  2851. function unix () {
  2852. return Math.floor(this.valueOf() / 1000);
  2853. }
  2854. function toDate () {
  2855. return new Date(this.valueOf());
  2856. }
  2857. function toArray () {
  2858. var m = this;
  2859. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  2860. }
  2861. function toObject () {
  2862. var m = this;
  2863. return {
  2864. years: m.year(),
  2865. months: m.month(),
  2866. date: m.date(),
  2867. hours: m.hours(),
  2868. minutes: m.minutes(),
  2869. seconds: m.seconds(),
  2870. milliseconds: m.milliseconds()
  2871. };
  2872. }
  2873. function toJSON () {
  2874. // new Date(NaN).toJSON() === null
  2875. return this.isValid() ? this.toISOString() : null;
  2876. }
  2877. function isValid$1 () {
  2878. return isValid(this);
  2879. }
  2880. function parsingFlags () {
  2881. return extend({}, getParsingFlags(this));
  2882. }
  2883. function invalidAt () {
  2884. return getParsingFlags(this).overflow;
  2885. }
  2886. function creationData() {
  2887. return {
  2888. input: this._i,
  2889. format: this._f,
  2890. locale: this._locale,
  2891. isUTC: this._isUTC,
  2892. strict: this._strict
  2893. };
  2894. }
  2895. // FORMATTING
  2896. addFormatToken(0, ['gg', 2], 0, function () {
  2897. return this.weekYear() % 100;
  2898. });
  2899. addFormatToken(0, ['GG', 2], 0, function () {
  2900. return this.isoWeekYear() % 100;
  2901. });
  2902. function addWeekYearFormatToken (token, getter) {
  2903. addFormatToken(0, [token, token.length], 0, getter);
  2904. }
  2905. addWeekYearFormatToken('gggg', 'weekYear');
  2906. addWeekYearFormatToken('ggggg', 'weekYear');
  2907. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  2908. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  2909. // ALIASES
  2910. addUnitAlias('weekYear', 'gg');
  2911. addUnitAlias('isoWeekYear', 'GG');
  2912. // PRIORITY
  2913. addUnitPriority('weekYear', 1);
  2914. addUnitPriority('isoWeekYear', 1);
  2915. // PARSING
  2916. addRegexToken('G', matchSigned);
  2917. addRegexToken('g', matchSigned);
  2918. addRegexToken('GG', match1to2, match2);
  2919. addRegexToken('gg', match1to2, match2);
  2920. addRegexToken('GGGG', match1to4, match4);
  2921. addRegexToken('gggg', match1to4, match4);
  2922. addRegexToken('GGGGG', match1to6, match6);
  2923. addRegexToken('ggggg', match1to6, match6);
  2924. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  2925. week[token.substr(0, 2)] = toInt(input);
  2926. });
  2927. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  2928. week[token] = hooks.parseTwoDigitYear(input);
  2929. });
  2930. // MOMENTS
  2931. function getSetWeekYear (input) {
  2932. return getSetWeekYearHelper.call(this,
  2933. input,
  2934. this.week(),
  2935. this.weekday(),
  2936. this.localeData()._week.dow,
  2937. this.localeData()._week.doy);
  2938. }
  2939. function getSetISOWeekYear (input) {
  2940. return getSetWeekYearHelper.call(this,
  2941. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  2942. }
  2943. function getISOWeeksInYear () {
  2944. return weeksInYear(this.year(), 1, 4);
  2945. }
  2946. function getWeeksInYear () {
  2947. var weekInfo = this.localeData()._week;
  2948. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  2949. }
  2950. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  2951. var weeksTarget;
  2952. if (input == null) {
  2953. return weekOfYear(this, dow, doy).year;
  2954. } else {
  2955. weeksTarget = weeksInYear(input, dow, doy);
  2956. if (week > weeksTarget) {
  2957. week = weeksTarget;
  2958. }
  2959. return setWeekAll.call(this, input, week, weekday, dow, doy);
  2960. }
  2961. }
  2962. function setWeekAll(weekYear, week, weekday, dow, doy) {
  2963. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  2964. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  2965. this.year(date.getUTCFullYear());
  2966. this.month(date.getUTCMonth());
  2967. this.date(date.getUTCDate());
  2968. return this;
  2969. }
  2970. // FORMATTING
  2971. addFormatToken('Q', 0, 'Qo', 'quarter');
  2972. // ALIASES
  2973. addUnitAlias('quarter', 'Q');
  2974. // PRIORITY
  2975. addUnitPriority('quarter', 7);
  2976. // PARSING
  2977. addRegexToken('Q', match1);
  2978. addParseToken('Q', function (input, array) {
  2979. array[MONTH] = (toInt(input) - 1) * 3;
  2980. });
  2981. // MOMENTS
  2982. function getSetQuarter (input) {
  2983. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  2984. }
  2985. // FORMATTING
  2986. addFormatToken('D', ['DD', 2], 'Do', 'date');
  2987. // ALIASES
  2988. addUnitAlias('date', 'D');
  2989. // PRIOROITY
  2990. addUnitPriority('date', 9);
  2991. // PARSING
  2992. addRegexToken('D', match1to2);
  2993. addRegexToken('DD', match1to2, match2);
  2994. addRegexToken('Do', function (isStrict, locale) {
  2995. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  2996. });
  2997. addParseToken(['D', 'DD'], DATE);
  2998. addParseToken('Do', function (input, array) {
  2999. array[DATE] = toInt(input.match(match1to2)[0], 10);
  3000. });
  3001. // MOMENTS
  3002. var getSetDayOfMonth = makeGetSet('Date', true);
  3003. // FORMATTING
  3004. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  3005. // ALIASES
  3006. addUnitAlias('dayOfYear', 'DDD');
  3007. // PRIORITY
  3008. addUnitPriority('dayOfYear', 4);
  3009. // PARSING
  3010. addRegexToken('DDD', match1to3);
  3011. addRegexToken('DDDD', match3);
  3012. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  3013. config._dayOfYear = toInt(input);
  3014. });
  3015. // HELPERS
  3016. // MOMENTS
  3017. function getSetDayOfYear (input) {
  3018. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  3019. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  3020. }
  3021. // FORMATTING
  3022. addFormatToken('m', ['mm', 2], 0, 'minute');
  3023. // ALIASES
  3024. addUnitAlias('minute', 'm');
  3025. // PRIORITY
  3026. addUnitPriority('minute', 14);
  3027. // PARSING
  3028. addRegexToken('m', match1to2);
  3029. addRegexToken('mm', match1to2, match2);
  3030. addParseToken(['m', 'mm'], MINUTE);
  3031. // MOMENTS
  3032. var getSetMinute = makeGetSet('Minutes', false);
  3033. // FORMATTING
  3034. addFormatToken('s', ['ss', 2], 0, 'second');
  3035. // ALIASES
  3036. addUnitAlias('second', 's');
  3037. // PRIORITY
  3038. addUnitPriority('second', 15);
  3039. // PARSING
  3040. addRegexToken('s', match1to2);
  3041. addRegexToken('ss', match1to2, match2);
  3042. addParseToken(['s', 'ss'], SECOND);
  3043. // MOMENTS
  3044. var getSetSecond = makeGetSet('Seconds', false);
  3045. // FORMATTING
  3046. addFormatToken('S', 0, 0, function () {
  3047. return ~~(this.millisecond() / 100);
  3048. });
  3049. addFormatToken(0, ['SS', 2], 0, function () {
  3050. return ~~(this.millisecond() / 10);
  3051. });
  3052. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  3053. addFormatToken(0, ['SSSS', 4], 0, function () {
  3054. return this.millisecond() * 10;
  3055. });
  3056. addFormatToken(0, ['SSSSS', 5], 0, function () {
  3057. return this.millisecond() * 100;
  3058. });
  3059. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  3060. return this.millisecond() * 1000;
  3061. });
  3062. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  3063. return this.millisecond() * 10000;
  3064. });
  3065. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  3066. return this.millisecond() * 100000;
  3067. });
  3068. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  3069. return this.millisecond() * 1000000;
  3070. });
  3071. // ALIASES
  3072. addUnitAlias('millisecond', 'ms');
  3073. // PRIORITY
  3074. addUnitPriority('millisecond', 16);
  3075. // PARSING
  3076. addRegexToken('S', match1to3, match1);
  3077. addRegexToken('SS', match1to3, match2);
  3078. addRegexToken('SSS', match1to3, match3);
  3079. var token;
  3080. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  3081. addRegexToken(token, matchUnsigned);
  3082. }
  3083. function parseMs(input, array) {
  3084. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  3085. }
  3086. for (token = 'S'; token.length <= 9; token += 'S') {
  3087. addParseToken(token, parseMs);
  3088. }
  3089. // MOMENTS
  3090. var getSetMillisecond = makeGetSet('Milliseconds', false);
  3091. // FORMATTING
  3092. addFormatToken('z', 0, 0, 'zoneAbbr');
  3093. addFormatToken('zz', 0, 0, 'zoneName');
  3094. // MOMENTS
  3095. function getZoneAbbr () {
  3096. return this._isUTC ? 'UTC' : '';
  3097. }
  3098. function getZoneName () {
  3099. return this._isUTC ? 'Coordinated Universal Time' : '';
  3100. }
  3101. var proto = Moment.prototype;
  3102. proto.add = add;
  3103. proto.calendar = calendar$1;
  3104. proto.clone = clone;
  3105. proto.diff = diff;
  3106. proto.endOf = endOf;
  3107. proto.format = format;
  3108. proto.from = from;
  3109. proto.fromNow = fromNow;
  3110. proto.to = to;
  3111. proto.toNow = toNow;
  3112. proto.get = stringGet;
  3113. proto.invalidAt = invalidAt;
  3114. proto.isAfter = isAfter;
  3115. proto.isBefore = isBefore;
  3116. proto.isBetween = isBetween;
  3117. proto.isSame = isSame;
  3118. proto.isSameOrAfter = isSameOrAfter;
  3119. proto.isSameOrBefore = isSameOrBefore;
  3120. proto.isValid = isValid$1;
  3121. proto.lang = lang;
  3122. proto.locale = locale;
  3123. proto.localeData = localeData;
  3124. proto.max = prototypeMax;
  3125. proto.min = prototypeMin;
  3126. proto.parsingFlags = parsingFlags;
  3127. proto.set = stringSet;
  3128. proto.startOf = startOf;
  3129. proto.subtract = subtract;
  3130. proto.toArray = toArray;
  3131. proto.toObject = toObject;
  3132. proto.toDate = toDate;
  3133. proto.toISOString = toISOString;
  3134. proto.inspect = inspect;
  3135. proto.toJSON = toJSON;
  3136. proto.toString = toString;
  3137. proto.unix = unix;
  3138. proto.valueOf = valueOf;
  3139. proto.creationData = creationData;
  3140. // Year
  3141. proto.year = getSetYear;
  3142. proto.isLeapYear = getIsLeapYear;
  3143. // Week Year
  3144. proto.weekYear = getSetWeekYear;
  3145. proto.isoWeekYear = getSetISOWeekYear;
  3146. // Quarter
  3147. proto.quarter = proto.quarters = getSetQuarter;
  3148. // Month
  3149. proto.month = getSetMonth;
  3150. proto.daysInMonth = getDaysInMonth;
  3151. // Week
  3152. proto.week = proto.weeks = getSetWeek;
  3153. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  3154. proto.weeksInYear = getWeeksInYear;
  3155. proto.isoWeeksInYear = getISOWeeksInYear;
  3156. // Day
  3157. proto.date = getSetDayOfMonth;
  3158. proto.day = proto.days = getSetDayOfWeek;
  3159. proto.weekday = getSetLocaleDayOfWeek;
  3160. proto.isoWeekday = getSetISODayOfWeek;
  3161. proto.dayOfYear = getSetDayOfYear;
  3162. // Hour
  3163. proto.hour = proto.hours = getSetHour;
  3164. // Minute
  3165. proto.minute = proto.minutes = getSetMinute;
  3166. // Second
  3167. proto.second = proto.seconds = getSetSecond;
  3168. // Millisecond
  3169. proto.millisecond = proto.milliseconds = getSetMillisecond;
  3170. // Offset
  3171. proto.utcOffset = getSetOffset;
  3172. proto.utc = setOffsetToUTC;
  3173. proto.local = setOffsetToLocal;
  3174. proto.parseZone = setOffsetToParsedOffset;
  3175. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  3176. proto.isDST = isDaylightSavingTime;
  3177. proto.isLocal = isLocal;
  3178. proto.isUtcOffset = isUtcOffset;
  3179. proto.isUtc = isUtc;
  3180. proto.isUTC = isUtc;
  3181. // Timezone
  3182. proto.zoneAbbr = getZoneAbbr;
  3183. proto.zoneName = getZoneName;
  3184. // Deprecations
  3185. proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  3186. proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  3187. proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  3188. proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  3189. proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  3190. function createUnix (input) {
  3191. return createLocal(input * 1000);
  3192. }
  3193. function createInZone () {
  3194. return createLocal.apply(null, arguments).parseZone();
  3195. }
  3196. function preParsePostFormat (string) {
  3197. return string;
  3198. }
  3199. var proto$1 = Locale.prototype;
  3200. proto$1.calendar = calendar;
  3201. proto$1.longDateFormat = longDateFormat;
  3202. proto$1.invalidDate = invalidDate;
  3203. proto$1.ordinal = ordinal;
  3204. proto$1.preparse = preParsePostFormat;
  3205. proto$1.postformat = preParsePostFormat;
  3206. proto$1.relativeTime = relativeTime;
  3207. proto$1.pastFuture = pastFuture;
  3208. proto$1.set = set;
  3209. // Month
  3210. proto$1.months = localeMonths;
  3211. proto$1.monthsShort = localeMonthsShort;
  3212. proto$1.monthsParse = localeMonthsParse;
  3213. proto$1.monthsRegex = monthsRegex;
  3214. proto$1.monthsShortRegex = monthsShortRegex;
  3215. // Week
  3216. proto$1.week = localeWeek;
  3217. proto$1.firstDayOfYear = localeFirstDayOfYear;
  3218. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  3219. // Day of Week
  3220. proto$1.weekdays = localeWeekdays;
  3221. proto$1.weekdaysMin = localeWeekdaysMin;
  3222. proto$1.weekdaysShort = localeWeekdaysShort;
  3223. proto$1.weekdaysParse = localeWeekdaysParse;
  3224. proto$1.weekdaysRegex = weekdaysRegex;
  3225. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  3226. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  3227. // Hours
  3228. proto$1.isPM = localeIsPM;
  3229. proto$1.meridiem = localeMeridiem;
  3230. function get$1 (format, index, field, setter) {
  3231. var locale = getLocale();
  3232. var utc = createUTC().set(setter, index);
  3233. return locale[field](utc, format);
  3234. }
  3235. function listMonthsImpl (format, index, field) {
  3236. if (isNumber(format)) {
  3237. index = format;
  3238. format = undefined;
  3239. }
  3240. format = format || '';
  3241. if (index != null) {
  3242. return get$1(format, index, field, 'month');
  3243. }
  3244. var i;
  3245. var out = [];
  3246. for (i = 0; i < 12; i++) {
  3247. out[i] = get$1(format, i, field, 'month');
  3248. }
  3249. return out;
  3250. }
  3251. // ()
  3252. // (5)
  3253. // (fmt, 5)
  3254. // (fmt)
  3255. // (true)
  3256. // (true, 5)
  3257. // (true, fmt, 5)
  3258. // (true, fmt)
  3259. function listWeekdaysImpl (localeSorted, format, index, field) {
  3260. if (typeof localeSorted === 'boolean') {
  3261. if (isNumber(format)) {
  3262. index = format;
  3263. format = undefined;
  3264. }
  3265. format = format || '';
  3266. } else {
  3267. format = localeSorted;
  3268. index = format;
  3269. localeSorted = false;
  3270. if (isNumber(format)) {
  3271. index = format;
  3272. format = undefined;
  3273. }
  3274. format = format || '';
  3275. }
  3276. var locale = getLocale(),
  3277. shift = localeSorted ? locale._week.dow : 0;
  3278. if (index != null) {
  3279. return get$1(format, (index + shift) % 7, field, 'day');
  3280. }
  3281. var i;
  3282. var out = [];
  3283. for (i = 0; i < 7; i++) {
  3284. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  3285. }
  3286. return out;
  3287. }
  3288. function listMonths (format, index) {
  3289. return listMonthsImpl(format, index, 'months');
  3290. }
  3291. function listMonthsShort (format, index) {
  3292. return listMonthsImpl(format, index, 'monthsShort');
  3293. }
  3294. function listWeekdays (localeSorted, format, index) {
  3295. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  3296. }
  3297. function listWeekdaysShort (localeSorted, format, index) {
  3298. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  3299. }
  3300. function listWeekdaysMin (localeSorted, format, index) {
  3301. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  3302. }
  3303. getSetGlobalLocale('en', {
  3304. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  3305. ordinal : function (number) {
  3306. var b = number % 10,
  3307. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  3308. (b === 1) ? 'st' :
  3309. (b === 2) ? 'nd' :
  3310. (b === 3) ? 'rd' : 'th';
  3311. return number + output;
  3312. }
  3313. });
  3314. // Side effect imports
  3315. hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  3316. hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  3317. var mathAbs = Math.abs;
  3318. function abs () {
  3319. var data = this._data;
  3320. this._milliseconds = mathAbs(this._milliseconds);
  3321. this._days = mathAbs(this._days);
  3322. this._months = mathAbs(this._months);
  3323. data.milliseconds = mathAbs(data.milliseconds);
  3324. data.seconds = mathAbs(data.seconds);
  3325. data.minutes = mathAbs(data.minutes);
  3326. data.hours = mathAbs(data.hours);
  3327. data.months = mathAbs(data.months);
  3328. data.years = mathAbs(data.years);
  3329. return this;
  3330. }
  3331. function addSubtract$1 (duration, input, value, direction) {
  3332. var other = createDuration(input, value);
  3333. duration._milliseconds += direction * other._milliseconds;
  3334. duration._days += direction * other._days;
  3335. duration._months += direction * other._months;
  3336. return duration._bubble();
  3337. }
  3338. // supports only 2.0-style add(1, 's') or add(duration)
  3339. function add$1 (input, value) {
  3340. return addSubtract$1(this, input, value, 1);
  3341. }
  3342. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  3343. function subtract$1 (input, value) {
  3344. return addSubtract$1(this, input, value, -1);
  3345. }
  3346. function absCeil (number) {
  3347. if (number < 0) {
  3348. return Math.floor(number);
  3349. } else {
  3350. return Math.ceil(number);
  3351. }
  3352. }
  3353. function bubble () {
  3354. var milliseconds = this._milliseconds;
  3355. var days = this._days;
  3356. var months = this._months;
  3357. var data = this._data;
  3358. var seconds, minutes, hours, years, monthsFromDays;
  3359. // if we have a mix of positive and negative values, bubble down first
  3360. // check: https://github.com/moment/moment/issues/2166
  3361. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  3362. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  3363. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  3364. days = 0;
  3365. months = 0;
  3366. }
  3367. // The following code bubbles up values, see the tests for
  3368. // examples of what that means.
  3369. data.milliseconds = milliseconds % 1000;
  3370. seconds = absFloor(milliseconds / 1000);
  3371. data.seconds = seconds % 60;
  3372. minutes = absFloor(seconds / 60);
  3373. data.minutes = minutes % 60;
  3374. hours = absFloor(minutes / 60);
  3375. data.hours = hours % 24;
  3376. days += absFloor(hours / 24);
  3377. // convert days to months
  3378. monthsFromDays = absFloor(daysToMonths(days));
  3379. months += monthsFromDays;
  3380. days -= absCeil(monthsToDays(monthsFromDays));
  3381. // 12 months -> 1 year
  3382. years = absFloor(months / 12);
  3383. months %= 12;
  3384. data.days = days;
  3385. data.months = months;
  3386. data.years = years;
  3387. return this;
  3388. }
  3389. function daysToMonths (days) {
  3390. // 400 years have 146097 days (taking into account leap year rules)
  3391. // 400 years have 12 months === 4800
  3392. return days * 4800 / 146097;
  3393. }
  3394. function monthsToDays (months) {
  3395. // the reverse of daysToMonths
  3396. return months * 146097 / 4800;
  3397. }
  3398. function as (units) {
  3399. var days;
  3400. var months;
  3401. var milliseconds = this._milliseconds;
  3402. units = normalizeUnits(units);
  3403. if (units === 'month' || units === 'year') {
  3404. days = this._days + milliseconds / 864e5;
  3405. months = this._months + daysToMonths(days);
  3406. return units === 'month' ? months : months / 12;
  3407. } else {
  3408. // handle milliseconds separately because of floating point math errors (issue #1867)
  3409. days = this._days + Math.round(monthsToDays(this._months));
  3410. switch (units) {
  3411. case 'week' : return days / 7 + milliseconds / 6048e5;
  3412. case 'day' : return days + milliseconds / 864e5;
  3413. case 'hour' : return days * 24 + milliseconds / 36e5;
  3414. case 'minute' : return days * 1440 + milliseconds / 6e4;
  3415. case 'second' : return days * 86400 + milliseconds / 1000;
  3416. // Math.floor prevents floating point math errors here
  3417. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  3418. default: throw new Error('Unknown unit ' + units);
  3419. }
  3420. }
  3421. }
  3422. // TODO: Use this.as('ms')?
  3423. function valueOf$1 () {
  3424. return (
  3425. this._milliseconds +
  3426. this._days * 864e5 +
  3427. (this._months % 12) * 2592e6 +
  3428. toInt(this._months / 12) * 31536e6
  3429. );
  3430. }
  3431. function makeAs (alias) {
  3432. return function () {
  3433. return this.as(alias);
  3434. };
  3435. }
  3436. var asMilliseconds = makeAs('ms');
  3437. var asSeconds = makeAs('s');
  3438. var asMinutes = makeAs('m');
  3439. var asHours = makeAs('h');
  3440. var asDays = makeAs('d');
  3441. var asWeeks = makeAs('w');
  3442. var asMonths = makeAs('M');
  3443. var asYears = makeAs('y');
  3444. function get$2 (units) {
  3445. units = normalizeUnits(units);
  3446. return this[units + 's']();
  3447. }
  3448. function makeGetter(name) {
  3449. return function () {
  3450. return this._data[name];
  3451. };
  3452. }
  3453. var milliseconds = makeGetter('milliseconds');
  3454. var seconds = makeGetter('seconds');
  3455. var minutes = makeGetter('minutes');
  3456. var hours = makeGetter('hours');
  3457. var days = makeGetter('days');
  3458. var months = makeGetter('months');
  3459. var years = makeGetter('years');
  3460. function weeks () {
  3461. return absFloor(this.days() / 7);
  3462. }
  3463. var round = Math.round;
  3464. var thresholds = {
  3465. s: 45, // seconds to minute
  3466. m: 45, // minutes to hour
  3467. h: 22, // hours to day
  3468. d: 26, // days to month
  3469. M: 11 // months to year
  3470. };
  3471. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  3472. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  3473. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  3474. }
  3475. function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
  3476. var duration = createDuration(posNegDuration).abs();
  3477. var seconds = round(duration.as('s'));
  3478. var minutes = round(duration.as('m'));
  3479. var hours = round(duration.as('h'));
  3480. var days = round(duration.as('d'));
  3481. var months = round(duration.as('M'));
  3482. var years = round(duration.as('y'));
  3483. var a = seconds < thresholds.s && ['s', seconds] ||
  3484. minutes <= 1 && ['m'] ||
  3485. minutes < thresholds.m && ['mm', minutes] ||
  3486. hours <= 1 && ['h'] ||
  3487. hours < thresholds.h && ['hh', hours] ||
  3488. days <= 1 && ['d'] ||
  3489. days < thresholds.d && ['dd', days] ||
  3490. months <= 1 && ['M'] ||
  3491. months < thresholds.M && ['MM', months] ||
  3492. years <= 1 && ['y'] || ['yy', years];
  3493. a[2] = withoutSuffix;
  3494. a[3] = +posNegDuration > 0;
  3495. a[4] = locale;
  3496. return substituteTimeAgo.apply(null, a);
  3497. }
  3498. // This function allows you to set the rounding function for relative time strings
  3499. function getSetRelativeTimeRounding (roundingFunction) {
  3500. if (roundingFunction === undefined) {
  3501. return round;
  3502. }
  3503. if (typeof(roundingFunction) === 'function') {
  3504. round = roundingFunction;
  3505. return true;
  3506. }
  3507. return false;
  3508. }
  3509. // This function allows you to set a threshold for relative time strings
  3510. function getSetRelativeTimeThreshold (threshold, limit) {
  3511. if (thresholds[threshold] === undefined) {
  3512. return false;
  3513. }
  3514. if (limit === undefined) {
  3515. return thresholds[threshold];
  3516. }
  3517. thresholds[threshold] = limit;
  3518. return true;
  3519. }
  3520. function humanize (withSuffix) {
  3521. var locale = this.localeData();
  3522. var output = relativeTime$1(this, !withSuffix, locale);
  3523. if (withSuffix) {
  3524. output = locale.pastFuture(+this, output);
  3525. }
  3526. return locale.postformat(output);
  3527. }
  3528. var abs$1 = Math.abs;
  3529. function toISOString$1() {
  3530. // for ISO strings we do not use the normal bubbling rules:
  3531. // * milliseconds bubble up until they become hours
  3532. // * days do not bubble at all
  3533. // * months bubble up until they become years
  3534. // This is because there is no context-free conversion between hours and days
  3535. // (think of clock changes)
  3536. // and also not between days and months (28-31 days per month)
  3537. var seconds = abs$1(this._milliseconds) / 1000;
  3538. var days = abs$1(this._days);
  3539. var months = abs$1(this._months);
  3540. var minutes, hours, years;
  3541. // 3600 seconds -> 60 minutes -> 1 hour
  3542. minutes = absFloor(seconds / 60);
  3543. hours = absFloor(minutes / 60);
  3544. seconds %= 60;
  3545. minutes %= 60;
  3546. // 12 months -> 1 year
  3547. years = absFloor(months / 12);
  3548. months %= 12;
  3549. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  3550. var Y = years;
  3551. var M = months;
  3552. var D = days;
  3553. var h = hours;
  3554. var m = minutes;
  3555. var s = seconds;
  3556. var total = this.asSeconds();
  3557. if (!total) {
  3558. // this is the same as C#'s (Noda) and python (isodate)...
  3559. // but not other JS (goog.date)
  3560. return 'P0D';
  3561. }
  3562. return (total < 0 ? '-' : '') +
  3563. 'P' +
  3564. (Y ? Y + 'Y' : '') +
  3565. (M ? M + 'M' : '') +
  3566. (D ? D + 'D' : '') +
  3567. ((h || m || s) ? 'T' : '') +
  3568. (h ? h + 'H' : '') +
  3569. (m ? m + 'M' : '') +
  3570. (s ? s + 'S' : '');
  3571. }
  3572. var proto$2 = Duration.prototype;
  3573. proto$2.abs = abs;
  3574. proto$2.add = add$1;
  3575. proto$2.subtract = subtract$1;
  3576. proto$2.as = as;
  3577. proto$2.asMilliseconds = asMilliseconds;
  3578. proto$2.asSeconds = asSeconds;
  3579. proto$2.asMinutes = asMinutes;
  3580. proto$2.asHours = asHours;
  3581. proto$2.asDays = asDays;
  3582. proto$2.asWeeks = asWeeks;
  3583. proto$2.asMonths = asMonths;
  3584. proto$2.asYears = asYears;
  3585. proto$2.valueOf = valueOf$1;
  3586. proto$2._bubble = bubble;
  3587. proto$2.get = get$2;
  3588. proto$2.milliseconds = milliseconds;
  3589. proto$2.seconds = seconds;
  3590. proto$2.minutes = minutes;
  3591. proto$2.hours = hours;
  3592. proto$2.days = days;
  3593. proto$2.weeks = weeks;
  3594. proto$2.months = months;
  3595. proto$2.years = years;
  3596. proto$2.humanize = humanize;
  3597. proto$2.toISOString = toISOString$1;
  3598. proto$2.toString = toISOString$1;
  3599. proto$2.toJSON = toISOString$1;
  3600. proto$2.locale = locale;
  3601. proto$2.localeData = localeData;
  3602. // Deprecations
  3603. proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  3604. proto$2.lang = lang;
  3605. // Side effect imports
  3606. // FORMATTING
  3607. addFormatToken('X', 0, 0, 'unix');
  3608. addFormatToken('x', 0, 0, 'valueOf');
  3609. // PARSING
  3610. addRegexToken('x', matchSigned);
  3611. addRegexToken('X', matchTimestamp);
  3612. addParseToken('X', function (input, array, config) {
  3613. config._d = new Date(parseFloat(input, 10) * 1000);
  3614. });
  3615. addParseToken('x', function (input, array, config) {
  3616. config._d = new Date(toInt(input));
  3617. });
  3618. // Side effect imports
  3619. hooks.version = '2.17.1';
  3620. setHookCallback(createLocal);
  3621. hooks.fn = proto;
  3622. hooks.min = min;
  3623. hooks.max = max;
  3624. hooks.now = now;
  3625. hooks.utc = createUTC;
  3626. hooks.unix = createUnix;
  3627. hooks.months = listMonths;
  3628. hooks.isDate = isDate;
  3629. hooks.locale = getSetGlobalLocale;
  3630. hooks.invalid = createInvalid;
  3631. hooks.duration = createDuration;
  3632. hooks.isMoment = isMoment;
  3633. hooks.weekdays = listWeekdays;
  3634. hooks.parseZone = createInZone;
  3635. hooks.localeData = getLocale;
  3636. hooks.isDuration = isDuration;
  3637. hooks.monthsShort = listMonthsShort;
  3638. hooks.weekdaysMin = listWeekdaysMin;
  3639. hooks.defineLocale = defineLocale;
  3640. hooks.updateLocale = updateLocale;
  3641. hooks.locales = listLocales;
  3642. hooks.weekdaysShort = listWeekdaysShort;
  3643. hooks.normalizeUnits = normalizeUnits;
  3644. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  3645. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  3646. hooks.calendarFormat = getCalendarFormat;
  3647. hooks.prototype = proto;
  3648. return hooks;
  3649. })));
  3650. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(191)(module)))
  3651. /***/ }),
  3652. /* 1 */
  3653. /***/ (function(module, exports) {
  3654. module.exports = function normalizeComponent (
  3655. rawScriptExports,
  3656. compiledTemplate,
  3657. scopeId,
  3658. cssModules
  3659. ) {
  3660. var esModule
  3661. var scriptExports = rawScriptExports = rawScriptExports || {}
  3662. // ES6 modules interop
  3663. var type = typeof rawScriptExports.default
  3664. if (type === 'object' || type === 'function') {
  3665. esModule = rawScriptExports
  3666. scriptExports = rawScriptExports.default
  3667. }
  3668. // Vue.extend constructor export interop
  3669. var options = typeof scriptExports === 'function'
  3670. ? scriptExports.options
  3671. : scriptExports
  3672. // render functions
  3673. if (compiledTemplate) {
  3674. options.render = compiledTemplate.render
  3675. options.staticRenderFns = compiledTemplate.staticRenderFns
  3676. }
  3677. // scopedId
  3678. if (scopeId) {
  3679. options._scopeId = scopeId
  3680. }
  3681. // inject cssModules
  3682. if (cssModules) {
  3683. var computed = options.computed || (options.computed = {})
  3684. Object.keys(cssModules).forEach(function (key) {
  3685. var module = cssModules[key]
  3686. computed[key] = function () { return module }
  3687. })
  3688. }
  3689. return {
  3690. esModule: esModule,
  3691. exports: scriptExports,
  3692. options: options
  3693. }
  3694. }
  3695. /***/ }),
  3696. /* 2 */
  3697. /***/ (function(module, exports, __webpack_require__) {
  3698. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  3699. * jQuery JavaScript Library v3.1.1
  3700. * https://jquery.com/
  3701. *
  3702. * Includes Sizzle.js
  3703. * https://sizzlejs.com/
  3704. *
  3705. * Copyright jQuery Foundation and other contributors
  3706. * Released under the MIT license
  3707. * https://jquery.org/license
  3708. *
  3709. * Date: 2016-09-22T22:30Z
  3710. */
  3711. ( function( global, factory ) {
  3712. "use strict";
  3713. if ( typeof module === "object" && typeof module.exports === "object" ) {
  3714. // For CommonJS and CommonJS-like environments where a proper `window`
  3715. // is present, execute the factory and get jQuery.
  3716. // For environments that do not have a `window` with a `document`
  3717. // (such as Node.js), expose a factory as module.exports.
  3718. // This accentuates the need for the creation of a real `window`.
  3719. // e.g. var jQuery = require("jquery")(window);
  3720. // See ticket #14549 for more info.
  3721. module.exports = global.document ?
  3722. factory( global, true ) :
  3723. function( w ) {
  3724. if ( !w.document ) {
  3725. throw new Error( "jQuery requires a window with a document" );
  3726. }
  3727. return factory( w );
  3728. };
  3729. } else {
  3730. factory( global );
  3731. }
  3732. // Pass this if window is not defined yet
  3733. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  3734. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  3735. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  3736. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  3737. // enough that all such attempts are guarded in a try block.
  3738. "use strict";
  3739. var arr = [];
  3740. var document = window.document;
  3741. var getProto = Object.getPrototypeOf;
  3742. var slice = arr.slice;
  3743. var concat = arr.concat;
  3744. var push = arr.push;
  3745. var indexOf = arr.indexOf;
  3746. var class2type = {};
  3747. var toString = class2type.toString;
  3748. var hasOwn = class2type.hasOwnProperty;
  3749. var fnToString = hasOwn.toString;
  3750. var ObjectFunctionString = fnToString.call( Object );
  3751. var support = {};
  3752. function DOMEval( code, doc ) {
  3753. doc = doc || document;
  3754. var script = doc.createElement( "script" );
  3755. script.text = code;
  3756. doc.head.appendChild( script ).parentNode.removeChild( script );
  3757. }
  3758. /* global Symbol */
  3759. // Defining this global in .eslintrc.json would create a danger of using the global
  3760. // unguarded in another place, it seems safer to define global only for this module
  3761. var
  3762. version = "3.1.1",
  3763. // Define a local copy of jQuery
  3764. jQuery = function( selector, context ) {
  3765. // The jQuery object is actually just the init constructor 'enhanced'
  3766. // Need init if jQuery is called (just allow error to be thrown if not included)
  3767. return new jQuery.fn.init( selector, context );
  3768. },
  3769. // Support: Android <=4.0 only
  3770. // Make sure we trim BOM and NBSP
  3771. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  3772. // Matches dashed string for camelizing
  3773. rmsPrefix = /^-ms-/,
  3774. rdashAlpha = /-([a-z])/g,
  3775. // Used by jQuery.camelCase as callback to replace()
  3776. fcamelCase = function( all, letter ) {
  3777. return letter.toUpperCase();
  3778. };
  3779. jQuery.fn = jQuery.prototype = {
  3780. // The current version of jQuery being used
  3781. jquery: version,
  3782. constructor: jQuery,
  3783. // The default length of a jQuery object is 0
  3784. length: 0,
  3785. toArray: function() {
  3786. return slice.call( this );
  3787. },
  3788. // Get the Nth element in the matched element set OR
  3789. // Get the whole matched element set as a clean array
  3790. get: function( num ) {
  3791. // Return all the elements in a clean array
  3792. if ( num == null ) {
  3793. return slice.call( this );
  3794. }
  3795. // Return just the one element from the set
  3796. return num < 0 ? this[ num + this.length ] : this[ num ];
  3797. },
  3798. // Take an array of elements and push it onto the stack
  3799. // (returning the new matched element set)
  3800. pushStack: function( elems ) {
  3801. // Build a new jQuery matched element set
  3802. var ret = jQuery.merge( this.constructor(), elems );
  3803. // Add the old object onto the stack (as a reference)
  3804. ret.prevObject = this;
  3805. // Return the newly-formed element set
  3806. return ret;
  3807. },
  3808. // Execute a callback for every element in the matched set.
  3809. each: function( callback ) {
  3810. return jQuery.each( this, callback );
  3811. },
  3812. map: function( callback ) {
  3813. return this.pushStack( jQuery.map( this, function( elem, i ) {
  3814. return callback.call( elem, i, elem );
  3815. } ) );
  3816. },
  3817. slice: function() {
  3818. return this.pushStack( slice.apply( this, arguments ) );
  3819. },
  3820. first: function() {
  3821. return this.eq( 0 );
  3822. },
  3823. last: function() {
  3824. return this.eq( -1 );
  3825. },
  3826. eq: function( i ) {
  3827. var len = this.length,
  3828. j = +i + ( i < 0 ? len : 0 );
  3829. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  3830. },
  3831. end: function() {
  3832. return this.prevObject || this.constructor();
  3833. },
  3834. // For internal use only.
  3835. // Behaves like an Array's method, not like a jQuery method.
  3836. push: push,
  3837. sort: arr.sort,
  3838. splice: arr.splice
  3839. };
  3840. jQuery.extend = jQuery.fn.extend = function() {
  3841. var options, name, src, copy, copyIsArray, clone,
  3842. target = arguments[ 0 ] || {},
  3843. i = 1,
  3844. length = arguments.length,
  3845. deep = false;
  3846. // Handle a deep copy situation
  3847. if ( typeof target === "boolean" ) {
  3848. deep = target;
  3849. // Skip the boolean and the target
  3850. target = arguments[ i ] || {};
  3851. i++;
  3852. }
  3853. // Handle case when target is a string or something (possible in deep copy)
  3854. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  3855. target = {};
  3856. }
  3857. // Extend jQuery itself if only one argument is passed
  3858. if ( i === length ) {
  3859. target = this;
  3860. i--;
  3861. }
  3862. for ( ; i < length; i++ ) {
  3863. // Only deal with non-null/undefined values
  3864. if ( ( options = arguments[ i ] ) != null ) {
  3865. // Extend the base object
  3866. for ( name in options ) {
  3867. src = target[ name ];
  3868. copy = options[ name ];
  3869. // Prevent never-ending loop
  3870. if ( target === copy ) {
  3871. continue;
  3872. }
  3873. // Recurse if we're merging plain objects or arrays
  3874. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  3875. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  3876. if ( copyIsArray ) {
  3877. copyIsArray = false;
  3878. clone = src && jQuery.isArray( src ) ? src : [];
  3879. } else {
  3880. clone = src && jQuery.isPlainObject( src ) ? src : {};
  3881. }
  3882. // Never move original objects, clone them
  3883. target[ name ] = jQuery.extend( deep, clone, copy );
  3884. // Don't bring in undefined values
  3885. } else if ( copy !== undefined ) {
  3886. target[ name ] = copy;
  3887. }
  3888. }
  3889. }
  3890. }
  3891. // Return the modified object
  3892. return target;
  3893. };
  3894. jQuery.extend( {
  3895. // Unique for each copy of jQuery on the page
  3896. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  3897. // Assume jQuery is ready without the ready module
  3898. isReady: true,
  3899. error: function( msg ) {
  3900. throw new Error( msg );
  3901. },
  3902. noop: function() {},
  3903. isFunction: function( obj ) {
  3904. return jQuery.type( obj ) === "function";
  3905. },
  3906. isArray: Array.isArray,
  3907. isWindow: function( obj ) {
  3908. return obj != null && obj === obj.window;
  3909. },
  3910. isNumeric: function( obj ) {
  3911. // As of jQuery 3.0, isNumeric is limited to
  3912. // strings and numbers (primitives or objects)
  3913. // that can be coerced to finite numbers (gh-2662)
  3914. var type = jQuery.type( obj );
  3915. return ( type === "number" || type === "string" ) &&
  3916. // parseFloat NaNs numeric-cast false positives ("")
  3917. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  3918. // subtraction forces infinities to NaN
  3919. !isNaN( obj - parseFloat( obj ) );
  3920. },
  3921. isPlainObject: function( obj ) {
  3922. var proto, Ctor;
  3923. // Detect obvious negatives
  3924. // Use toString instead of jQuery.type to catch host objects
  3925. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  3926. return false;
  3927. }
  3928. proto = getProto( obj );
  3929. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  3930. if ( !proto ) {
  3931. return true;
  3932. }
  3933. // Objects with prototype are plain iff they were constructed by a global Object function
  3934. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  3935. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  3936. },
  3937. isEmptyObject: function( obj ) {
  3938. /* eslint-disable no-unused-vars */
  3939. // See https://github.com/eslint/eslint/issues/6125
  3940. var name;
  3941. for ( name in obj ) {
  3942. return false;
  3943. }
  3944. return true;
  3945. },
  3946. type: function( obj ) {
  3947. if ( obj == null ) {
  3948. return obj + "";
  3949. }
  3950. // Support: Android <=2.3 only (functionish RegExp)
  3951. return typeof obj === "object" || typeof obj === "function" ?
  3952. class2type[ toString.call( obj ) ] || "object" :
  3953. typeof obj;
  3954. },
  3955. // Evaluates a script in a global context
  3956. globalEval: function( code ) {
  3957. DOMEval( code );
  3958. },
  3959. // Convert dashed to camelCase; used by the css and data modules
  3960. // Support: IE <=9 - 11, Edge 12 - 13
  3961. // Microsoft forgot to hump their vendor prefix (#9572)
  3962. camelCase: function( string ) {
  3963. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3964. },
  3965. nodeName: function( elem, name ) {
  3966. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  3967. },
  3968. each: function( obj, callback ) {
  3969. var length, i = 0;
  3970. if ( isArrayLike( obj ) ) {
  3971. length = obj.length;
  3972. for ( ; i < length; i++ ) {
  3973. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3974. break;
  3975. }
  3976. }
  3977. } else {
  3978. for ( i in obj ) {
  3979. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3980. break;
  3981. }
  3982. }
  3983. }
  3984. return obj;
  3985. },
  3986. // Support: Android <=4.0 only
  3987. trim: function( text ) {
  3988. return text == null ?
  3989. "" :
  3990. ( text + "" ).replace( rtrim, "" );
  3991. },
  3992. // results is for internal usage only
  3993. makeArray: function( arr, results ) {
  3994. var ret = results || [];
  3995. if ( arr != null ) {
  3996. if ( isArrayLike( Object( arr ) ) ) {
  3997. jQuery.merge( ret,
  3998. typeof arr === "string" ?
  3999. [ arr ] : arr
  4000. );
  4001. } else {
  4002. push.call( ret, arr );
  4003. }
  4004. }
  4005. return ret;
  4006. },
  4007. inArray: function( elem, arr, i ) {
  4008. return arr == null ? -1 : indexOf.call( arr, elem, i );
  4009. },
  4010. // Support: Android <=4.0 only, PhantomJS 1 only
  4011. // push.apply(_, arraylike) throws on ancient WebKit
  4012. merge: function( first, second ) {
  4013. var len = +second.length,
  4014. j = 0,
  4015. i = first.length;
  4016. for ( ; j < len; j++ ) {
  4017. first[ i++ ] = second[ j ];
  4018. }
  4019. first.length = i;
  4020. return first;
  4021. },
  4022. grep: function( elems, callback, invert ) {
  4023. var callbackInverse,
  4024. matches = [],
  4025. i = 0,
  4026. length = elems.length,
  4027. callbackExpect = !invert;
  4028. // Go through the array, only saving the items
  4029. // that pass the validator function
  4030. for ( ; i < length; i++ ) {
  4031. callbackInverse = !callback( elems[ i ], i );
  4032. if ( callbackInverse !== callbackExpect ) {
  4033. matches.push( elems[ i ] );
  4034. }
  4035. }
  4036. return matches;
  4037. },
  4038. // arg is for internal usage only
  4039. map: function( elems, callback, arg ) {
  4040. var length, value,
  4041. i = 0,
  4042. ret = [];
  4043. // Go through the array, translating each of the items to their new values
  4044. if ( isArrayLike( elems ) ) {
  4045. length = elems.length;
  4046. for ( ; i < length; i++ ) {
  4047. value = callback( elems[ i ], i, arg );
  4048. if ( value != null ) {
  4049. ret.push( value );
  4050. }
  4051. }
  4052. // Go through every key on the object,
  4053. } else {
  4054. for ( i in elems ) {
  4055. value = callback( elems[ i ], i, arg );
  4056. if ( value != null ) {
  4057. ret.push( value );
  4058. }
  4059. }
  4060. }
  4061. // Flatten any nested arrays
  4062. return concat.apply( [], ret );
  4063. },
  4064. // A global GUID counter for objects
  4065. guid: 1,
  4066. // Bind a function to a context, optionally partially applying any
  4067. // arguments.
  4068. proxy: function( fn, context ) {
  4069. var tmp, args, proxy;
  4070. if ( typeof context === "string" ) {
  4071. tmp = fn[ context ];
  4072. context = fn;
  4073. fn = tmp;
  4074. }
  4075. // Quick check to determine if target is callable, in the spec
  4076. // this throws a TypeError, but we will just return undefined.
  4077. if ( !jQuery.isFunction( fn ) ) {
  4078. return undefined;
  4079. }
  4080. // Simulated bind
  4081. args = slice.call( arguments, 2 );
  4082. proxy = function() {
  4083. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  4084. };
  4085. // Set the guid of unique handler to the same of original handler, so it can be removed
  4086. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  4087. return proxy;
  4088. },
  4089. now: Date.now,
  4090. // jQuery.support is not used in Core but other projects attach their
  4091. // properties to it so it needs to exist.
  4092. support: support
  4093. } );
  4094. if ( typeof Symbol === "function" ) {
  4095. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  4096. }
  4097. // Populate the class2type map
  4098. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  4099. function( i, name ) {
  4100. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  4101. } );
  4102. function isArrayLike( obj ) {
  4103. // Support: real iOS 8.2 only (not reproducible in simulator)
  4104. // `in` check used to prevent JIT error (gh-2145)
  4105. // hasOwn isn't used here due to false negatives
  4106. // regarding Nodelist length in IE
  4107. var length = !!obj && "length" in obj && obj.length,
  4108. type = jQuery.type( obj );
  4109. if ( type === "function" || jQuery.isWindow( obj ) ) {
  4110. return false;
  4111. }
  4112. return type === "array" || length === 0 ||
  4113. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  4114. }
  4115. var Sizzle =
  4116. /*!
  4117. * Sizzle CSS Selector Engine v2.3.3
  4118. * https://sizzlejs.com/
  4119. *
  4120. * Copyright jQuery Foundation and other contributors
  4121. * Released under the MIT license
  4122. * http://jquery.org/license
  4123. *
  4124. * Date: 2016-08-08
  4125. */
  4126. (function( window ) {
  4127. var i,
  4128. support,
  4129. Expr,
  4130. getText,
  4131. isXML,
  4132. tokenize,
  4133. compile,
  4134. select,
  4135. outermostContext,
  4136. sortInput,
  4137. hasDuplicate,
  4138. // Local document vars
  4139. setDocument,
  4140. document,
  4141. docElem,
  4142. documentIsHTML,
  4143. rbuggyQSA,
  4144. rbuggyMatches,
  4145. matches,
  4146. contains,
  4147. // Instance-specific data
  4148. expando = "sizzle" + 1 * new Date(),
  4149. preferredDoc = window.document,
  4150. dirruns = 0,
  4151. done = 0,
  4152. classCache = createCache(),
  4153. tokenCache = createCache(),
  4154. compilerCache = createCache(),
  4155. sortOrder = function( a, b ) {
  4156. if ( a === b ) {
  4157. hasDuplicate = true;
  4158. }
  4159. return 0;
  4160. },
  4161. // Instance methods
  4162. hasOwn = ({}).hasOwnProperty,
  4163. arr = [],
  4164. pop = arr.pop,
  4165. push_native = arr.push,
  4166. push = arr.push,
  4167. slice = arr.slice,
  4168. // Use a stripped-down indexOf as it's faster than native
  4169. // https://jsperf.com/thor-indexof-vs-for/5
  4170. indexOf = function( list, elem ) {
  4171. var i = 0,
  4172. len = list.length;
  4173. for ( ; i < len; i++ ) {
  4174. if ( list[i] === elem ) {
  4175. return i;
  4176. }
  4177. }
  4178. return -1;
  4179. },
  4180. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  4181. // Regular expressions
  4182. // http://www.w3.org/TR/css3-selectors/#whitespace
  4183. whitespace = "[\\x20\\t\\r\\n\\f]",
  4184. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  4185. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  4186. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  4187. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  4188. // Operator (capture 2)
  4189. "*([*^$|!~]?=)" + whitespace +
  4190. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  4191. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  4192. "*\\]",
  4193. pseudos = ":(" + identifier + ")(?:\\((" +
  4194. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  4195. // 1. quoted (capture 3; capture 4 or capture 5)
  4196. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  4197. // 2. simple (capture 6)
  4198. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  4199. // 3. anything else (capture 2)
  4200. ".*" +
  4201. ")\\)|)",
  4202. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  4203. rwhitespace = new RegExp( whitespace + "+", "g" ),
  4204. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  4205. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  4206. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  4207. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  4208. rpseudo = new RegExp( pseudos ),
  4209. ridentifier = new RegExp( "^" + identifier + "$" ),
  4210. matchExpr = {
  4211. "ID": new RegExp( "^#(" + identifier + ")" ),
  4212. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  4213. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  4214. "ATTR": new RegExp( "^" + attributes ),
  4215. "PSEUDO": new RegExp( "^" + pseudos ),
  4216. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  4217. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  4218. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  4219. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  4220. // For use in libraries implementing .is()
  4221. // We use this for POS matching in `select`
  4222. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  4223. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  4224. },
  4225. rinputs = /^(?:input|select|textarea|button)$/i,
  4226. rheader = /^h\d$/i,
  4227. rnative = /^[^{]+\{\s*\[native \w/,
  4228. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  4229. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  4230. rsibling = /[+~]/,
  4231. // CSS escapes
  4232. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  4233. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  4234. funescape = function( _, escaped, escapedWhitespace ) {
  4235. var high = "0x" + escaped - 0x10000;
  4236. // NaN means non-codepoint
  4237. // Support: Firefox<24
  4238. // Workaround erroneous numeric interpretation of +"0x"
  4239. return high !== high || escapedWhitespace ?
  4240. escaped :
  4241. high < 0 ?
  4242. // BMP codepoint
  4243. String.fromCharCode( high + 0x10000 ) :
  4244. // Supplemental Plane codepoint (surrogate pair)
  4245. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  4246. },
  4247. // CSS string/identifier serialization
  4248. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  4249. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  4250. fcssescape = function( ch, asCodePoint ) {
  4251. if ( asCodePoint ) {
  4252. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  4253. if ( ch === "\0" ) {
  4254. return "\uFFFD";
  4255. }
  4256. // Control characters and (dependent upon position) numbers get escaped as code points
  4257. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  4258. }
  4259. // Other potentially-special ASCII characters get backslash-escaped
  4260. return "\\" + ch;
  4261. },
  4262. // Used for iframes
  4263. // See setDocument()
  4264. // Removing the function wrapper causes a "Permission Denied"
  4265. // error in IE
  4266. unloadHandler = function() {
  4267. setDocument();
  4268. },
  4269. disabledAncestor = addCombinator(
  4270. function( elem ) {
  4271. return elem.disabled === true && ("form" in elem || "label" in elem);
  4272. },
  4273. { dir: "parentNode", next: "legend" }
  4274. );
  4275. // Optimize for push.apply( _, NodeList )
  4276. try {
  4277. push.apply(
  4278. (arr = slice.call( preferredDoc.childNodes )),
  4279. preferredDoc.childNodes
  4280. );
  4281. // Support: Android<4.0
  4282. // Detect silently failing push.apply
  4283. arr[ preferredDoc.childNodes.length ].nodeType;
  4284. } catch ( e ) {
  4285. push = { apply: arr.length ?
  4286. // Leverage slice if possible
  4287. function( target, els ) {
  4288. push_native.apply( target, slice.call(els) );
  4289. } :
  4290. // Support: IE<9
  4291. // Otherwise append directly
  4292. function( target, els ) {
  4293. var j = target.length,
  4294. i = 0;
  4295. // Can't trust NodeList.length
  4296. while ( (target[j++] = els[i++]) ) {}
  4297. target.length = j - 1;
  4298. }
  4299. };
  4300. }
  4301. function Sizzle( selector, context, results, seed ) {
  4302. var m, i, elem, nid, match, groups, newSelector,
  4303. newContext = context && context.ownerDocument,
  4304. // nodeType defaults to 9, since context defaults to document
  4305. nodeType = context ? context.nodeType : 9;
  4306. results = results || [];
  4307. // Return early from calls with invalid selector or context
  4308. if ( typeof selector !== "string" || !selector ||
  4309. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  4310. return results;
  4311. }
  4312. // Try to shortcut find operations (as opposed to filters) in HTML documents
  4313. if ( !seed ) {
  4314. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  4315. setDocument( context );
  4316. }
  4317. context = context || document;
  4318. if ( documentIsHTML ) {
  4319. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  4320. // (excepting DocumentFragment context, where the methods don't exist)
  4321. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  4322. // ID selector
  4323. if ( (m = match[1]) ) {
  4324. // Document context
  4325. if ( nodeType === 9 ) {
  4326. if ( (elem = context.getElementById( m )) ) {
  4327. // Support: IE, Opera, Webkit
  4328. // TODO: identify versions
  4329. // getElementById can match elements by name instead of ID
  4330. if ( elem.id === m ) {
  4331. results.push( elem );
  4332. return results;
  4333. }
  4334. } else {
  4335. return results;
  4336. }
  4337. // Element context
  4338. } else {
  4339. // Support: IE, Opera, Webkit
  4340. // TODO: identify versions
  4341. // getElementById can match elements by name instead of ID
  4342. if ( newContext && (elem = newContext.getElementById( m )) &&
  4343. contains( context, elem ) &&
  4344. elem.id === m ) {
  4345. results.push( elem );
  4346. return results;
  4347. }
  4348. }
  4349. // Type selector
  4350. } else if ( match[2] ) {
  4351. push.apply( results, context.getElementsByTagName( selector ) );
  4352. return results;
  4353. // Class selector
  4354. } else if ( (m = match[3]) && support.getElementsByClassName &&
  4355. context.getElementsByClassName ) {
  4356. push.apply( results, context.getElementsByClassName( m ) );
  4357. return results;
  4358. }
  4359. }
  4360. // Take advantage of querySelectorAll
  4361. if ( support.qsa &&
  4362. !compilerCache[ selector + " " ] &&
  4363. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  4364. if ( nodeType !== 1 ) {
  4365. newContext = context;
  4366. newSelector = selector;
  4367. // qSA looks outside Element context, which is not what we want
  4368. // Thanks to Andrew Dupont for this workaround technique
  4369. // Support: IE <=8
  4370. // Exclude object elements
  4371. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  4372. // Capture the context ID, setting it first if necessary
  4373. if ( (nid = context.getAttribute( "id" )) ) {
  4374. nid = nid.replace( rcssescape, fcssescape );
  4375. } else {
  4376. context.setAttribute( "id", (nid = expando) );
  4377. }
  4378. // Prefix every selector in the list
  4379. groups = tokenize( selector );
  4380. i = groups.length;
  4381. while ( i-- ) {
  4382. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  4383. }
  4384. newSelector = groups.join( "," );
  4385. // Expand context for sibling selectors
  4386. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  4387. context;
  4388. }
  4389. if ( newSelector ) {
  4390. try {
  4391. push.apply( results,
  4392. newContext.querySelectorAll( newSelector )
  4393. );
  4394. return results;
  4395. } catch ( qsaError ) {
  4396. } finally {
  4397. if ( nid === expando ) {
  4398. context.removeAttribute( "id" );
  4399. }
  4400. }
  4401. }
  4402. }
  4403. }
  4404. }
  4405. // All others
  4406. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  4407. }
  4408. /**
  4409. * Create key-value caches of limited size
  4410. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  4411. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  4412. * deleting the oldest entry
  4413. */
  4414. function createCache() {
  4415. var keys = [];
  4416. function cache( key, value ) {
  4417. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  4418. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  4419. // Only keep the most recent entries
  4420. delete cache[ keys.shift() ];
  4421. }
  4422. return (cache[ key + " " ] = value);
  4423. }
  4424. return cache;
  4425. }
  4426. /**
  4427. * Mark a function for special use by Sizzle
  4428. * @param {Function} fn The function to mark
  4429. */
  4430. function markFunction( fn ) {
  4431. fn[ expando ] = true;
  4432. return fn;
  4433. }
  4434. /**
  4435. * Support testing using an element
  4436. * @param {Function} fn Passed the created element and returns a boolean result
  4437. */
  4438. function assert( fn ) {
  4439. var el = document.createElement("fieldset");
  4440. try {
  4441. return !!fn( el );
  4442. } catch (e) {
  4443. return false;
  4444. } finally {
  4445. // Remove from its parent by default
  4446. if ( el.parentNode ) {
  4447. el.parentNode.removeChild( el );
  4448. }
  4449. // release memory in IE
  4450. el = null;
  4451. }
  4452. }
  4453. /**
  4454. * Adds the same handler for all of the specified attrs
  4455. * @param {String} attrs Pipe-separated list of attributes
  4456. * @param {Function} handler The method that will be applied
  4457. */
  4458. function addHandle( attrs, handler ) {
  4459. var arr = attrs.split("|"),
  4460. i = arr.length;
  4461. while ( i-- ) {
  4462. Expr.attrHandle[ arr[i] ] = handler;
  4463. }
  4464. }
  4465. /**
  4466. * Checks document order of two siblings
  4467. * @param {Element} a
  4468. * @param {Element} b
  4469. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  4470. */
  4471. function siblingCheck( a, b ) {
  4472. var cur = b && a,
  4473. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  4474. a.sourceIndex - b.sourceIndex;
  4475. // Use IE sourceIndex if available on both nodes
  4476. if ( diff ) {
  4477. return diff;
  4478. }
  4479. // Check if b follows a
  4480. if ( cur ) {
  4481. while ( (cur = cur.nextSibling) ) {
  4482. if ( cur === b ) {
  4483. return -1;
  4484. }
  4485. }
  4486. }
  4487. return a ? 1 : -1;
  4488. }
  4489. /**
  4490. * Returns a function to use in pseudos for input types
  4491. * @param {String} type
  4492. */
  4493. function createInputPseudo( type ) {
  4494. return function( elem ) {
  4495. var name = elem.nodeName.toLowerCase();
  4496. return name === "input" && elem.type === type;
  4497. };
  4498. }
  4499. /**
  4500. * Returns a function to use in pseudos for buttons
  4501. * @param {String} type
  4502. */
  4503. function createButtonPseudo( type ) {
  4504. return function( elem ) {
  4505. var name = elem.nodeName.toLowerCase();
  4506. return (name === "input" || name === "button") && elem.type === type;
  4507. };
  4508. }
  4509. /**
  4510. * Returns a function to use in pseudos for :enabled/:disabled
  4511. * @param {Boolean} disabled true for :disabled; false for :enabled
  4512. */
  4513. function createDisabledPseudo( disabled ) {
  4514. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  4515. return function( elem ) {
  4516. // Only certain elements can match :enabled or :disabled
  4517. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  4518. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  4519. if ( "form" in elem ) {
  4520. // Check for inherited disabledness on relevant non-disabled elements:
  4521. // * listed form-associated elements in a disabled fieldset
  4522. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  4523. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  4524. // * option elements in a disabled optgroup
  4525. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  4526. // All such elements have a "form" property.
  4527. if ( elem.parentNode && elem.disabled === false ) {
  4528. // Option elements defer to a parent optgroup if present
  4529. if ( "label" in elem ) {
  4530. if ( "label" in elem.parentNode ) {
  4531. return elem.parentNode.disabled === disabled;
  4532. } else {
  4533. return elem.disabled === disabled;
  4534. }
  4535. }
  4536. // Support: IE 6 - 11
  4537. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  4538. return elem.isDisabled === disabled ||
  4539. // Where there is no isDisabled, check manually
  4540. /* jshint -W018 */
  4541. elem.isDisabled !== !disabled &&
  4542. disabledAncestor( elem ) === disabled;
  4543. }
  4544. return elem.disabled === disabled;
  4545. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  4546. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  4547. // even exist on them, let alone have a boolean value.
  4548. } else if ( "label" in elem ) {
  4549. return elem.disabled === disabled;
  4550. }
  4551. // Remaining elements are neither :enabled nor :disabled
  4552. return false;
  4553. };
  4554. }
  4555. /**
  4556. * Returns a function to use in pseudos for positionals
  4557. * @param {Function} fn
  4558. */
  4559. function createPositionalPseudo( fn ) {
  4560. return markFunction(function( argument ) {
  4561. argument = +argument;
  4562. return markFunction(function( seed, matches ) {
  4563. var j,
  4564. matchIndexes = fn( [], seed.length, argument ),
  4565. i = matchIndexes.length;
  4566. // Match elements found at the specified indexes
  4567. while ( i-- ) {
  4568. if ( seed[ (j = matchIndexes[i]) ] ) {
  4569. seed[j] = !(matches[j] = seed[j]);
  4570. }
  4571. }
  4572. });
  4573. });
  4574. }
  4575. /**
  4576. * Checks a node for validity as a Sizzle context
  4577. * @param {Element|Object=} context
  4578. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  4579. */
  4580. function testContext( context ) {
  4581. return context && typeof context.getElementsByTagName !== "undefined" && context;
  4582. }
  4583. // Expose support vars for convenience
  4584. support = Sizzle.support = {};
  4585. /**
  4586. * Detects XML nodes
  4587. * @param {Element|Object} elem An element or a document
  4588. * @returns {Boolean} True iff elem is a non-HTML XML node
  4589. */
  4590. isXML = Sizzle.isXML = function( elem ) {
  4591. // documentElement is verified for cases where it doesn't yet exist
  4592. // (such as loading iframes in IE - #4833)
  4593. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  4594. return documentElement ? documentElement.nodeName !== "HTML" : false;
  4595. };
  4596. /**
  4597. * Sets document-related variables once based on the current document
  4598. * @param {Element|Object} [doc] An element or document object to use to set the document
  4599. * @returns {Object} Returns the current document
  4600. */
  4601. setDocument = Sizzle.setDocument = function( node ) {
  4602. var hasCompare, subWindow,
  4603. doc = node ? node.ownerDocument || node : preferredDoc;
  4604. // Return early if doc is invalid or already selected
  4605. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  4606. return document;
  4607. }
  4608. // Update global variables
  4609. document = doc;
  4610. docElem = document.documentElement;
  4611. documentIsHTML = !isXML( document );
  4612. // Support: IE 9-11, Edge
  4613. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  4614. if ( preferredDoc !== document &&
  4615. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  4616. // Support: IE 11, Edge
  4617. if ( subWindow.addEventListener ) {
  4618. subWindow.addEventListener( "unload", unloadHandler, false );
  4619. // Support: IE 9 - 10 only
  4620. } else if ( subWindow.attachEvent ) {
  4621. subWindow.attachEvent( "onunload", unloadHandler );
  4622. }
  4623. }
  4624. /* Attributes
  4625. ---------------------------------------------------------------------- */
  4626. // Support: IE<8
  4627. // Verify that getAttribute really returns attributes and not properties
  4628. // (excepting IE8 booleans)
  4629. support.attributes = assert(function( el ) {
  4630. el.className = "i";
  4631. return !el.getAttribute("className");
  4632. });
  4633. /* getElement(s)By*
  4634. ---------------------------------------------------------------------- */
  4635. // Check if getElementsByTagName("*") returns only elements
  4636. support.getElementsByTagName = assert(function( el ) {
  4637. el.appendChild( document.createComment("") );
  4638. return !el.getElementsByTagName("*").length;
  4639. });
  4640. // Support: IE<9
  4641. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  4642. // Support: IE<10
  4643. // Check if getElementById returns elements by name
  4644. // The broken getElementById methods don't pick up programmatically-set names,
  4645. // so use a roundabout getElementsByName test
  4646. support.getById = assert(function( el ) {
  4647. docElem.appendChild( el ).id = expando;
  4648. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  4649. });
  4650. // ID filter and find
  4651. if ( support.getById ) {
  4652. Expr.filter["ID"] = function( id ) {
  4653. var attrId = id.replace( runescape, funescape );
  4654. return function( elem ) {
  4655. return elem.getAttribute("id") === attrId;
  4656. };
  4657. };
  4658. Expr.find["ID"] = function( id, context ) {
  4659. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4660. var elem = context.getElementById( id );
  4661. return elem ? [ elem ] : [];
  4662. }
  4663. };
  4664. } else {
  4665. Expr.filter["ID"] = function( id ) {
  4666. var attrId = id.replace( runescape, funescape );
  4667. return function( elem ) {
  4668. var node = typeof elem.getAttributeNode !== "undefined" &&
  4669. elem.getAttributeNode("id");
  4670. return node && node.value === attrId;
  4671. };
  4672. };
  4673. // Support: IE 6 - 7 only
  4674. // getElementById is not reliable as a find shortcut
  4675. Expr.find["ID"] = function( id, context ) {
  4676. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4677. var node, i, elems,
  4678. elem = context.getElementById( id );
  4679. if ( elem ) {
  4680. // Verify the id attribute
  4681. node = elem.getAttributeNode("id");
  4682. if ( node && node.value === id ) {
  4683. return [ elem ];
  4684. }
  4685. // Fall back on getElementsByName
  4686. elems = context.getElementsByName( id );
  4687. i = 0;
  4688. while ( (elem = elems[i++]) ) {
  4689. node = elem.getAttributeNode("id");
  4690. if ( node && node.value === id ) {
  4691. return [ elem ];
  4692. }
  4693. }
  4694. }
  4695. return [];
  4696. }
  4697. };
  4698. }
  4699. // Tag
  4700. Expr.find["TAG"] = support.getElementsByTagName ?
  4701. function( tag, context ) {
  4702. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4703. return context.getElementsByTagName( tag );
  4704. // DocumentFragment nodes don't have gEBTN
  4705. } else if ( support.qsa ) {
  4706. return context.querySelectorAll( tag );
  4707. }
  4708. } :
  4709. function( tag, context ) {
  4710. var elem,
  4711. tmp = [],
  4712. i = 0,
  4713. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  4714. results = context.getElementsByTagName( tag );
  4715. // Filter out possible comments
  4716. if ( tag === "*" ) {
  4717. while ( (elem = results[i++]) ) {
  4718. if ( elem.nodeType === 1 ) {
  4719. tmp.push( elem );
  4720. }
  4721. }
  4722. return tmp;
  4723. }
  4724. return results;
  4725. };
  4726. // Class
  4727. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  4728. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  4729. return context.getElementsByClassName( className );
  4730. }
  4731. };
  4732. /* QSA/matchesSelector
  4733. ---------------------------------------------------------------------- */
  4734. // QSA and matchesSelector support
  4735. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  4736. rbuggyMatches = [];
  4737. // qSa(:focus) reports false when true (Chrome 21)
  4738. // We allow this because of a bug in IE8/9 that throws an error
  4739. // whenever `document.activeElement` is accessed on an iframe
  4740. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  4741. // See https://bugs.jquery.com/ticket/13378
  4742. rbuggyQSA = [];
  4743. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  4744. // Build QSA regex
  4745. // Regex strategy adopted from Diego Perini
  4746. assert(function( el ) {
  4747. // Select is set to empty string on purpose
  4748. // This is to test IE's treatment of not explicitly
  4749. // setting a boolean content attribute,
  4750. // since its presence should be enough
  4751. // https://bugs.jquery.com/ticket/12359
  4752. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  4753. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  4754. "<option selected=''></option></select>";
  4755. // Support: IE8, Opera 11-12.16
  4756. // Nothing should be selected when empty strings follow ^= or $= or *=
  4757. // The test attribute must be unknown in Opera but "safe" for WinRT
  4758. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  4759. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  4760. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  4761. }
  4762. // Support: IE8
  4763. // Boolean attributes and "value" are not treated correctly
  4764. if ( !el.querySelectorAll("[selected]").length ) {
  4765. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  4766. }
  4767. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  4768. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  4769. rbuggyQSA.push("~=");
  4770. }
  4771. // Webkit/Opera - :checked should return selected option elements
  4772. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  4773. // IE8 throws error here and will not see later tests
  4774. if ( !el.querySelectorAll(":checked").length ) {
  4775. rbuggyQSA.push(":checked");
  4776. }
  4777. // Support: Safari 8+, iOS 8+
  4778. // https://bugs.webkit.org/show_bug.cgi?id=136851
  4779. // In-page `selector#id sibling-combinator selector` fails
  4780. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  4781. rbuggyQSA.push(".#.+[+~]");
  4782. }
  4783. });
  4784. assert(function( el ) {
  4785. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  4786. "<select disabled='disabled'><option/></select>";
  4787. // Support: Windows 8 Native Apps
  4788. // The type and name attributes are restricted during .innerHTML assignment
  4789. var input = document.createElement("input");
  4790. input.setAttribute( "type", "hidden" );
  4791. el.appendChild( input ).setAttribute( "name", "D" );
  4792. // Support: IE8
  4793. // Enforce case-sensitivity of name attribute
  4794. if ( el.querySelectorAll("[name=d]").length ) {
  4795. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  4796. }
  4797. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  4798. // IE8 throws error here and will not see later tests
  4799. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  4800. rbuggyQSA.push( ":enabled", ":disabled" );
  4801. }
  4802. // Support: IE9-11+
  4803. // IE's :disabled selector does not pick up the children of disabled fieldsets
  4804. docElem.appendChild( el ).disabled = true;
  4805. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  4806. rbuggyQSA.push( ":enabled", ":disabled" );
  4807. }
  4808. // Opera 10-11 does not throw on post-comma invalid pseudos
  4809. el.querySelectorAll("*,:x");
  4810. rbuggyQSA.push(",.*:");
  4811. });
  4812. }
  4813. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  4814. docElem.webkitMatchesSelector ||
  4815. docElem.mozMatchesSelector ||
  4816. docElem.oMatchesSelector ||
  4817. docElem.msMatchesSelector) )) ) {
  4818. assert(function( el ) {
  4819. // Check to see if it's possible to do matchesSelector
  4820. // on a disconnected node (IE 9)
  4821. support.disconnectedMatch = matches.call( el, "*" );
  4822. // This should fail with an exception
  4823. // Gecko does not error, returns false instead
  4824. matches.call( el, "[s!='']:x" );
  4825. rbuggyMatches.push( "!=", pseudos );
  4826. });
  4827. }
  4828. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  4829. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  4830. /* Contains
  4831. ---------------------------------------------------------------------- */
  4832. hasCompare = rnative.test( docElem.compareDocumentPosition );
  4833. // Element contains another
  4834. // Purposefully self-exclusive
  4835. // As in, an element does not contain itself
  4836. contains = hasCompare || rnative.test( docElem.contains ) ?
  4837. function( a, b ) {
  4838. var adown = a.nodeType === 9 ? a.documentElement : a,
  4839. bup = b && b.parentNode;
  4840. return a === bup || !!( bup && bup.nodeType === 1 && (
  4841. adown.contains ?
  4842. adown.contains( bup ) :
  4843. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  4844. ));
  4845. } :
  4846. function( a, b ) {
  4847. if ( b ) {
  4848. while ( (b = b.parentNode) ) {
  4849. if ( b === a ) {
  4850. return true;
  4851. }
  4852. }
  4853. }
  4854. return false;
  4855. };
  4856. /* Sorting
  4857. ---------------------------------------------------------------------- */
  4858. // Document order sorting
  4859. sortOrder = hasCompare ?
  4860. function( a, b ) {
  4861. // Flag for duplicate removal
  4862. if ( a === b ) {
  4863. hasDuplicate = true;
  4864. return 0;
  4865. }
  4866. // Sort on method existence if only one input has compareDocumentPosition
  4867. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  4868. if ( compare ) {
  4869. return compare;
  4870. }
  4871. // Calculate position if both inputs belong to the same document
  4872. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  4873. a.compareDocumentPosition( b ) :
  4874. // Otherwise we know they are disconnected
  4875. 1;
  4876. // Disconnected nodes
  4877. if ( compare & 1 ||
  4878. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  4879. // Choose the first element that is related to our preferred document
  4880. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  4881. return -1;
  4882. }
  4883. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  4884. return 1;
  4885. }
  4886. // Maintain original order
  4887. return sortInput ?
  4888. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4889. 0;
  4890. }
  4891. return compare & 4 ? -1 : 1;
  4892. } :
  4893. function( a, b ) {
  4894. // Exit early if the nodes are identical
  4895. if ( a === b ) {
  4896. hasDuplicate = true;
  4897. return 0;
  4898. }
  4899. var cur,
  4900. i = 0,
  4901. aup = a.parentNode,
  4902. bup = b.parentNode,
  4903. ap = [ a ],
  4904. bp = [ b ];
  4905. // Parentless nodes are either documents or disconnected
  4906. if ( !aup || !bup ) {
  4907. return a === document ? -1 :
  4908. b === document ? 1 :
  4909. aup ? -1 :
  4910. bup ? 1 :
  4911. sortInput ?
  4912. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4913. 0;
  4914. // If the nodes are siblings, we can do a quick check
  4915. } else if ( aup === bup ) {
  4916. return siblingCheck( a, b );
  4917. }
  4918. // Otherwise we need full lists of their ancestors for comparison
  4919. cur = a;
  4920. while ( (cur = cur.parentNode) ) {
  4921. ap.unshift( cur );
  4922. }
  4923. cur = b;
  4924. while ( (cur = cur.parentNode) ) {
  4925. bp.unshift( cur );
  4926. }
  4927. // Walk down the tree looking for a discrepancy
  4928. while ( ap[i] === bp[i] ) {
  4929. i++;
  4930. }
  4931. return i ?
  4932. // Do a sibling check if the nodes have a common ancestor
  4933. siblingCheck( ap[i], bp[i] ) :
  4934. // Otherwise nodes in our document sort first
  4935. ap[i] === preferredDoc ? -1 :
  4936. bp[i] === preferredDoc ? 1 :
  4937. 0;
  4938. };
  4939. return document;
  4940. };
  4941. Sizzle.matches = function( expr, elements ) {
  4942. return Sizzle( expr, null, null, elements );
  4943. };
  4944. Sizzle.matchesSelector = function( elem, expr ) {
  4945. // Set document vars if needed
  4946. if ( ( elem.ownerDocument || elem ) !== document ) {
  4947. setDocument( elem );
  4948. }
  4949. // Make sure that attribute selectors are quoted
  4950. expr = expr.replace( rattributeQuotes, "='$1']" );
  4951. if ( support.matchesSelector && documentIsHTML &&
  4952. !compilerCache[ expr + " " ] &&
  4953. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  4954. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  4955. try {
  4956. var ret = matches.call( elem, expr );
  4957. // IE 9's matchesSelector returns false on disconnected nodes
  4958. if ( ret || support.disconnectedMatch ||
  4959. // As well, disconnected nodes are said to be in a document
  4960. // fragment in IE 9
  4961. elem.document && elem.document.nodeType !== 11 ) {
  4962. return ret;
  4963. }
  4964. } catch (e) {}
  4965. }
  4966. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  4967. };
  4968. Sizzle.contains = function( context, elem ) {
  4969. // Set document vars if needed
  4970. if ( ( context.ownerDocument || context ) !== document ) {
  4971. setDocument( context );
  4972. }
  4973. return contains( context, elem );
  4974. };
  4975. Sizzle.attr = function( elem, name ) {
  4976. // Set document vars if needed
  4977. if ( ( elem.ownerDocument || elem ) !== document ) {
  4978. setDocument( elem );
  4979. }
  4980. var fn = Expr.attrHandle[ name.toLowerCase() ],
  4981. // Don't get fooled by Object.prototype properties (jQuery #13807)
  4982. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  4983. fn( elem, name, !documentIsHTML ) :
  4984. undefined;
  4985. return val !== undefined ?
  4986. val :
  4987. support.attributes || !documentIsHTML ?
  4988. elem.getAttribute( name ) :
  4989. (val = elem.getAttributeNode(name)) && val.specified ?
  4990. val.value :
  4991. null;
  4992. };
  4993. Sizzle.escape = function( sel ) {
  4994. return (sel + "").replace( rcssescape, fcssescape );
  4995. };
  4996. Sizzle.error = function( msg ) {
  4997. throw new Error( "Syntax error, unrecognized expression: " + msg );
  4998. };
  4999. /**
  5000. * Document sorting and removing duplicates
  5001. * @param {ArrayLike} results
  5002. */
  5003. Sizzle.uniqueSort = function( results ) {
  5004. var elem,
  5005. duplicates = [],
  5006. j = 0,
  5007. i = 0;
  5008. // Unless we *know* we can detect duplicates, assume their presence
  5009. hasDuplicate = !support.detectDuplicates;
  5010. sortInput = !support.sortStable && results.slice( 0 );
  5011. results.sort( sortOrder );
  5012. if ( hasDuplicate ) {
  5013. while ( (elem = results[i++]) ) {
  5014. if ( elem === results[ i ] ) {
  5015. j = duplicates.push( i );
  5016. }
  5017. }
  5018. while ( j-- ) {
  5019. results.splice( duplicates[ j ], 1 );
  5020. }
  5021. }
  5022. // Clear input after sorting to release objects
  5023. // See https://github.com/jquery/sizzle/pull/225
  5024. sortInput = null;
  5025. return results;
  5026. };
  5027. /**
  5028. * Utility function for retrieving the text value of an array of DOM nodes
  5029. * @param {Array|Element} elem
  5030. */
  5031. getText = Sizzle.getText = function( elem ) {
  5032. var node,
  5033. ret = "",
  5034. i = 0,
  5035. nodeType = elem.nodeType;
  5036. if ( !nodeType ) {
  5037. // If no nodeType, this is expected to be an array
  5038. while ( (node = elem[i++]) ) {
  5039. // Do not traverse comment nodes
  5040. ret += getText( node );
  5041. }
  5042. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  5043. // Use textContent for elements
  5044. // innerText usage removed for consistency of new lines (jQuery #11153)
  5045. if ( typeof elem.textContent === "string" ) {
  5046. return elem.textContent;
  5047. } else {
  5048. // Traverse its children
  5049. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5050. ret += getText( elem );
  5051. }
  5052. }
  5053. } else if ( nodeType === 3 || nodeType === 4 ) {
  5054. return elem.nodeValue;
  5055. }
  5056. // Do not include comment or processing instruction nodes
  5057. return ret;
  5058. };
  5059. Expr = Sizzle.selectors = {
  5060. // Can be adjusted by the user
  5061. cacheLength: 50,
  5062. createPseudo: markFunction,
  5063. match: matchExpr,
  5064. attrHandle: {},
  5065. find: {},
  5066. relative: {
  5067. ">": { dir: "parentNode", first: true },
  5068. " ": { dir: "parentNode" },
  5069. "+": { dir: "previousSibling", first: true },
  5070. "~": { dir: "previousSibling" }
  5071. },
  5072. preFilter: {
  5073. "ATTR": function( match ) {
  5074. match[1] = match[1].replace( runescape, funescape );
  5075. // Move the given value to match[3] whether quoted or unquoted
  5076. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  5077. if ( match[2] === "~=" ) {
  5078. match[3] = " " + match[3] + " ";
  5079. }
  5080. return match.slice( 0, 4 );
  5081. },
  5082. "CHILD": function( match ) {
  5083. /* matches from matchExpr["CHILD"]
  5084. 1 type (only|nth|...)
  5085. 2 what (child|of-type)
  5086. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  5087. 4 xn-component of xn+y argument ([+-]?\d*n|)
  5088. 5 sign of xn-component
  5089. 6 x of xn-component
  5090. 7 sign of y-component
  5091. 8 y of y-component
  5092. */
  5093. match[1] = match[1].toLowerCase();
  5094. if ( match[1].slice( 0, 3 ) === "nth" ) {
  5095. // nth-* requires argument
  5096. if ( !match[3] ) {
  5097. Sizzle.error( match[0] );
  5098. }
  5099. // numeric x and y parameters for Expr.filter.CHILD
  5100. // remember that false/true cast respectively to 0/1
  5101. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  5102. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  5103. // other types prohibit arguments
  5104. } else if ( match[3] ) {
  5105. Sizzle.error( match[0] );
  5106. }
  5107. return match;
  5108. },
  5109. "PSEUDO": function( match ) {
  5110. var excess,
  5111. unquoted = !match[6] && match[2];
  5112. if ( matchExpr["CHILD"].test( match[0] ) ) {
  5113. return null;
  5114. }
  5115. // Accept quoted arguments as-is
  5116. if ( match[3] ) {
  5117. match[2] = match[4] || match[5] || "";
  5118. // Strip excess characters from unquoted arguments
  5119. } else if ( unquoted && rpseudo.test( unquoted ) &&
  5120. // Get excess from tokenize (recursively)
  5121. (excess = tokenize( unquoted, true )) &&
  5122. // advance to the next closing parenthesis
  5123. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  5124. // excess is a negative index
  5125. match[0] = match[0].slice( 0, excess );
  5126. match[2] = unquoted.slice( 0, excess );
  5127. }
  5128. // Return only captures needed by the pseudo filter method (type and argument)
  5129. return match.slice( 0, 3 );
  5130. }
  5131. },
  5132. filter: {
  5133. "TAG": function( nodeNameSelector ) {
  5134. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  5135. return nodeNameSelector === "*" ?
  5136. function() { return true; } :
  5137. function( elem ) {
  5138. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  5139. };
  5140. },
  5141. "CLASS": function( className ) {
  5142. var pattern = classCache[ className + " " ];
  5143. return pattern ||
  5144. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  5145. classCache( className, function( elem ) {
  5146. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  5147. });
  5148. },
  5149. "ATTR": function( name, operator, check ) {
  5150. return function( elem ) {
  5151. var result = Sizzle.attr( elem, name );
  5152. if ( result == null ) {
  5153. return operator === "!=";
  5154. }
  5155. if ( !operator ) {
  5156. return true;
  5157. }
  5158. result += "";
  5159. return operator === "=" ? result === check :
  5160. operator === "!=" ? result !== check :
  5161. operator === "^=" ? check && result.indexOf( check ) === 0 :
  5162. operator === "*=" ? check && result.indexOf( check ) > -1 :
  5163. operator === "$=" ? check && result.slice( -check.length ) === check :
  5164. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  5165. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  5166. false;
  5167. };
  5168. },
  5169. "CHILD": function( type, what, argument, first, last ) {
  5170. var simple = type.slice( 0, 3 ) !== "nth",
  5171. forward = type.slice( -4 ) !== "last",
  5172. ofType = what === "of-type";
  5173. return first === 1 && last === 0 ?
  5174. // Shortcut for :nth-*(n)
  5175. function( elem ) {
  5176. return !!elem.parentNode;
  5177. } :
  5178. function( elem, context, xml ) {
  5179. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  5180. dir = simple !== forward ? "nextSibling" : "previousSibling",
  5181. parent = elem.parentNode,
  5182. name = ofType && elem.nodeName.toLowerCase(),
  5183. useCache = !xml && !ofType,
  5184. diff = false;
  5185. if ( parent ) {
  5186. // :(first|last|only)-(child|of-type)
  5187. if ( simple ) {
  5188. while ( dir ) {
  5189. node = elem;
  5190. while ( (node = node[ dir ]) ) {
  5191. if ( ofType ?
  5192. node.nodeName.toLowerCase() === name :
  5193. node.nodeType === 1 ) {
  5194. return false;
  5195. }
  5196. }
  5197. // Reverse direction for :only-* (if we haven't yet done so)
  5198. start = dir = type === "only" && !start && "nextSibling";
  5199. }
  5200. return true;
  5201. }
  5202. start = [ forward ? parent.firstChild : parent.lastChild ];
  5203. // non-xml :nth-child(...) stores cache data on `parent`
  5204. if ( forward && useCache ) {
  5205. // Seek `elem` from a previously-cached index
  5206. // ...in a gzip-friendly way
  5207. node = parent;
  5208. outerCache = node[ expando ] || (node[ expando ] = {});
  5209. // Support: IE <9 only
  5210. // Defend against cloned attroperties (jQuery gh-1709)
  5211. uniqueCache = outerCache[ node.uniqueID ] ||
  5212. (outerCache[ node.uniqueID ] = {});
  5213. cache = uniqueCache[ type ] || [];
  5214. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5215. diff = nodeIndex && cache[ 2 ];
  5216. node = nodeIndex && parent.childNodes[ nodeIndex ];
  5217. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5218. // Fallback to seeking `elem` from the start
  5219. (diff = nodeIndex = 0) || start.pop()) ) {
  5220. // When found, cache indexes on `parent` and break
  5221. if ( node.nodeType === 1 && ++diff && node === elem ) {
  5222. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  5223. break;
  5224. }
  5225. }
  5226. } else {
  5227. // Use previously-cached element index if available
  5228. if ( useCache ) {
  5229. // ...in a gzip-friendly way
  5230. node = elem;
  5231. outerCache = node[ expando ] || (node[ expando ] = {});
  5232. // Support: IE <9 only
  5233. // Defend against cloned attroperties (jQuery gh-1709)
  5234. uniqueCache = outerCache[ node.uniqueID ] ||
  5235. (outerCache[ node.uniqueID ] = {});
  5236. cache = uniqueCache[ type ] || [];
  5237. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5238. diff = nodeIndex;
  5239. }
  5240. // xml :nth-child(...)
  5241. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  5242. if ( diff === false ) {
  5243. // Use the same loop as above to seek `elem` from the start
  5244. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5245. (diff = nodeIndex = 0) || start.pop()) ) {
  5246. if ( ( ofType ?
  5247. node.nodeName.toLowerCase() === name :
  5248. node.nodeType === 1 ) &&
  5249. ++diff ) {
  5250. // Cache the index of each encountered element
  5251. if ( useCache ) {
  5252. outerCache = node[ expando ] || (node[ expando ] = {});
  5253. // Support: IE <9 only
  5254. // Defend against cloned attroperties (jQuery gh-1709)
  5255. uniqueCache = outerCache[ node.uniqueID ] ||
  5256. (outerCache[ node.uniqueID ] = {});
  5257. uniqueCache[ type ] = [ dirruns, diff ];
  5258. }
  5259. if ( node === elem ) {
  5260. break;
  5261. }
  5262. }
  5263. }
  5264. }
  5265. }
  5266. // Incorporate the offset, then check against cycle size
  5267. diff -= last;
  5268. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  5269. }
  5270. };
  5271. },
  5272. "PSEUDO": function( pseudo, argument ) {
  5273. // pseudo-class names are case-insensitive
  5274. // http://www.w3.org/TR/selectors/#pseudo-classes
  5275. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  5276. // Remember that setFilters inherits from pseudos
  5277. var args,
  5278. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  5279. Sizzle.error( "unsupported pseudo: " + pseudo );
  5280. // The user may use createPseudo to indicate that
  5281. // arguments are needed to create the filter function
  5282. // just as Sizzle does
  5283. if ( fn[ expando ] ) {
  5284. return fn( argument );
  5285. }
  5286. // But maintain support for old signatures
  5287. if ( fn.length > 1 ) {
  5288. args = [ pseudo, pseudo, "", argument ];
  5289. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  5290. markFunction(function( seed, matches ) {
  5291. var idx,
  5292. matched = fn( seed, argument ),
  5293. i = matched.length;
  5294. while ( i-- ) {
  5295. idx = indexOf( seed, matched[i] );
  5296. seed[ idx ] = !( matches[ idx ] = matched[i] );
  5297. }
  5298. }) :
  5299. function( elem ) {
  5300. return fn( elem, 0, args );
  5301. };
  5302. }
  5303. return fn;
  5304. }
  5305. },
  5306. pseudos: {
  5307. // Potentially complex pseudos
  5308. "not": markFunction(function( selector ) {
  5309. // Trim the selector passed to compile
  5310. // to avoid treating leading and trailing
  5311. // spaces as combinators
  5312. var input = [],
  5313. results = [],
  5314. matcher = compile( selector.replace( rtrim, "$1" ) );
  5315. return matcher[ expando ] ?
  5316. markFunction(function( seed, matches, context, xml ) {
  5317. var elem,
  5318. unmatched = matcher( seed, null, xml, [] ),
  5319. i = seed.length;
  5320. // Match elements unmatched by `matcher`
  5321. while ( i-- ) {
  5322. if ( (elem = unmatched[i]) ) {
  5323. seed[i] = !(matches[i] = elem);
  5324. }
  5325. }
  5326. }) :
  5327. function( elem, context, xml ) {
  5328. input[0] = elem;
  5329. matcher( input, null, xml, results );
  5330. // Don't keep the element (issue #299)
  5331. input[0] = null;
  5332. return !results.pop();
  5333. };
  5334. }),
  5335. "has": markFunction(function( selector ) {
  5336. return function( elem ) {
  5337. return Sizzle( selector, elem ).length > 0;
  5338. };
  5339. }),
  5340. "contains": markFunction(function( text ) {
  5341. text = text.replace( runescape, funescape );
  5342. return function( elem ) {
  5343. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  5344. };
  5345. }),
  5346. // "Whether an element is represented by a :lang() selector
  5347. // is based solely on the element's language value
  5348. // being equal to the identifier C,
  5349. // or beginning with the identifier C immediately followed by "-".
  5350. // The matching of C against the element's language value is performed case-insensitively.
  5351. // The identifier C does not have to be a valid language name."
  5352. // http://www.w3.org/TR/selectors/#lang-pseudo
  5353. "lang": markFunction( function( lang ) {
  5354. // lang value must be a valid identifier
  5355. if ( !ridentifier.test(lang || "") ) {
  5356. Sizzle.error( "unsupported lang: " + lang );
  5357. }
  5358. lang = lang.replace( runescape, funescape ).toLowerCase();
  5359. return function( elem ) {
  5360. var elemLang;
  5361. do {
  5362. if ( (elemLang = documentIsHTML ?
  5363. elem.lang :
  5364. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  5365. elemLang = elemLang.toLowerCase();
  5366. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  5367. }
  5368. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  5369. return false;
  5370. };
  5371. }),
  5372. // Miscellaneous
  5373. "target": function( elem ) {
  5374. var hash = window.location && window.location.hash;
  5375. return hash && hash.slice( 1 ) === elem.id;
  5376. },
  5377. "root": function( elem ) {
  5378. return elem === docElem;
  5379. },
  5380. "focus": function( elem ) {
  5381. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  5382. },
  5383. // Boolean properties
  5384. "enabled": createDisabledPseudo( false ),
  5385. "disabled": createDisabledPseudo( true ),
  5386. "checked": function( elem ) {
  5387. // In CSS3, :checked should return both checked and selected elements
  5388. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  5389. var nodeName = elem.nodeName.toLowerCase();
  5390. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  5391. },
  5392. "selected": function( elem ) {
  5393. // Accessing this property makes selected-by-default
  5394. // options in Safari work properly
  5395. if ( elem.parentNode ) {
  5396. elem.parentNode.selectedIndex;
  5397. }
  5398. return elem.selected === true;
  5399. },
  5400. // Contents
  5401. "empty": function( elem ) {
  5402. // http://www.w3.org/TR/selectors/#empty-pseudo
  5403. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  5404. // but not by others (comment: 8; processing instruction: 7; etc.)
  5405. // nodeType < 6 works because attributes (2) do not appear as children
  5406. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5407. if ( elem.nodeType < 6 ) {
  5408. return false;
  5409. }
  5410. }
  5411. return true;
  5412. },
  5413. "parent": function( elem ) {
  5414. return !Expr.pseudos["empty"]( elem );
  5415. },
  5416. // Element/input types
  5417. "header": function( elem ) {
  5418. return rheader.test( elem.nodeName );
  5419. },
  5420. "input": function( elem ) {
  5421. return rinputs.test( elem.nodeName );
  5422. },
  5423. "button": function( elem ) {
  5424. var name = elem.nodeName.toLowerCase();
  5425. return name === "input" && elem.type === "button" || name === "button";
  5426. },
  5427. "text": function( elem ) {
  5428. var attr;
  5429. return elem.nodeName.toLowerCase() === "input" &&
  5430. elem.type === "text" &&
  5431. // Support: IE<8
  5432. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  5433. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  5434. },
  5435. // Position-in-collection
  5436. "first": createPositionalPseudo(function() {
  5437. return [ 0 ];
  5438. }),
  5439. "last": createPositionalPseudo(function( matchIndexes, length ) {
  5440. return [ length - 1 ];
  5441. }),
  5442. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5443. return [ argument < 0 ? argument + length : argument ];
  5444. }),
  5445. "even": createPositionalPseudo(function( matchIndexes, length ) {
  5446. var i = 0;
  5447. for ( ; i < length; i += 2 ) {
  5448. matchIndexes.push( i );
  5449. }
  5450. return matchIndexes;
  5451. }),
  5452. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  5453. var i = 1;
  5454. for ( ; i < length; i += 2 ) {
  5455. matchIndexes.push( i );
  5456. }
  5457. return matchIndexes;
  5458. }),
  5459. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5460. var i = argument < 0 ? argument + length : argument;
  5461. for ( ; --i >= 0; ) {
  5462. matchIndexes.push( i );
  5463. }
  5464. return matchIndexes;
  5465. }),
  5466. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5467. var i = argument < 0 ? argument + length : argument;
  5468. for ( ; ++i < length; ) {
  5469. matchIndexes.push( i );
  5470. }
  5471. return matchIndexes;
  5472. })
  5473. }
  5474. };
  5475. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  5476. // Add button/input type pseudos
  5477. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  5478. Expr.pseudos[ i ] = createInputPseudo( i );
  5479. }
  5480. for ( i in { submit: true, reset: true } ) {
  5481. Expr.pseudos[ i ] = createButtonPseudo( i );
  5482. }
  5483. // Easy API for creating new setFilters
  5484. function setFilters() {}
  5485. setFilters.prototype = Expr.filters = Expr.pseudos;
  5486. Expr.setFilters = new setFilters();
  5487. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  5488. var matched, match, tokens, type,
  5489. soFar, groups, preFilters,
  5490. cached = tokenCache[ selector + " " ];
  5491. if ( cached ) {
  5492. return parseOnly ? 0 : cached.slice( 0 );
  5493. }
  5494. soFar = selector;
  5495. groups = [];
  5496. preFilters = Expr.preFilter;
  5497. while ( soFar ) {
  5498. // Comma and first run
  5499. if ( !matched || (match = rcomma.exec( soFar )) ) {
  5500. if ( match ) {
  5501. // Don't consume trailing commas as valid
  5502. soFar = soFar.slice( match[0].length ) || soFar;
  5503. }
  5504. groups.push( (tokens = []) );
  5505. }
  5506. matched = false;
  5507. // Combinators
  5508. if ( (match = rcombinators.exec( soFar )) ) {
  5509. matched = match.shift();
  5510. tokens.push({
  5511. value: matched,
  5512. // Cast descendant combinators to space
  5513. type: match[0].replace( rtrim, " " )
  5514. });
  5515. soFar = soFar.slice( matched.length );
  5516. }
  5517. // Filters
  5518. for ( type in Expr.filter ) {
  5519. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  5520. (match = preFilters[ type ]( match ))) ) {
  5521. matched = match.shift();
  5522. tokens.push({
  5523. value: matched,
  5524. type: type,
  5525. matches: match
  5526. });
  5527. soFar = soFar.slice( matched.length );
  5528. }
  5529. }
  5530. if ( !matched ) {
  5531. break;
  5532. }
  5533. }
  5534. // Return the length of the invalid excess
  5535. // if we're just parsing
  5536. // Otherwise, throw an error or return tokens
  5537. return parseOnly ?
  5538. soFar.length :
  5539. soFar ?
  5540. Sizzle.error( selector ) :
  5541. // Cache the tokens
  5542. tokenCache( selector, groups ).slice( 0 );
  5543. };
  5544. function toSelector( tokens ) {
  5545. var i = 0,
  5546. len = tokens.length,
  5547. selector = "";
  5548. for ( ; i < len; i++ ) {
  5549. selector += tokens[i].value;
  5550. }
  5551. return selector;
  5552. }
  5553. function addCombinator( matcher, combinator, base ) {
  5554. var dir = combinator.dir,
  5555. skip = combinator.next,
  5556. key = skip || dir,
  5557. checkNonElements = base && key === "parentNode",
  5558. doneName = done++;
  5559. return combinator.first ?
  5560. // Check against closest ancestor/preceding element
  5561. function( elem, context, xml ) {
  5562. while ( (elem = elem[ dir ]) ) {
  5563. if ( elem.nodeType === 1 || checkNonElements ) {
  5564. return matcher( elem, context, xml );
  5565. }
  5566. }
  5567. return false;
  5568. } :
  5569. // Check against all ancestor/preceding elements
  5570. function( elem, context, xml ) {
  5571. var oldCache, uniqueCache, outerCache,
  5572. newCache = [ dirruns, doneName ];
  5573. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  5574. if ( xml ) {
  5575. while ( (elem = elem[ dir ]) ) {
  5576. if ( elem.nodeType === 1 || checkNonElements ) {
  5577. if ( matcher( elem, context, xml ) ) {
  5578. return true;
  5579. }
  5580. }
  5581. }
  5582. } else {
  5583. while ( (elem = elem[ dir ]) ) {
  5584. if ( elem.nodeType === 1 || checkNonElements ) {
  5585. outerCache = elem[ expando ] || (elem[ expando ] = {});
  5586. // Support: IE <9 only
  5587. // Defend against cloned attroperties (jQuery gh-1709)
  5588. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  5589. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  5590. elem = elem[ dir ] || elem;
  5591. } else if ( (oldCache = uniqueCache[ key ]) &&
  5592. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  5593. // Assign to newCache so results back-propagate to previous elements
  5594. return (newCache[ 2 ] = oldCache[ 2 ]);
  5595. } else {
  5596. // Reuse newcache so results back-propagate to previous elements
  5597. uniqueCache[ key ] = newCache;
  5598. // A match means we're done; a fail means we have to keep checking
  5599. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  5600. return true;
  5601. }
  5602. }
  5603. }
  5604. }
  5605. }
  5606. return false;
  5607. };
  5608. }
  5609. function elementMatcher( matchers ) {
  5610. return matchers.length > 1 ?
  5611. function( elem, context, xml ) {
  5612. var i = matchers.length;
  5613. while ( i-- ) {
  5614. if ( !matchers[i]( elem, context, xml ) ) {
  5615. return false;
  5616. }
  5617. }
  5618. return true;
  5619. } :
  5620. matchers[0];
  5621. }
  5622. function multipleContexts( selector, contexts, results ) {
  5623. var i = 0,
  5624. len = contexts.length;
  5625. for ( ; i < len; i++ ) {
  5626. Sizzle( selector, contexts[i], results );
  5627. }
  5628. return results;
  5629. }
  5630. function condense( unmatched, map, filter, context, xml ) {
  5631. var elem,
  5632. newUnmatched = [],
  5633. i = 0,
  5634. len = unmatched.length,
  5635. mapped = map != null;
  5636. for ( ; i < len; i++ ) {
  5637. if ( (elem = unmatched[i]) ) {
  5638. if ( !filter || filter( elem, context, xml ) ) {
  5639. newUnmatched.push( elem );
  5640. if ( mapped ) {
  5641. map.push( i );
  5642. }
  5643. }
  5644. }
  5645. }
  5646. return newUnmatched;
  5647. }
  5648. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  5649. if ( postFilter && !postFilter[ expando ] ) {
  5650. postFilter = setMatcher( postFilter );
  5651. }
  5652. if ( postFinder && !postFinder[ expando ] ) {
  5653. postFinder = setMatcher( postFinder, postSelector );
  5654. }
  5655. return markFunction(function( seed, results, context, xml ) {
  5656. var temp, i, elem,
  5657. preMap = [],
  5658. postMap = [],
  5659. preexisting = results.length,
  5660. // Get initial elements from seed or context
  5661. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  5662. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  5663. matcherIn = preFilter && ( seed || !selector ) ?
  5664. condense( elems, preMap, preFilter, context, xml ) :
  5665. elems,
  5666. matcherOut = matcher ?
  5667. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  5668. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  5669. // ...intermediate processing is necessary
  5670. [] :
  5671. // ...otherwise use results directly
  5672. results :
  5673. matcherIn;
  5674. // Find primary matches
  5675. if ( matcher ) {
  5676. matcher( matcherIn, matcherOut, context, xml );
  5677. }
  5678. // Apply postFilter
  5679. if ( postFilter ) {
  5680. temp = condense( matcherOut, postMap );
  5681. postFilter( temp, [], context, xml );
  5682. // Un-match failing elements by moving them back to matcherIn
  5683. i = temp.length;
  5684. while ( i-- ) {
  5685. if ( (elem = temp[i]) ) {
  5686. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  5687. }
  5688. }
  5689. }
  5690. if ( seed ) {
  5691. if ( postFinder || preFilter ) {
  5692. if ( postFinder ) {
  5693. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  5694. temp = [];
  5695. i = matcherOut.length;
  5696. while ( i-- ) {
  5697. if ( (elem = matcherOut[i]) ) {
  5698. // Restore matcherIn since elem is not yet a final match
  5699. temp.push( (matcherIn[i] = elem) );
  5700. }
  5701. }
  5702. postFinder( null, (matcherOut = []), temp, xml );
  5703. }
  5704. // Move matched elements from seed to results to keep them synchronized
  5705. i = matcherOut.length;
  5706. while ( i-- ) {
  5707. if ( (elem = matcherOut[i]) &&
  5708. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  5709. seed[temp] = !(results[temp] = elem);
  5710. }
  5711. }
  5712. }
  5713. // Add elements to results, through postFinder if defined
  5714. } else {
  5715. matcherOut = condense(
  5716. matcherOut === results ?
  5717. matcherOut.splice( preexisting, matcherOut.length ) :
  5718. matcherOut
  5719. );
  5720. if ( postFinder ) {
  5721. postFinder( null, results, matcherOut, xml );
  5722. } else {
  5723. push.apply( results, matcherOut );
  5724. }
  5725. }
  5726. });
  5727. }
  5728. function matcherFromTokens( tokens ) {
  5729. var checkContext, matcher, j,
  5730. len = tokens.length,
  5731. leadingRelative = Expr.relative[ tokens[0].type ],
  5732. implicitRelative = leadingRelative || Expr.relative[" "],
  5733. i = leadingRelative ? 1 : 0,
  5734. // The foundational matcher ensures that elements are reachable from top-level context(s)
  5735. matchContext = addCombinator( function( elem ) {
  5736. return elem === checkContext;
  5737. }, implicitRelative, true ),
  5738. matchAnyContext = addCombinator( function( elem ) {
  5739. return indexOf( checkContext, elem ) > -1;
  5740. }, implicitRelative, true ),
  5741. matchers = [ function( elem, context, xml ) {
  5742. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  5743. (checkContext = context).nodeType ?
  5744. matchContext( elem, context, xml ) :
  5745. matchAnyContext( elem, context, xml ) );
  5746. // Avoid hanging onto element (issue #299)
  5747. checkContext = null;
  5748. return ret;
  5749. } ];
  5750. for ( ; i < len; i++ ) {
  5751. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  5752. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  5753. } else {
  5754. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  5755. // Return special upon seeing a positional matcher
  5756. if ( matcher[ expando ] ) {
  5757. // Find the next relative operator (if any) for proper handling
  5758. j = ++i;
  5759. for ( ; j < len; j++ ) {
  5760. if ( Expr.relative[ tokens[j].type ] ) {
  5761. break;
  5762. }
  5763. }
  5764. return setMatcher(
  5765. i > 1 && elementMatcher( matchers ),
  5766. i > 1 && toSelector(
  5767. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  5768. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  5769. ).replace( rtrim, "$1" ),
  5770. matcher,
  5771. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  5772. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  5773. j < len && toSelector( tokens )
  5774. );
  5775. }
  5776. matchers.push( matcher );
  5777. }
  5778. }
  5779. return elementMatcher( matchers );
  5780. }
  5781. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  5782. var bySet = setMatchers.length > 0,
  5783. byElement = elementMatchers.length > 0,
  5784. superMatcher = function( seed, context, xml, results, outermost ) {
  5785. var elem, j, matcher,
  5786. matchedCount = 0,
  5787. i = "0",
  5788. unmatched = seed && [],
  5789. setMatched = [],
  5790. contextBackup = outermostContext,
  5791. // We must always have either seed elements or outermost context
  5792. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  5793. // Use integer dirruns iff this is the outermost matcher
  5794. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  5795. len = elems.length;
  5796. if ( outermost ) {
  5797. outermostContext = context === document || context || outermost;
  5798. }
  5799. // Add elements passing elementMatchers directly to results
  5800. // Support: IE<9, Safari
  5801. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  5802. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  5803. if ( byElement && elem ) {
  5804. j = 0;
  5805. if ( !context && elem.ownerDocument !== document ) {
  5806. setDocument( elem );
  5807. xml = !documentIsHTML;
  5808. }
  5809. while ( (matcher = elementMatchers[j++]) ) {
  5810. if ( matcher( elem, context || document, xml) ) {
  5811. results.push( elem );
  5812. break;
  5813. }
  5814. }
  5815. if ( outermost ) {
  5816. dirruns = dirrunsUnique;
  5817. }
  5818. }
  5819. // Track unmatched elements for set filters
  5820. if ( bySet ) {
  5821. // They will have gone through all possible matchers
  5822. if ( (elem = !matcher && elem) ) {
  5823. matchedCount--;
  5824. }
  5825. // Lengthen the array for every element, matched or not
  5826. if ( seed ) {
  5827. unmatched.push( elem );
  5828. }
  5829. }
  5830. }
  5831. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  5832. // makes the latter nonnegative.
  5833. matchedCount += i;
  5834. // Apply set filters to unmatched elements
  5835. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  5836. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  5837. // no element matchers and no seed.
  5838. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  5839. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  5840. // numerically zero.
  5841. if ( bySet && i !== matchedCount ) {
  5842. j = 0;
  5843. while ( (matcher = setMatchers[j++]) ) {
  5844. matcher( unmatched, setMatched, context, xml );
  5845. }
  5846. if ( seed ) {
  5847. // Reintegrate element matches to eliminate the need for sorting
  5848. if ( matchedCount > 0 ) {
  5849. while ( i-- ) {
  5850. if ( !(unmatched[i] || setMatched[i]) ) {
  5851. setMatched[i] = pop.call( results );
  5852. }
  5853. }
  5854. }
  5855. // Discard index placeholder values to get only actual matches
  5856. setMatched = condense( setMatched );
  5857. }
  5858. // Add matches to results
  5859. push.apply( results, setMatched );
  5860. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  5861. if ( outermost && !seed && setMatched.length > 0 &&
  5862. ( matchedCount + setMatchers.length ) > 1 ) {
  5863. Sizzle.uniqueSort( results );
  5864. }
  5865. }
  5866. // Override manipulation of globals by nested matchers
  5867. if ( outermost ) {
  5868. dirruns = dirrunsUnique;
  5869. outermostContext = contextBackup;
  5870. }
  5871. return unmatched;
  5872. };
  5873. return bySet ?
  5874. markFunction( superMatcher ) :
  5875. superMatcher;
  5876. }
  5877. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  5878. var i,
  5879. setMatchers = [],
  5880. elementMatchers = [],
  5881. cached = compilerCache[ selector + " " ];
  5882. if ( !cached ) {
  5883. // Generate a function of recursive functions that can be used to check each element
  5884. if ( !match ) {
  5885. match = tokenize( selector );
  5886. }
  5887. i = match.length;
  5888. while ( i-- ) {
  5889. cached = matcherFromTokens( match[i] );
  5890. if ( cached[ expando ] ) {
  5891. setMatchers.push( cached );
  5892. } else {
  5893. elementMatchers.push( cached );
  5894. }
  5895. }
  5896. // Cache the compiled function
  5897. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  5898. // Save selector and tokenization
  5899. cached.selector = selector;
  5900. }
  5901. return cached;
  5902. };
  5903. /**
  5904. * A low-level selection function that works with Sizzle's compiled
  5905. * selector functions
  5906. * @param {String|Function} selector A selector or a pre-compiled
  5907. * selector function built with Sizzle.compile
  5908. * @param {Element} context
  5909. * @param {Array} [results]
  5910. * @param {Array} [seed] A set of elements to match against
  5911. */
  5912. select = Sizzle.select = function( selector, context, results, seed ) {
  5913. var i, tokens, token, type, find,
  5914. compiled = typeof selector === "function" && selector,
  5915. match = !seed && tokenize( (selector = compiled.selector || selector) );
  5916. results = results || [];
  5917. // Try to minimize operations if there is only one selector in the list and no seed
  5918. // (the latter of which guarantees us context)
  5919. if ( match.length === 1 ) {
  5920. // Reduce context if the leading compound selector is an ID
  5921. tokens = match[0] = match[0].slice( 0 );
  5922. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  5923. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  5924. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  5925. if ( !context ) {
  5926. return results;
  5927. // Precompiled matchers will still verify ancestry, so step up a level
  5928. } else if ( compiled ) {
  5929. context = context.parentNode;
  5930. }
  5931. selector = selector.slice( tokens.shift().value.length );
  5932. }
  5933. // Fetch a seed set for right-to-left matching
  5934. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  5935. while ( i-- ) {
  5936. token = tokens[i];
  5937. // Abort if we hit a combinator
  5938. if ( Expr.relative[ (type = token.type) ] ) {
  5939. break;
  5940. }
  5941. if ( (find = Expr.find[ type ]) ) {
  5942. // Search, expanding context for leading sibling combinators
  5943. if ( (seed = find(
  5944. token.matches[0].replace( runescape, funescape ),
  5945. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  5946. )) ) {
  5947. // If seed is empty or no tokens remain, we can return early
  5948. tokens.splice( i, 1 );
  5949. selector = seed.length && toSelector( tokens );
  5950. if ( !selector ) {
  5951. push.apply( results, seed );
  5952. return results;
  5953. }
  5954. break;
  5955. }
  5956. }
  5957. }
  5958. }
  5959. // Compile and execute a filtering function if one is not provided
  5960. // Provide `match` to avoid retokenization if we modified the selector above
  5961. ( compiled || compile( selector, match ) )(
  5962. seed,
  5963. context,
  5964. !documentIsHTML,
  5965. results,
  5966. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  5967. );
  5968. return results;
  5969. };
  5970. // One-time assignments
  5971. // Sort stability
  5972. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  5973. // Support: Chrome 14-35+
  5974. // Always assume duplicates if they aren't passed to the comparison function
  5975. support.detectDuplicates = !!hasDuplicate;
  5976. // Initialize against the default document
  5977. setDocument();
  5978. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  5979. // Detached nodes confoundingly follow *each other*
  5980. support.sortDetached = assert(function( el ) {
  5981. // Should return 1, but returns 4 (following)
  5982. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  5983. });
  5984. // Support: IE<8
  5985. // Prevent attribute/property "interpolation"
  5986. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  5987. if ( !assert(function( el ) {
  5988. el.innerHTML = "<a href='#'></a>";
  5989. return el.firstChild.getAttribute("href") === "#" ;
  5990. }) ) {
  5991. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  5992. if ( !isXML ) {
  5993. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  5994. }
  5995. });
  5996. }
  5997. // Support: IE<9
  5998. // Use defaultValue in place of getAttribute("value")
  5999. if ( !support.attributes || !assert(function( el ) {
  6000. el.innerHTML = "<input/>";
  6001. el.firstChild.setAttribute( "value", "" );
  6002. return el.firstChild.getAttribute( "value" ) === "";
  6003. }) ) {
  6004. addHandle( "value", function( elem, name, isXML ) {
  6005. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  6006. return elem.defaultValue;
  6007. }
  6008. });
  6009. }
  6010. // Support: IE<9
  6011. // Use getAttributeNode to fetch booleans when getAttribute lies
  6012. if ( !assert(function( el ) {
  6013. return el.getAttribute("disabled") == null;
  6014. }) ) {
  6015. addHandle( booleans, function( elem, name, isXML ) {
  6016. var val;
  6017. if ( !isXML ) {
  6018. return elem[ name ] === true ? name.toLowerCase() :
  6019. (val = elem.getAttributeNode( name )) && val.specified ?
  6020. val.value :
  6021. null;
  6022. }
  6023. });
  6024. }
  6025. return Sizzle;
  6026. })( window );
  6027. jQuery.find = Sizzle;
  6028. jQuery.expr = Sizzle.selectors;
  6029. // Deprecated
  6030. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  6031. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  6032. jQuery.text = Sizzle.getText;
  6033. jQuery.isXMLDoc = Sizzle.isXML;
  6034. jQuery.contains = Sizzle.contains;
  6035. jQuery.escapeSelector = Sizzle.escape;
  6036. var dir = function( elem, dir, until ) {
  6037. var matched = [],
  6038. truncate = until !== undefined;
  6039. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  6040. if ( elem.nodeType === 1 ) {
  6041. if ( truncate && jQuery( elem ).is( until ) ) {
  6042. break;
  6043. }
  6044. matched.push( elem );
  6045. }
  6046. }
  6047. return matched;
  6048. };
  6049. var siblings = function( n, elem ) {
  6050. var matched = [];
  6051. for ( ; n; n = n.nextSibling ) {
  6052. if ( n.nodeType === 1 && n !== elem ) {
  6053. matched.push( n );
  6054. }
  6055. }
  6056. return matched;
  6057. };
  6058. var rneedsContext = jQuery.expr.match.needsContext;
  6059. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  6060. var risSimple = /^.[^:#\[\.,]*$/;
  6061. // Implement the identical functionality for filter and not
  6062. function winnow( elements, qualifier, not ) {
  6063. if ( jQuery.isFunction( qualifier ) ) {
  6064. return jQuery.grep( elements, function( elem, i ) {
  6065. return !!qualifier.call( elem, i, elem ) !== not;
  6066. } );
  6067. }
  6068. // Single element
  6069. if ( qualifier.nodeType ) {
  6070. return jQuery.grep( elements, function( elem ) {
  6071. return ( elem === qualifier ) !== not;
  6072. } );
  6073. }
  6074. // Arraylike of elements (jQuery, arguments, Array)
  6075. if ( typeof qualifier !== "string" ) {
  6076. return jQuery.grep( elements, function( elem ) {
  6077. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  6078. } );
  6079. }
  6080. // Simple selector that can be filtered directly, removing non-Elements
  6081. if ( risSimple.test( qualifier ) ) {
  6082. return jQuery.filter( qualifier, elements, not );
  6083. }
  6084. // Complex selector, compare the two sets, removing non-Elements
  6085. qualifier = jQuery.filter( qualifier, elements );
  6086. return jQuery.grep( elements, function( elem ) {
  6087. return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
  6088. } );
  6089. }
  6090. jQuery.filter = function( expr, elems, not ) {
  6091. var elem = elems[ 0 ];
  6092. if ( not ) {
  6093. expr = ":not(" + expr + ")";
  6094. }
  6095. if ( elems.length === 1 && elem.nodeType === 1 ) {
  6096. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  6097. }
  6098. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  6099. return elem.nodeType === 1;
  6100. } ) );
  6101. };
  6102. jQuery.fn.extend( {
  6103. find: function( selector ) {
  6104. var i, ret,
  6105. len = this.length,
  6106. self = this;
  6107. if ( typeof selector !== "string" ) {
  6108. return this.pushStack( jQuery( selector ).filter( function() {
  6109. for ( i = 0; i < len; i++ ) {
  6110. if ( jQuery.contains( self[ i ], this ) ) {
  6111. return true;
  6112. }
  6113. }
  6114. } ) );
  6115. }
  6116. ret = this.pushStack( [] );
  6117. for ( i = 0; i < len; i++ ) {
  6118. jQuery.find( selector, self[ i ], ret );
  6119. }
  6120. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  6121. },
  6122. filter: function( selector ) {
  6123. return this.pushStack( winnow( this, selector || [], false ) );
  6124. },
  6125. not: function( selector ) {
  6126. return this.pushStack( winnow( this, selector || [], true ) );
  6127. },
  6128. is: function( selector ) {
  6129. return !!winnow(
  6130. this,
  6131. // If this is a positional/relative selector, check membership in the returned set
  6132. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  6133. typeof selector === "string" && rneedsContext.test( selector ) ?
  6134. jQuery( selector ) :
  6135. selector || [],
  6136. false
  6137. ).length;
  6138. }
  6139. } );
  6140. // Initialize a jQuery object
  6141. // A central reference to the root jQuery(document)
  6142. var rootjQuery,
  6143. // A simple way to check for HTML strings
  6144. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  6145. // Strict HTML recognition (#11290: must start with <)
  6146. // Shortcut simple #id case for speed
  6147. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  6148. init = jQuery.fn.init = function( selector, context, root ) {
  6149. var match, elem;
  6150. // HANDLE: $(""), $(null), $(undefined), $(false)
  6151. if ( !selector ) {
  6152. return this;
  6153. }
  6154. // Method init() accepts an alternate rootjQuery
  6155. // so migrate can support jQuery.sub (gh-2101)
  6156. root = root || rootjQuery;
  6157. // Handle HTML strings
  6158. if ( typeof selector === "string" ) {
  6159. if ( selector[ 0 ] === "<" &&
  6160. selector[ selector.length - 1 ] === ">" &&
  6161. selector.length >= 3 ) {
  6162. // Assume that strings that start and end with <> are HTML and skip the regex check
  6163. match = [ null, selector, null ];
  6164. } else {
  6165. match = rquickExpr.exec( selector );
  6166. }
  6167. // Match html or make sure no context is specified for #id
  6168. if ( match && ( match[ 1 ] || !context ) ) {
  6169. // HANDLE: $(html) -> $(array)
  6170. if ( match[ 1 ] ) {
  6171. context = context instanceof jQuery ? context[ 0 ] : context;
  6172. // Option to run scripts is true for back-compat
  6173. // Intentionally let the error be thrown if parseHTML is not present
  6174. jQuery.merge( this, jQuery.parseHTML(
  6175. match[ 1 ],
  6176. context && context.nodeType ? context.ownerDocument || context : document,
  6177. true
  6178. ) );
  6179. // HANDLE: $(html, props)
  6180. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  6181. for ( match in context ) {
  6182. // Properties of context are called as methods if possible
  6183. if ( jQuery.isFunction( this[ match ] ) ) {
  6184. this[ match ]( context[ match ] );
  6185. // ...and otherwise set as attributes
  6186. } else {
  6187. this.attr( match, context[ match ] );
  6188. }
  6189. }
  6190. }
  6191. return this;
  6192. // HANDLE: $(#id)
  6193. } else {
  6194. elem = document.getElementById( match[ 2 ] );
  6195. if ( elem ) {
  6196. // Inject the element directly into the jQuery object
  6197. this[ 0 ] = elem;
  6198. this.length = 1;
  6199. }
  6200. return this;
  6201. }
  6202. // HANDLE: $(expr, $(...))
  6203. } else if ( !context || context.jquery ) {
  6204. return ( context || root ).find( selector );
  6205. // HANDLE: $(expr, context)
  6206. // (which is just equivalent to: $(context).find(expr)
  6207. } else {
  6208. return this.constructor( context ).find( selector );
  6209. }
  6210. // HANDLE: $(DOMElement)
  6211. } else if ( selector.nodeType ) {
  6212. this[ 0 ] = selector;
  6213. this.length = 1;
  6214. return this;
  6215. // HANDLE: $(function)
  6216. // Shortcut for document ready
  6217. } else if ( jQuery.isFunction( selector ) ) {
  6218. return root.ready !== undefined ?
  6219. root.ready( selector ) :
  6220. // Execute immediately if ready is not present
  6221. selector( jQuery );
  6222. }
  6223. return jQuery.makeArray( selector, this );
  6224. };
  6225. // Give the init function the jQuery prototype for later instantiation
  6226. init.prototype = jQuery.fn;
  6227. // Initialize central reference
  6228. rootjQuery = jQuery( document );
  6229. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  6230. // Methods guaranteed to produce a unique set when starting from a unique set
  6231. guaranteedUnique = {
  6232. children: true,
  6233. contents: true,
  6234. next: true,
  6235. prev: true
  6236. };
  6237. jQuery.fn.extend( {
  6238. has: function( target ) {
  6239. var targets = jQuery( target, this ),
  6240. l = targets.length;
  6241. return this.filter( function() {
  6242. var i = 0;
  6243. for ( ; i < l; i++ ) {
  6244. if ( jQuery.contains( this, targets[ i ] ) ) {
  6245. return true;
  6246. }
  6247. }
  6248. } );
  6249. },
  6250. closest: function( selectors, context ) {
  6251. var cur,
  6252. i = 0,
  6253. l = this.length,
  6254. matched = [],
  6255. targets = typeof selectors !== "string" && jQuery( selectors );
  6256. // Positional selectors never match, since there's no _selection_ context
  6257. if ( !rneedsContext.test( selectors ) ) {
  6258. for ( ; i < l; i++ ) {
  6259. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  6260. // Always skip document fragments
  6261. if ( cur.nodeType < 11 && ( targets ?
  6262. targets.index( cur ) > -1 :
  6263. // Don't pass non-elements to Sizzle
  6264. cur.nodeType === 1 &&
  6265. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  6266. matched.push( cur );
  6267. break;
  6268. }
  6269. }
  6270. }
  6271. }
  6272. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  6273. },
  6274. // Determine the position of an element within the set
  6275. index: function( elem ) {
  6276. // No argument, return index in parent
  6277. if ( !elem ) {
  6278. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  6279. }
  6280. // Index in selector
  6281. if ( typeof elem === "string" ) {
  6282. return indexOf.call( jQuery( elem ), this[ 0 ] );
  6283. }
  6284. // Locate the position of the desired element
  6285. return indexOf.call( this,
  6286. // If it receives a jQuery object, the first element is used
  6287. elem.jquery ? elem[ 0 ] : elem
  6288. );
  6289. },
  6290. add: function( selector, context ) {
  6291. return this.pushStack(
  6292. jQuery.uniqueSort(
  6293. jQuery.merge( this.get(), jQuery( selector, context ) )
  6294. )
  6295. );
  6296. },
  6297. addBack: function( selector ) {
  6298. return this.add( selector == null ?
  6299. this.prevObject : this.prevObject.filter( selector )
  6300. );
  6301. }
  6302. } );
  6303. function sibling( cur, dir ) {
  6304. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  6305. return cur;
  6306. }
  6307. jQuery.each( {
  6308. parent: function( elem ) {
  6309. var parent = elem.parentNode;
  6310. return parent && parent.nodeType !== 11 ? parent : null;
  6311. },
  6312. parents: function( elem ) {
  6313. return dir( elem, "parentNode" );
  6314. },
  6315. parentsUntil: function( elem, i, until ) {
  6316. return dir( elem, "parentNode", until );
  6317. },
  6318. next: function( elem ) {
  6319. return sibling( elem, "nextSibling" );
  6320. },
  6321. prev: function( elem ) {
  6322. return sibling( elem, "previousSibling" );
  6323. },
  6324. nextAll: function( elem ) {
  6325. return dir( elem, "nextSibling" );
  6326. },
  6327. prevAll: function( elem ) {
  6328. return dir( elem, "previousSibling" );
  6329. },
  6330. nextUntil: function( elem, i, until ) {
  6331. return dir( elem, "nextSibling", until );
  6332. },
  6333. prevUntil: function( elem, i, until ) {
  6334. return dir( elem, "previousSibling", until );
  6335. },
  6336. siblings: function( elem ) {
  6337. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  6338. },
  6339. children: function( elem ) {
  6340. return siblings( elem.firstChild );
  6341. },
  6342. contents: function( elem ) {
  6343. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  6344. }
  6345. }, function( name, fn ) {
  6346. jQuery.fn[ name ] = function( until, selector ) {
  6347. var matched = jQuery.map( this, fn, until );
  6348. if ( name.slice( -5 ) !== "Until" ) {
  6349. selector = until;
  6350. }
  6351. if ( selector && typeof selector === "string" ) {
  6352. matched = jQuery.filter( selector, matched );
  6353. }
  6354. if ( this.length > 1 ) {
  6355. // Remove duplicates
  6356. if ( !guaranteedUnique[ name ] ) {
  6357. jQuery.uniqueSort( matched );
  6358. }
  6359. // Reverse order for parents* and prev-derivatives
  6360. if ( rparentsprev.test( name ) ) {
  6361. matched.reverse();
  6362. }
  6363. }
  6364. return this.pushStack( matched );
  6365. };
  6366. } );
  6367. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  6368. // Convert String-formatted options into Object-formatted ones
  6369. function createOptions( options ) {
  6370. var object = {};
  6371. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  6372. object[ flag ] = true;
  6373. } );
  6374. return object;
  6375. }
  6376. /*
  6377. * Create a callback list using the following parameters:
  6378. *
  6379. * options: an optional list of space-separated options that will change how
  6380. * the callback list behaves or a more traditional option object
  6381. *
  6382. * By default a callback list will act like an event callback list and can be
  6383. * "fired" multiple times.
  6384. *
  6385. * Possible options:
  6386. *
  6387. * once: will ensure the callback list can only be fired once (like a Deferred)
  6388. *
  6389. * memory: will keep track of previous values and will call any callback added
  6390. * after the list has been fired right away with the latest "memorized"
  6391. * values (like a Deferred)
  6392. *
  6393. * unique: will ensure a callback can only be added once (no duplicate in the list)
  6394. *
  6395. * stopOnFalse: interrupt callings when a callback returns false
  6396. *
  6397. */
  6398. jQuery.Callbacks = function( options ) {
  6399. // Convert options from String-formatted to Object-formatted if needed
  6400. // (we check in cache first)
  6401. options = typeof options === "string" ?
  6402. createOptions( options ) :
  6403. jQuery.extend( {}, options );
  6404. var // Flag to know if list is currently firing
  6405. firing,
  6406. // Last fire value for non-forgettable lists
  6407. memory,
  6408. // Flag to know if list was already fired
  6409. fired,
  6410. // Flag to prevent firing
  6411. locked,
  6412. // Actual callback list
  6413. list = [],
  6414. // Queue of execution data for repeatable lists
  6415. queue = [],
  6416. // Index of currently firing callback (modified by add/remove as needed)
  6417. firingIndex = -1,
  6418. // Fire callbacks
  6419. fire = function() {
  6420. // Enforce single-firing
  6421. locked = options.once;
  6422. // Execute callbacks for all pending executions,
  6423. // respecting firingIndex overrides and runtime changes
  6424. fired = firing = true;
  6425. for ( ; queue.length; firingIndex = -1 ) {
  6426. memory = queue.shift();
  6427. while ( ++firingIndex < list.length ) {
  6428. // Run callback and check for early termination
  6429. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  6430. options.stopOnFalse ) {
  6431. // Jump to end and forget the data so .add doesn't re-fire
  6432. firingIndex = list.length;
  6433. memory = false;
  6434. }
  6435. }
  6436. }
  6437. // Forget the data if we're done with it
  6438. if ( !options.memory ) {
  6439. memory = false;
  6440. }
  6441. firing = false;
  6442. // Clean up if we're done firing for good
  6443. if ( locked ) {
  6444. // Keep an empty list if we have data for future add calls
  6445. if ( memory ) {
  6446. list = [];
  6447. // Otherwise, this object is spent
  6448. } else {
  6449. list = "";
  6450. }
  6451. }
  6452. },
  6453. // Actual Callbacks object
  6454. self = {
  6455. // Add a callback or a collection of callbacks to the list
  6456. add: function() {
  6457. if ( list ) {
  6458. // If we have memory from a past run, we should fire after adding
  6459. if ( memory && !firing ) {
  6460. firingIndex = list.length - 1;
  6461. queue.push( memory );
  6462. }
  6463. ( function add( args ) {
  6464. jQuery.each( args, function( _, arg ) {
  6465. if ( jQuery.isFunction( arg ) ) {
  6466. if ( !options.unique || !self.has( arg ) ) {
  6467. list.push( arg );
  6468. }
  6469. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  6470. // Inspect recursively
  6471. add( arg );
  6472. }
  6473. } );
  6474. } )( arguments );
  6475. if ( memory && !firing ) {
  6476. fire();
  6477. }
  6478. }
  6479. return this;
  6480. },
  6481. // Remove a callback from the list
  6482. remove: function() {
  6483. jQuery.each( arguments, function( _, arg ) {
  6484. var index;
  6485. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  6486. list.splice( index, 1 );
  6487. // Handle firing indexes
  6488. if ( index <= firingIndex ) {
  6489. firingIndex--;
  6490. }
  6491. }
  6492. } );
  6493. return this;
  6494. },
  6495. // Check if a given callback is in the list.
  6496. // If no argument is given, return whether or not list has callbacks attached.
  6497. has: function( fn ) {
  6498. return fn ?
  6499. jQuery.inArray( fn, list ) > -1 :
  6500. list.length > 0;
  6501. },
  6502. // Remove all callbacks from the list
  6503. empty: function() {
  6504. if ( list ) {
  6505. list = [];
  6506. }
  6507. return this;
  6508. },
  6509. // Disable .fire and .add
  6510. // Abort any current/pending executions
  6511. // Clear all callbacks and values
  6512. disable: function() {
  6513. locked = queue = [];
  6514. list = memory = "";
  6515. return this;
  6516. },
  6517. disabled: function() {
  6518. return !list;
  6519. },
  6520. // Disable .fire
  6521. // Also disable .add unless we have memory (since it would have no effect)
  6522. // Abort any pending executions
  6523. lock: function() {
  6524. locked = queue = [];
  6525. if ( !memory && !firing ) {
  6526. list = memory = "";
  6527. }
  6528. return this;
  6529. },
  6530. locked: function() {
  6531. return !!locked;
  6532. },
  6533. // Call all callbacks with the given context and arguments
  6534. fireWith: function( context, args ) {
  6535. if ( !locked ) {
  6536. args = args || [];
  6537. args = [ context, args.slice ? args.slice() : args ];
  6538. queue.push( args );
  6539. if ( !firing ) {
  6540. fire();
  6541. }
  6542. }
  6543. return this;
  6544. },
  6545. // Call all the callbacks with the given arguments
  6546. fire: function() {
  6547. self.fireWith( this, arguments );
  6548. return this;
  6549. },
  6550. // To know if the callbacks have already been called at least once
  6551. fired: function() {
  6552. return !!fired;
  6553. }
  6554. };
  6555. return self;
  6556. };
  6557. function Identity( v ) {
  6558. return v;
  6559. }
  6560. function Thrower( ex ) {
  6561. throw ex;
  6562. }
  6563. function adoptValue( value, resolve, reject ) {
  6564. var method;
  6565. try {
  6566. // Check for promise aspect first to privilege synchronous behavior
  6567. if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
  6568. method.call( value ).done( resolve ).fail( reject );
  6569. // Other thenables
  6570. } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
  6571. method.call( value, resolve, reject );
  6572. // Other non-thenables
  6573. } else {
  6574. // Support: Android 4.0 only
  6575. // Strict mode functions invoked without .call/.apply get global-object context
  6576. resolve.call( undefined, value );
  6577. }
  6578. // For Promises/A+, convert exceptions into rejections
  6579. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  6580. // Deferred#then to conditionally suppress rejection.
  6581. } catch ( value ) {
  6582. // Support: Android 4.0 only
  6583. // Strict mode functions invoked without .call/.apply get global-object context
  6584. reject.call( undefined, value );
  6585. }
  6586. }
  6587. jQuery.extend( {
  6588. Deferred: function( func ) {
  6589. var tuples = [
  6590. // action, add listener, callbacks,
  6591. // ... .then handlers, argument index, [final state]
  6592. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  6593. jQuery.Callbacks( "memory" ), 2 ],
  6594. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  6595. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  6596. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  6597. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  6598. ],
  6599. state = "pending",
  6600. promise = {
  6601. state: function() {
  6602. return state;
  6603. },
  6604. always: function() {
  6605. deferred.done( arguments ).fail( arguments );
  6606. return this;
  6607. },
  6608. "catch": function( fn ) {
  6609. return promise.then( null, fn );
  6610. },
  6611. // Keep pipe for back-compat
  6612. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  6613. var fns = arguments;
  6614. return jQuery.Deferred( function( newDefer ) {
  6615. jQuery.each( tuples, function( i, tuple ) {
  6616. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  6617. var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  6618. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  6619. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  6620. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  6621. deferred[ tuple[ 1 ] ]( function() {
  6622. var returned = fn && fn.apply( this, arguments );
  6623. if ( returned && jQuery.isFunction( returned.promise ) ) {
  6624. returned.promise()
  6625. .progress( newDefer.notify )
  6626. .done( newDefer.resolve )
  6627. .fail( newDefer.reject );
  6628. } else {
  6629. newDefer[ tuple[ 0 ] + "With" ](
  6630. this,
  6631. fn ? [ returned ] : arguments
  6632. );
  6633. }
  6634. } );
  6635. } );
  6636. fns = null;
  6637. } ).promise();
  6638. },
  6639. then: function( onFulfilled, onRejected, onProgress ) {
  6640. var maxDepth = 0;
  6641. function resolve( depth, deferred, handler, special ) {
  6642. return function() {
  6643. var that = this,
  6644. args = arguments,
  6645. mightThrow = function() {
  6646. var returned, then;
  6647. // Support: Promises/A+ section 2.3.3.3.3
  6648. // https://promisesaplus.com/#point-59
  6649. // Ignore double-resolution attempts
  6650. if ( depth < maxDepth ) {
  6651. return;
  6652. }
  6653. returned = handler.apply( that, args );
  6654. // Support: Promises/A+ section 2.3.1
  6655. // https://promisesaplus.com/#point-48
  6656. if ( returned === deferred.promise() ) {
  6657. throw new TypeError( "Thenable self-resolution" );
  6658. }
  6659. // Support: Promises/A+ sections 2.3.3.1, 3.5
  6660. // https://promisesaplus.com/#point-54
  6661. // https://promisesaplus.com/#point-75
  6662. // Retrieve `then` only once
  6663. then = returned &&
  6664. // Support: Promises/A+ section 2.3.4
  6665. // https://promisesaplus.com/#point-64
  6666. // Only check objects and functions for thenability
  6667. ( typeof returned === "object" ||
  6668. typeof returned === "function" ) &&
  6669. returned.then;
  6670. // Handle a returned thenable
  6671. if ( jQuery.isFunction( then ) ) {
  6672. // Special processors (notify) just wait for resolution
  6673. if ( special ) {
  6674. then.call(
  6675. returned,
  6676. resolve( maxDepth, deferred, Identity, special ),
  6677. resolve( maxDepth, deferred, Thrower, special )
  6678. );
  6679. // Normal processors (resolve) also hook into progress
  6680. } else {
  6681. // ...and disregard older resolution values
  6682. maxDepth++;
  6683. then.call(
  6684. returned,
  6685. resolve( maxDepth, deferred, Identity, special ),
  6686. resolve( maxDepth, deferred, Thrower, special ),
  6687. resolve( maxDepth, deferred, Identity,
  6688. deferred.notifyWith )
  6689. );
  6690. }
  6691. // Handle all other returned values
  6692. } else {
  6693. // Only substitute handlers pass on context
  6694. // and multiple values (non-spec behavior)
  6695. if ( handler !== Identity ) {
  6696. that = undefined;
  6697. args = [ returned ];
  6698. }
  6699. // Process the value(s)
  6700. // Default process is resolve
  6701. ( special || deferred.resolveWith )( that, args );
  6702. }
  6703. },
  6704. // Only normal processors (resolve) catch and reject exceptions
  6705. process = special ?
  6706. mightThrow :
  6707. function() {
  6708. try {
  6709. mightThrow();
  6710. } catch ( e ) {
  6711. if ( jQuery.Deferred.exceptionHook ) {
  6712. jQuery.Deferred.exceptionHook( e,
  6713. process.stackTrace );
  6714. }
  6715. // Support: Promises/A+ section 2.3.3.3.4.1
  6716. // https://promisesaplus.com/#point-61
  6717. // Ignore post-resolution exceptions
  6718. if ( depth + 1 >= maxDepth ) {
  6719. // Only substitute handlers pass on context
  6720. // and multiple values (non-spec behavior)
  6721. if ( handler !== Thrower ) {
  6722. that = undefined;
  6723. args = [ e ];
  6724. }
  6725. deferred.rejectWith( that, args );
  6726. }
  6727. }
  6728. };
  6729. // Support: Promises/A+ section 2.3.3.3.1
  6730. // https://promisesaplus.com/#point-57
  6731. // Re-resolve promises immediately to dodge false rejection from
  6732. // subsequent errors
  6733. if ( depth ) {
  6734. process();
  6735. } else {
  6736. // Call an optional hook to record the stack, in case of exception
  6737. // since it's otherwise lost when execution goes async
  6738. if ( jQuery.Deferred.getStackHook ) {
  6739. process.stackTrace = jQuery.Deferred.getStackHook();
  6740. }
  6741. window.setTimeout( process );
  6742. }
  6743. };
  6744. }
  6745. return jQuery.Deferred( function( newDefer ) {
  6746. // progress_handlers.add( ... )
  6747. tuples[ 0 ][ 3 ].add(
  6748. resolve(
  6749. 0,
  6750. newDefer,
  6751. jQuery.isFunction( onProgress ) ?
  6752. onProgress :
  6753. Identity,
  6754. newDefer.notifyWith
  6755. )
  6756. );
  6757. // fulfilled_handlers.add( ... )
  6758. tuples[ 1 ][ 3 ].add(
  6759. resolve(
  6760. 0,
  6761. newDefer,
  6762. jQuery.isFunction( onFulfilled ) ?
  6763. onFulfilled :
  6764. Identity
  6765. )
  6766. );
  6767. // rejected_handlers.add( ... )
  6768. tuples[ 2 ][ 3 ].add(
  6769. resolve(
  6770. 0,
  6771. newDefer,
  6772. jQuery.isFunction( onRejected ) ?
  6773. onRejected :
  6774. Thrower
  6775. )
  6776. );
  6777. } ).promise();
  6778. },
  6779. // Get a promise for this deferred
  6780. // If obj is provided, the promise aspect is added to the object
  6781. promise: function( obj ) {
  6782. return obj != null ? jQuery.extend( obj, promise ) : promise;
  6783. }
  6784. },
  6785. deferred = {};
  6786. // Add list-specific methods
  6787. jQuery.each( tuples, function( i, tuple ) {
  6788. var list = tuple[ 2 ],
  6789. stateString = tuple[ 5 ];
  6790. // promise.progress = list.add
  6791. // promise.done = list.add
  6792. // promise.fail = list.add
  6793. promise[ tuple[ 1 ] ] = list.add;
  6794. // Handle state
  6795. if ( stateString ) {
  6796. list.add(
  6797. function() {
  6798. // state = "resolved" (i.e., fulfilled)
  6799. // state = "rejected"
  6800. state = stateString;
  6801. },
  6802. // rejected_callbacks.disable
  6803. // fulfilled_callbacks.disable
  6804. tuples[ 3 - i ][ 2 ].disable,
  6805. // progress_callbacks.lock
  6806. tuples[ 0 ][ 2 ].lock
  6807. );
  6808. }
  6809. // progress_handlers.fire
  6810. // fulfilled_handlers.fire
  6811. // rejected_handlers.fire
  6812. list.add( tuple[ 3 ].fire );
  6813. // deferred.notify = function() { deferred.notifyWith(...) }
  6814. // deferred.resolve = function() { deferred.resolveWith(...) }
  6815. // deferred.reject = function() { deferred.rejectWith(...) }
  6816. deferred[ tuple[ 0 ] ] = function() {
  6817. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  6818. return this;
  6819. };
  6820. // deferred.notifyWith = list.fireWith
  6821. // deferred.resolveWith = list.fireWith
  6822. // deferred.rejectWith = list.fireWith
  6823. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  6824. } );
  6825. // Make the deferred a promise
  6826. promise.promise( deferred );
  6827. // Call given func if any
  6828. if ( func ) {
  6829. func.call( deferred, deferred );
  6830. }
  6831. // All done!
  6832. return deferred;
  6833. },
  6834. // Deferred helper
  6835. when: function( singleValue ) {
  6836. var
  6837. // count of uncompleted subordinates
  6838. remaining = arguments.length,
  6839. // count of unprocessed arguments
  6840. i = remaining,
  6841. // subordinate fulfillment data
  6842. resolveContexts = Array( i ),
  6843. resolveValues = slice.call( arguments ),
  6844. // the master Deferred
  6845. master = jQuery.Deferred(),
  6846. // subordinate callback factory
  6847. updateFunc = function( i ) {
  6848. return function( value ) {
  6849. resolveContexts[ i ] = this;
  6850. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  6851. if ( !( --remaining ) ) {
  6852. master.resolveWith( resolveContexts, resolveValues );
  6853. }
  6854. };
  6855. };
  6856. // Single- and empty arguments are adopted like Promise.resolve
  6857. if ( remaining <= 1 ) {
  6858. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
  6859. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  6860. if ( master.state() === "pending" ||
  6861. jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  6862. return master.then();
  6863. }
  6864. }
  6865. // Multiple arguments are aggregated like Promise.all array elements
  6866. while ( i-- ) {
  6867. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  6868. }
  6869. return master.promise();
  6870. }
  6871. } );
  6872. // These usually indicate a programmer mistake during development,
  6873. // warn about them ASAP rather than swallowing them by default.
  6874. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  6875. jQuery.Deferred.exceptionHook = function( error, stack ) {
  6876. // Support: IE 8 - 9 only
  6877. // Console exists when dev tools are open, which can happen at any time
  6878. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  6879. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  6880. }
  6881. };
  6882. jQuery.readyException = function( error ) {
  6883. window.setTimeout( function() {
  6884. throw error;
  6885. } );
  6886. };
  6887. // The deferred used on DOM ready
  6888. var readyList = jQuery.Deferred();
  6889. jQuery.fn.ready = function( fn ) {
  6890. readyList
  6891. .then( fn )
  6892. // Wrap jQuery.readyException in a function so that the lookup
  6893. // happens at the time of error handling instead of callback
  6894. // registration.
  6895. .catch( function( error ) {
  6896. jQuery.readyException( error );
  6897. } );
  6898. return this;
  6899. };
  6900. jQuery.extend( {
  6901. // Is the DOM ready to be used? Set to true once it occurs.
  6902. isReady: false,
  6903. // A counter to track how many items to wait for before
  6904. // the ready event fires. See #6781
  6905. readyWait: 1,
  6906. // Hold (or release) the ready event
  6907. holdReady: function( hold ) {
  6908. if ( hold ) {
  6909. jQuery.readyWait++;
  6910. } else {
  6911. jQuery.ready( true );
  6912. }
  6913. },
  6914. // Handle when the DOM is ready
  6915. ready: function( wait ) {
  6916. // Abort if there are pending holds or we're already ready
  6917. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  6918. return;
  6919. }
  6920. // Remember that the DOM is ready
  6921. jQuery.isReady = true;
  6922. // If a normal DOM Ready event fired, decrement, and wait if need be
  6923. if ( wait !== true && --jQuery.readyWait > 0 ) {
  6924. return;
  6925. }
  6926. // If there are functions bound, to execute
  6927. readyList.resolveWith( document, [ jQuery ] );
  6928. }
  6929. } );
  6930. jQuery.ready.then = readyList.then;
  6931. // The ready event handler and self cleanup method
  6932. function completed() {
  6933. document.removeEventListener( "DOMContentLoaded", completed );
  6934. window.removeEventListener( "load", completed );
  6935. jQuery.ready();
  6936. }
  6937. // Catch cases where $(document).ready() is called
  6938. // after the browser event has already occurred.
  6939. // Support: IE <=9 - 10 only
  6940. // Older IE sometimes signals "interactive" too soon
  6941. if ( document.readyState === "complete" ||
  6942. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  6943. // Handle it asynchronously to allow scripts the opportunity to delay ready
  6944. window.setTimeout( jQuery.ready );
  6945. } else {
  6946. // Use the handy event callback
  6947. document.addEventListener( "DOMContentLoaded", completed );
  6948. // A fallback to window.onload, that will always work
  6949. window.addEventListener( "load", completed );
  6950. }
  6951. // Multifunctional method to get and set values of a collection
  6952. // The value/s can optionally be executed if it's a function
  6953. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  6954. var i = 0,
  6955. len = elems.length,
  6956. bulk = key == null;
  6957. // Sets many values
  6958. if ( jQuery.type( key ) === "object" ) {
  6959. chainable = true;
  6960. for ( i in key ) {
  6961. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  6962. }
  6963. // Sets one value
  6964. } else if ( value !== undefined ) {
  6965. chainable = true;
  6966. if ( !jQuery.isFunction( value ) ) {
  6967. raw = true;
  6968. }
  6969. if ( bulk ) {
  6970. // Bulk operations run against the entire set
  6971. if ( raw ) {
  6972. fn.call( elems, value );
  6973. fn = null;
  6974. // ...except when executing function values
  6975. } else {
  6976. bulk = fn;
  6977. fn = function( elem, key, value ) {
  6978. return bulk.call( jQuery( elem ), value );
  6979. };
  6980. }
  6981. }
  6982. if ( fn ) {
  6983. for ( ; i < len; i++ ) {
  6984. fn(
  6985. elems[ i ], key, raw ?
  6986. value :
  6987. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  6988. );
  6989. }
  6990. }
  6991. }
  6992. if ( chainable ) {
  6993. return elems;
  6994. }
  6995. // Gets
  6996. if ( bulk ) {
  6997. return fn.call( elems );
  6998. }
  6999. return len ? fn( elems[ 0 ], key ) : emptyGet;
  7000. };
  7001. var acceptData = function( owner ) {
  7002. // Accepts only:
  7003. // - Node
  7004. // - Node.ELEMENT_NODE
  7005. // - Node.DOCUMENT_NODE
  7006. // - Object
  7007. // - Any
  7008. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  7009. };
  7010. function Data() {
  7011. this.expando = jQuery.expando + Data.uid++;
  7012. }
  7013. Data.uid = 1;
  7014. Data.prototype = {
  7015. cache: function( owner ) {
  7016. // Check if the owner object already has a cache
  7017. var value = owner[ this.expando ];
  7018. // If not, create one
  7019. if ( !value ) {
  7020. value = {};
  7021. // We can accept data for non-element nodes in modern browsers,
  7022. // but we should not, see #8335.
  7023. // Always return an empty object.
  7024. if ( acceptData( owner ) ) {
  7025. // If it is a node unlikely to be stringify-ed or looped over
  7026. // use plain assignment
  7027. if ( owner.nodeType ) {
  7028. owner[ this.expando ] = value;
  7029. // Otherwise secure it in a non-enumerable property
  7030. // configurable must be true to allow the property to be
  7031. // deleted when data is removed
  7032. } else {
  7033. Object.defineProperty( owner, this.expando, {
  7034. value: value,
  7035. configurable: true
  7036. } );
  7037. }
  7038. }
  7039. }
  7040. return value;
  7041. },
  7042. set: function( owner, data, value ) {
  7043. var prop,
  7044. cache = this.cache( owner );
  7045. // Handle: [ owner, key, value ] args
  7046. // Always use camelCase key (gh-2257)
  7047. if ( typeof data === "string" ) {
  7048. cache[ jQuery.camelCase( data ) ] = value;
  7049. // Handle: [ owner, { properties } ] args
  7050. } else {
  7051. // Copy the properties one-by-one to the cache object
  7052. for ( prop in data ) {
  7053. cache[ jQuery.camelCase( prop ) ] = data[ prop ];
  7054. }
  7055. }
  7056. return cache;
  7057. },
  7058. get: function( owner, key ) {
  7059. return key === undefined ?
  7060. this.cache( owner ) :
  7061. // Always use camelCase key (gh-2257)
  7062. owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
  7063. },
  7064. access: function( owner, key, value ) {
  7065. // In cases where either:
  7066. //
  7067. // 1. No key was specified
  7068. // 2. A string key was specified, but no value provided
  7069. //
  7070. // Take the "read" path and allow the get method to determine
  7071. // which value to return, respectively either:
  7072. //
  7073. // 1. The entire cache object
  7074. // 2. The data stored at the key
  7075. //
  7076. if ( key === undefined ||
  7077. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  7078. return this.get( owner, key );
  7079. }
  7080. // When the key is not a string, or both a key and value
  7081. // are specified, set or extend (existing objects) with either:
  7082. //
  7083. // 1. An object of properties
  7084. // 2. A key and value
  7085. //
  7086. this.set( owner, key, value );
  7087. // Since the "set" path can have two possible entry points
  7088. // return the expected data based on which path was taken[*]
  7089. return value !== undefined ? value : key;
  7090. },
  7091. remove: function( owner, key ) {
  7092. var i,
  7093. cache = owner[ this.expando ];
  7094. if ( cache === undefined ) {
  7095. return;
  7096. }
  7097. if ( key !== undefined ) {
  7098. // Support array or space separated string of keys
  7099. if ( jQuery.isArray( key ) ) {
  7100. // If key is an array of keys...
  7101. // We always set camelCase keys, so remove that.
  7102. key = key.map( jQuery.camelCase );
  7103. } else {
  7104. key = jQuery.camelCase( key );
  7105. // If a key with the spaces exists, use it.
  7106. // Otherwise, create an array by matching non-whitespace
  7107. key = key in cache ?
  7108. [ key ] :
  7109. ( key.match( rnothtmlwhite ) || [] );
  7110. }
  7111. i = key.length;
  7112. while ( i-- ) {
  7113. delete cache[ key[ i ] ];
  7114. }
  7115. }
  7116. // Remove the expando if there's no more data
  7117. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  7118. // Support: Chrome <=35 - 45
  7119. // Webkit & Blink performance suffers when deleting properties
  7120. // from DOM nodes, so set to undefined instead
  7121. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  7122. if ( owner.nodeType ) {
  7123. owner[ this.expando ] = undefined;
  7124. } else {
  7125. delete owner[ this.expando ];
  7126. }
  7127. }
  7128. },
  7129. hasData: function( owner ) {
  7130. var cache = owner[ this.expando ];
  7131. return cache !== undefined && !jQuery.isEmptyObject( cache );
  7132. }
  7133. };
  7134. var dataPriv = new Data();
  7135. var dataUser = new Data();
  7136. // Implementation Summary
  7137. //
  7138. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  7139. // 2. Improve the module's maintainability by reducing the storage
  7140. // paths to a single mechanism.
  7141. // 3. Use the same single mechanism to support "private" and "user" data.
  7142. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  7143. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  7144. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  7145. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  7146. rmultiDash = /[A-Z]/g;
  7147. function getData( data ) {
  7148. if ( data === "true" ) {
  7149. return true;
  7150. }
  7151. if ( data === "false" ) {
  7152. return false;
  7153. }
  7154. if ( data === "null" ) {
  7155. return null;
  7156. }
  7157. // Only convert to a number if it doesn't change the string
  7158. if ( data === +data + "" ) {
  7159. return +data;
  7160. }
  7161. if ( rbrace.test( data ) ) {
  7162. return JSON.parse( data );
  7163. }
  7164. return data;
  7165. }
  7166. function dataAttr( elem, key, data ) {
  7167. var name;
  7168. // If nothing was found internally, try to fetch any
  7169. // data from the HTML5 data-* attribute
  7170. if ( data === undefined && elem.nodeType === 1 ) {
  7171. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  7172. data = elem.getAttribute( name );
  7173. if ( typeof data === "string" ) {
  7174. try {
  7175. data = getData( data );
  7176. } catch ( e ) {}
  7177. // Make sure we set the data so it isn't changed later
  7178. dataUser.set( elem, key, data );
  7179. } else {
  7180. data = undefined;
  7181. }
  7182. }
  7183. return data;
  7184. }
  7185. jQuery.extend( {
  7186. hasData: function( elem ) {
  7187. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  7188. },
  7189. data: function( elem, name, data ) {
  7190. return dataUser.access( elem, name, data );
  7191. },
  7192. removeData: function( elem, name ) {
  7193. dataUser.remove( elem, name );
  7194. },
  7195. // TODO: Now that all calls to _data and _removeData have been replaced
  7196. // with direct calls to dataPriv methods, these can be deprecated.
  7197. _data: function( elem, name, data ) {
  7198. return dataPriv.access( elem, name, data );
  7199. },
  7200. _removeData: function( elem, name ) {
  7201. dataPriv.remove( elem, name );
  7202. }
  7203. } );
  7204. jQuery.fn.extend( {
  7205. data: function( key, value ) {
  7206. var i, name, data,
  7207. elem = this[ 0 ],
  7208. attrs = elem && elem.attributes;
  7209. // Gets all values
  7210. if ( key === undefined ) {
  7211. if ( this.length ) {
  7212. data = dataUser.get( elem );
  7213. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  7214. i = attrs.length;
  7215. while ( i-- ) {
  7216. // Support: IE 11 only
  7217. // The attrs elements can be null (#14894)
  7218. if ( attrs[ i ] ) {
  7219. name = attrs[ i ].name;
  7220. if ( name.indexOf( "data-" ) === 0 ) {
  7221. name = jQuery.camelCase( name.slice( 5 ) );
  7222. dataAttr( elem, name, data[ name ] );
  7223. }
  7224. }
  7225. }
  7226. dataPriv.set( elem, "hasDataAttrs", true );
  7227. }
  7228. }
  7229. return data;
  7230. }
  7231. // Sets multiple values
  7232. if ( typeof key === "object" ) {
  7233. return this.each( function() {
  7234. dataUser.set( this, key );
  7235. } );
  7236. }
  7237. return access( this, function( value ) {
  7238. var data;
  7239. // The calling jQuery object (element matches) is not empty
  7240. // (and therefore has an element appears at this[ 0 ]) and the
  7241. // `value` parameter was not undefined. An empty jQuery object
  7242. // will result in `undefined` for elem = this[ 0 ] which will
  7243. // throw an exception if an attempt to read a data cache is made.
  7244. if ( elem && value === undefined ) {
  7245. // Attempt to get data from the cache
  7246. // The key will always be camelCased in Data
  7247. data = dataUser.get( elem, key );
  7248. if ( data !== undefined ) {
  7249. return data;
  7250. }
  7251. // Attempt to "discover" the data in
  7252. // HTML5 custom data-* attrs
  7253. data = dataAttr( elem, key );
  7254. if ( data !== undefined ) {
  7255. return data;
  7256. }
  7257. // We tried really hard, but the data doesn't exist.
  7258. return;
  7259. }
  7260. // Set the data...
  7261. this.each( function() {
  7262. // We always store the camelCased key
  7263. dataUser.set( this, key, value );
  7264. } );
  7265. }, null, value, arguments.length > 1, null, true );
  7266. },
  7267. removeData: function( key ) {
  7268. return this.each( function() {
  7269. dataUser.remove( this, key );
  7270. } );
  7271. }
  7272. } );
  7273. jQuery.extend( {
  7274. queue: function( elem, type, data ) {
  7275. var queue;
  7276. if ( elem ) {
  7277. type = ( type || "fx" ) + "queue";
  7278. queue = dataPriv.get( elem, type );
  7279. // Speed up dequeue by getting out quickly if this is just a lookup
  7280. if ( data ) {
  7281. if ( !queue || jQuery.isArray( data ) ) {
  7282. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  7283. } else {
  7284. queue.push( data );
  7285. }
  7286. }
  7287. return queue || [];
  7288. }
  7289. },
  7290. dequeue: function( elem, type ) {
  7291. type = type || "fx";
  7292. var queue = jQuery.queue( elem, type ),
  7293. startLength = queue.length,
  7294. fn = queue.shift(),
  7295. hooks = jQuery._queueHooks( elem, type ),
  7296. next = function() {
  7297. jQuery.dequeue( elem, type );
  7298. };
  7299. // If the fx queue is dequeued, always remove the progress sentinel
  7300. if ( fn === "inprogress" ) {
  7301. fn = queue.shift();
  7302. startLength--;
  7303. }
  7304. if ( fn ) {
  7305. // Add a progress sentinel to prevent the fx queue from being
  7306. // automatically dequeued
  7307. if ( type === "fx" ) {
  7308. queue.unshift( "inprogress" );
  7309. }
  7310. // Clear up the last queue stop function
  7311. delete hooks.stop;
  7312. fn.call( elem, next, hooks );
  7313. }
  7314. if ( !startLength && hooks ) {
  7315. hooks.empty.fire();
  7316. }
  7317. },
  7318. // Not public - generate a queueHooks object, or return the current one
  7319. _queueHooks: function( elem, type ) {
  7320. var key = type + "queueHooks";
  7321. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  7322. empty: jQuery.Callbacks( "once memory" ).add( function() {
  7323. dataPriv.remove( elem, [ type + "queue", key ] );
  7324. } )
  7325. } );
  7326. }
  7327. } );
  7328. jQuery.fn.extend( {
  7329. queue: function( type, data ) {
  7330. var setter = 2;
  7331. if ( typeof type !== "string" ) {
  7332. data = type;
  7333. type = "fx";
  7334. setter--;
  7335. }
  7336. if ( arguments.length < setter ) {
  7337. return jQuery.queue( this[ 0 ], type );
  7338. }
  7339. return data === undefined ?
  7340. this :
  7341. this.each( function() {
  7342. var queue = jQuery.queue( this, type, data );
  7343. // Ensure a hooks for this queue
  7344. jQuery._queueHooks( this, type );
  7345. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  7346. jQuery.dequeue( this, type );
  7347. }
  7348. } );
  7349. },
  7350. dequeue: function( type ) {
  7351. return this.each( function() {
  7352. jQuery.dequeue( this, type );
  7353. } );
  7354. },
  7355. clearQueue: function( type ) {
  7356. return this.queue( type || "fx", [] );
  7357. },
  7358. // Get a promise resolved when queues of a certain type
  7359. // are emptied (fx is the type by default)
  7360. promise: function( type, obj ) {
  7361. var tmp,
  7362. count = 1,
  7363. defer = jQuery.Deferred(),
  7364. elements = this,
  7365. i = this.length,
  7366. resolve = function() {
  7367. if ( !( --count ) ) {
  7368. defer.resolveWith( elements, [ elements ] );
  7369. }
  7370. };
  7371. if ( typeof type !== "string" ) {
  7372. obj = type;
  7373. type = undefined;
  7374. }
  7375. type = type || "fx";
  7376. while ( i-- ) {
  7377. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  7378. if ( tmp && tmp.empty ) {
  7379. count++;
  7380. tmp.empty.add( resolve );
  7381. }
  7382. }
  7383. resolve();
  7384. return defer.promise( obj );
  7385. }
  7386. } );
  7387. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  7388. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  7389. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  7390. var isHiddenWithinTree = function( elem, el ) {
  7391. // isHiddenWithinTree might be called from jQuery#filter function;
  7392. // in that case, element will be second argument
  7393. elem = el || elem;
  7394. // Inline style trumps all
  7395. return elem.style.display === "none" ||
  7396. elem.style.display === "" &&
  7397. // Otherwise, check computed style
  7398. // Support: Firefox <=43 - 45
  7399. // Disconnected elements can have computed display: none, so first confirm that elem is
  7400. // in the document.
  7401. jQuery.contains( elem.ownerDocument, elem ) &&
  7402. jQuery.css( elem, "display" ) === "none";
  7403. };
  7404. var swap = function( elem, options, callback, args ) {
  7405. var ret, name,
  7406. old = {};
  7407. // Remember the old values, and insert the new ones
  7408. for ( name in options ) {
  7409. old[ name ] = elem.style[ name ];
  7410. elem.style[ name ] = options[ name ];
  7411. }
  7412. ret = callback.apply( elem, args || [] );
  7413. // Revert the old values
  7414. for ( name in options ) {
  7415. elem.style[ name ] = old[ name ];
  7416. }
  7417. return ret;
  7418. };
  7419. function adjustCSS( elem, prop, valueParts, tween ) {
  7420. var adjusted,
  7421. scale = 1,
  7422. maxIterations = 20,
  7423. currentValue = tween ?
  7424. function() {
  7425. return tween.cur();
  7426. } :
  7427. function() {
  7428. return jQuery.css( elem, prop, "" );
  7429. },
  7430. initial = currentValue(),
  7431. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  7432. // Starting value computation is required for potential unit mismatches
  7433. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  7434. rcssNum.exec( jQuery.css( elem, prop ) );
  7435. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  7436. // Trust units reported by jQuery.css
  7437. unit = unit || initialInUnit[ 3 ];
  7438. // Make sure we update the tween properties later on
  7439. valueParts = valueParts || [];
  7440. // Iteratively approximate from a nonzero starting point
  7441. initialInUnit = +initial || 1;
  7442. do {
  7443. // If previous iteration zeroed out, double until we get *something*.
  7444. // Use string for doubling so we don't accidentally see scale as unchanged below
  7445. scale = scale || ".5";
  7446. // Adjust and apply
  7447. initialInUnit = initialInUnit / scale;
  7448. jQuery.style( elem, prop, initialInUnit + unit );
  7449. // Update scale, tolerating zero or NaN from tween.cur()
  7450. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  7451. } while (
  7452. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  7453. );
  7454. }
  7455. if ( valueParts ) {
  7456. initialInUnit = +initialInUnit || +initial || 0;
  7457. // Apply relative offset (+=/-=) if specified
  7458. adjusted = valueParts[ 1 ] ?
  7459. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  7460. +valueParts[ 2 ];
  7461. if ( tween ) {
  7462. tween.unit = unit;
  7463. tween.start = initialInUnit;
  7464. tween.end = adjusted;
  7465. }
  7466. }
  7467. return adjusted;
  7468. }
  7469. var defaultDisplayMap = {};
  7470. function getDefaultDisplay( elem ) {
  7471. var temp,
  7472. doc = elem.ownerDocument,
  7473. nodeName = elem.nodeName,
  7474. display = defaultDisplayMap[ nodeName ];
  7475. if ( display ) {
  7476. return display;
  7477. }
  7478. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  7479. display = jQuery.css( temp, "display" );
  7480. temp.parentNode.removeChild( temp );
  7481. if ( display === "none" ) {
  7482. display = "block";
  7483. }
  7484. defaultDisplayMap[ nodeName ] = display;
  7485. return display;
  7486. }
  7487. function showHide( elements, show ) {
  7488. var display, elem,
  7489. values = [],
  7490. index = 0,
  7491. length = elements.length;
  7492. // Determine new display value for elements that need to change
  7493. for ( ; index < length; index++ ) {
  7494. elem = elements[ index ];
  7495. if ( !elem.style ) {
  7496. continue;
  7497. }
  7498. display = elem.style.display;
  7499. if ( show ) {
  7500. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  7501. // check is required in this first loop unless we have a nonempty display value (either
  7502. // inline or about-to-be-restored)
  7503. if ( display === "none" ) {
  7504. values[ index ] = dataPriv.get( elem, "display" ) || null;
  7505. if ( !values[ index ] ) {
  7506. elem.style.display = "";
  7507. }
  7508. }
  7509. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  7510. values[ index ] = getDefaultDisplay( elem );
  7511. }
  7512. } else {
  7513. if ( display !== "none" ) {
  7514. values[ index ] = "none";
  7515. // Remember what we're overwriting
  7516. dataPriv.set( elem, "display", display );
  7517. }
  7518. }
  7519. }
  7520. // Set the display of the elements in a second loop to avoid constant reflow
  7521. for ( index = 0; index < length; index++ ) {
  7522. if ( values[ index ] != null ) {
  7523. elements[ index ].style.display = values[ index ];
  7524. }
  7525. }
  7526. return elements;
  7527. }
  7528. jQuery.fn.extend( {
  7529. show: function() {
  7530. return showHide( this, true );
  7531. },
  7532. hide: function() {
  7533. return showHide( this );
  7534. },
  7535. toggle: function( state ) {
  7536. if ( typeof state === "boolean" ) {
  7537. return state ? this.show() : this.hide();
  7538. }
  7539. return this.each( function() {
  7540. if ( isHiddenWithinTree( this ) ) {
  7541. jQuery( this ).show();
  7542. } else {
  7543. jQuery( this ).hide();
  7544. }
  7545. } );
  7546. }
  7547. } );
  7548. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  7549. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
  7550. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  7551. // We have to close these tags to support XHTML (#13200)
  7552. var wrapMap = {
  7553. // Support: IE <=9 only
  7554. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  7555. // XHTML parsers do not magically insert elements in the
  7556. // same way that tag soup parsers do. So we cannot shorten
  7557. // this by omitting <tbody> or other required elements.
  7558. thead: [ 1, "<table>", "</table>" ],
  7559. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  7560. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  7561. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  7562. _default: [ 0, "", "" ]
  7563. };
  7564. // Support: IE <=9 only
  7565. wrapMap.optgroup = wrapMap.option;
  7566. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  7567. wrapMap.th = wrapMap.td;
  7568. function getAll( context, tag ) {
  7569. // Support: IE <=9 - 11 only
  7570. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  7571. var ret;
  7572. if ( typeof context.getElementsByTagName !== "undefined" ) {
  7573. ret = context.getElementsByTagName( tag || "*" );
  7574. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  7575. ret = context.querySelectorAll( tag || "*" );
  7576. } else {
  7577. ret = [];
  7578. }
  7579. if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
  7580. return jQuery.merge( [ context ], ret );
  7581. }
  7582. return ret;
  7583. }
  7584. // Mark scripts as having already been evaluated
  7585. function setGlobalEval( elems, refElements ) {
  7586. var i = 0,
  7587. l = elems.length;
  7588. for ( ; i < l; i++ ) {
  7589. dataPriv.set(
  7590. elems[ i ],
  7591. "globalEval",
  7592. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  7593. );
  7594. }
  7595. }
  7596. var rhtml = /<|&#?\w+;/;
  7597. function buildFragment( elems, context, scripts, selection, ignored ) {
  7598. var elem, tmp, tag, wrap, contains, j,
  7599. fragment = context.createDocumentFragment(),
  7600. nodes = [],
  7601. i = 0,
  7602. l = elems.length;
  7603. for ( ; i < l; i++ ) {
  7604. elem = elems[ i ];
  7605. if ( elem || elem === 0 ) {
  7606. // Add nodes directly
  7607. if ( jQuery.type( elem ) === "object" ) {
  7608. // Support: Android <=4.0 only, PhantomJS 1 only
  7609. // push.apply(_, arraylike) throws on ancient WebKit
  7610. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  7611. // Convert non-html into a text node
  7612. } else if ( !rhtml.test( elem ) ) {
  7613. nodes.push( context.createTextNode( elem ) );
  7614. // Convert html into DOM nodes
  7615. } else {
  7616. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  7617. // Deserialize a standard representation
  7618. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  7619. wrap = wrapMap[ tag ] || wrapMap._default;
  7620. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  7621. // Descend through wrappers to the right content
  7622. j = wrap[ 0 ];
  7623. while ( j-- ) {
  7624. tmp = tmp.lastChild;
  7625. }
  7626. // Support: Android <=4.0 only, PhantomJS 1 only
  7627. // push.apply(_, arraylike) throws on ancient WebKit
  7628. jQuery.merge( nodes, tmp.childNodes );
  7629. // Remember the top-level container
  7630. tmp = fragment.firstChild;
  7631. // Ensure the created nodes are orphaned (#12392)
  7632. tmp.textContent = "";
  7633. }
  7634. }
  7635. }
  7636. // Remove wrapper from fragment
  7637. fragment.textContent = "";
  7638. i = 0;
  7639. while ( ( elem = nodes[ i++ ] ) ) {
  7640. // Skip elements already in the context collection (trac-4087)
  7641. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  7642. if ( ignored ) {
  7643. ignored.push( elem );
  7644. }
  7645. continue;
  7646. }
  7647. contains = jQuery.contains( elem.ownerDocument, elem );
  7648. // Append to fragment
  7649. tmp = getAll( fragment.appendChild( elem ), "script" );
  7650. // Preserve script evaluation history
  7651. if ( contains ) {
  7652. setGlobalEval( tmp );
  7653. }
  7654. // Capture executables
  7655. if ( scripts ) {
  7656. j = 0;
  7657. while ( ( elem = tmp[ j++ ] ) ) {
  7658. if ( rscriptType.test( elem.type || "" ) ) {
  7659. scripts.push( elem );
  7660. }
  7661. }
  7662. }
  7663. }
  7664. return fragment;
  7665. }
  7666. ( function() {
  7667. var fragment = document.createDocumentFragment(),
  7668. div = fragment.appendChild( document.createElement( "div" ) ),
  7669. input = document.createElement( "input" );
  7670. // Support: Android 4.0 - 4.3 only
  7671. // Check state lost if the name is set (#11217)
  7672. // Support: Windows Web Apps (WWA)
  7673. // `name` and `type` must use .setAttribute for WWA (#14901)
  7674. input.setAttribute( "type", "radio" );
  7675. input.setAttribute( "checked", "checked" );
  7676. input.setAttribute( "name", "t" );
  7677. div.appendChild( input );
  7678. // Support: Android <=4.1 only
  7679. // Older WebKit doesn't clone checked state correctly in fragments
  7680. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  7681. // Support: IE <=11 only
  7682. // Make sure textarea (and checkbox) defaultValue is properly cloned
  7683. div.innerHTML = "<textarea>x</textarea>";
  7684. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  7685. } )();
  7686. var documentElement = document.documentElement;
  7687. var
  7688. rkeyEvent = /^key/,
  7689. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  7690. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  7691. function returnTrue() {
  7692. return true;
  7693. }
  7694. function returnFalse() {
  7695. return false;
  7696. }
  7697. // Support: IE <=9 only
  7698. // See #13393 for more info
  7699. function safeActiveElement() {
  7700. try {
  7701. return document.activeElement;
  7702. } catch ( err ) { }
  7703. }
  7704. function on( elem, types, selector, data, fn, one ) {
  7705. var origFn, type;
  7706. // Types can be a map of types/handlers
  7707. if ( typeof types === "object" ) {
  7708. // ( types-Object, selector, data )
  7709. if ( typeof selector !== "string" ) {
  7710. // ( types-Object, data )
  7711. data = data || selector;
  7712. selector = undefined;
  7713. }
  7714. for ( type in types ) {
  7715. on( elem, type, selector, data, types[ type ], one );
  7716. }
  7717. return elem;
  7718. }
  7719. if ( data == null && fn == null ) {
  7720. // ( types, fn )
  7721. fn = selector;
  7722. data = selector = undefined;
  7723. } else if ( fn == null ) {
  7724. if ( typeof selector === "string" ) {
  7725. // ( types, selector, fn )
  7726. fn = data;
  7727. data = undefined;
  7728. } else {
  7729. // ( types, data, fn )
  7730. fn = data;
  7731. data = selector;
  7732. selector = undefined;
  7733. }
  7734. }
  7735. if ( fn === false ) {
  7736. fn = returnFalse;
  7737. } else if ( !fn ) {
  7738. return elem;
  7739. }
  7740. if ( one === 1 ) {
  7741. origFn = fn;
  7742. fn = function( event ) {
  7743. // Can use an empty set, since event contains the info
  7744. jQuery().off( event );
  7745. return origFn.apply( this, arguments );
  7746. };
  7747. // Use same guid so caller can remove using origFn
  7748. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  7749. }
  7750. return elem.each( function() {
  7751. jQuery.event.add( this, types, fn, data, selector );
  7752. } );
  7753. }
  7754. /*
  7755. * Helper functions for managing events -- not part of the public interface.
  7756. * Props to Dean Edwards' addEvent library for many of the ideas.
  7757. */
  7758. jQuery.event = {
  7759. global: {},
  7760. add: function( elem, types, handler, data, selector ) {
  7761. var handleObjIn, eventHandle, tmp,
  7762. events, t, handleObj,
  7763. special, handlers, type, namespaces, origType,
  7764. elemData = dataPriv.get( elem );
  7765. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  7766. if ( !elemData ) {
  7767. return;
  7768. }
  7769. // Caller can pass in an object of custom data in lieu of the handler
  7770. if ( handler.handler ) {
  7771. handleObjIn = handler;
  7772. handler = handleObjIn.handler;
  7773. selector = handleObjIn.selector;
  7774. }
  7775. // Ensure that invalid selectors throw exceptions at attach time
  7776. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  7777. if ( selector ) {
  7778. jQuery.find.matchesSelector( documentElement, selector );
  7779. }
  7780. // Make sure that the handler has a unique ID, used to find/remove it later
  7781. if ( !handler.guid ) {
  7782. handler.guid = jQuery.guid++;
  7783. }
  7784. // Init the element's event structure and main handler, if this is the first
  7785. if ( !( events = elemData.events ) ) {
  7786. events = elemData.events = {};
  7787. }
  7788. if ( !( eventHandle = elemData.handle ) ) {
  7789. eventHandle = elemData.handle = function( e ) {
  7790. // Discard the second event of a jQuery.event.trigger() and
  7791. // when an event is called after a page has unloaded
  7792. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  7793. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  7794. };
  7795. }
  7796. // Handle multiple events separated by a space
  7797. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7798. t = types.length;
  7799. while ( t-- ) {
  7800. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7801. type = origType = tmp[ 1 ];
  7802. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7803. // There *must* be a type, no attaching namespace-only handlers
  7804. if ( !type ) {
  7805. continue;
  7806. }
  7807. // If event changes its type, use the special event handlers for the changed type
  7808. special = jQuery.event.special[ type ] || {};
  7809. // If selector defined, determine special event api type, otherwise given type
  7810. type = ( selector ? special.delegateType : special.bindType ) || type;
  7811. // Update special based on newly reset type
  7812. special = jQuery.event.special[ type ] || {};
  7813. // handleObj is passed to all event handlers
  7814. handleObj = jQuery.extend( {
  7815. type: type,
  7816. origType: origType,
  7817. data: data,
  7818. handler: handler,
  7819. guid: handler.guid,
  7820. selector: selector,
  7821. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  7822. namespace: namespaces.join( "." )
  7823. }, handleObjIn );
  7824. // Init the event handler queue if we're the first
  7825. if ( !( handlers = events[ type ] ) ) {
  7826. handlers = events[ type ] = [];
  7827. handlers.delegateCount = 0;
  7828. // Only use addEventListener if the special events handler returns false
  7829. if ( !special.setup ||
  7830. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  7831. if ( elem.addEventListener ) {
  7832. elem.addEventListener( type, eventHandle );
  7833. }
  7834. }
  7835. }
  7836. if ( special.add ) {
  7837. special.add.call( elem, handleObj );
  7838. if ( !handleObj.handler.guid ) {
  7839. handleObj.handler.guid = handler.guid;
  7840. }
  7841. }
  7842. // Add to the element's handler list, delegates in front
  7843. if ( selector ) {
  7844. handlers.splice( handlers.delegateCount++, 0, handleObj );
  7845. } else {
  7846. handlers.push( handleObj );
  7847. }
  7848. // Keep track of which events have ever been used, for event optimization
  7849. jQuery.event.global[ type ] = true;
  7850. }
  7851. },
  7852. // Detach an event or set of events from an element
  7853. remove: function( elem, types, handler, selector, mappedTypes ) {
  7854. var j, origCount, tmp,
  7855. events, t, handleObj,
  7856. special, handlers, type, namespaces, origType,
  7857. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  7858. if ( !elemData || !( events = elemData.events ) ) {
  7859. return;
  7860. }
  7861. // Once for each type.namespace in types; type may be omitted
  7862. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7863. t = types.length;
  7864. while ( t-- ) {
  7865. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7866. type = origType = tmp[ 1 ];
  7867. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7868. // Unbind all events (on this namespace, if provided) for the element
  7869. if ( !type ) {
  7870. for ( type in events ) {
  7871. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  7872. }
  7873. continue;
  7874. }
  7875. special = jQuery.event.special[ type ] || {};
  7876. type = ( selector ? special.delegateType : special.bindType ) || type;
  7877. handlers = events[ type ] || [];
  7878. tmp = tmp[ 2 ] &&
  7879. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  7880. // Remove matching events
  7881. origCount = j = handlers.length;
  7882. while ( j-- ) {
  7883. handleObj = handlers[ j ];
  7884. if ( ( mappedTypes || origType === handleObj.origType ) &&
  7885. ( !handler || handler.guid === handleObj.guid ) &&
  7886. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  7887. ( !selector || selector === handleObj.selector ||
  7888. selector === "**" && handleObj.selector ) ) {
  7889. handlers.splice( j, 1 );
  7890. if ( handleObj.selector ) {
  7891. handlers.delegateCount--;
  7892. }
  7893. if ( special.remove ) {
  7894. special.remove.call( elem, handleObj );
  7895. }
  7896. }
  7897. }
  7898. // Remove generic event handler if we removed something and no more handlers exist
  7899. // (avoids potential for endless recursion during removal of special event handlers)
  7900. if ( origCount && !handlers.length ) {
  7901. if ( !special.teardown ||
  7902. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  7903. jQuery.removeEvent( elem, type, elemData.handle );
  7904. }
  7905. delete events[ type ];
  7906. }
  7907. }
  7908. // Remove data and the expando if it's no longer used
  7909. if ( jQuery.isEmptyObject( events ) ) {
  7910. dataPriv.remove( elem, "handle events" );
  7911. }
  7912. },
  7913. dispatch: function( nativeEvent ) {
  7914. // Make a writable jQuery.Event from the native event object
  7915. var event = jQuery.event.fix( nativeEvent );
  7916. var i, j, ret, matched, handleObj, handlerQueue,
  7917. args = new Array( arguments.length ),
  7918. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  7919. special = jQuery.event.special[ event.type ] || {};
  7920. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  7921. args[ 0 ] = event;
  7922. for ( i = 1; i < arguments.length; i++ ) {
  7923. args[ i ] = arguments[ i ];
  7924. }
  7925. event.delegateTarget = this;
  7926. // Call the preDispatch hook for the mapped type, and let it bail if desired
  7927. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  7928. return;
  7929. }
  7930. // Determine handlers
  7931. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  7932. // Run delegates first; they may want to stop propagation beneath us
  7933. i = 0;
  7934. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  7935. event.currentTarget = matched.elem;
  7936. j = 0;
  7937. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  7938. !event.isImmediatePropagationStopped() ) {
  7939. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  7940. // a subset or equal to those in the bound event (both can have no namespace).
  7941. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  7942. event.handleObj = handleObj;
  7943. event.data = handleObj.data;
  7944. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  7945. handleObj.handler ).apply( matched.elem, args );
  7946. if ( ret !== undefined ) {
  7947. if ( ( event.result = ret ) === false ) {
  7948. event.preventDefault();
  7949. event.stopPropagation();
  7950. }
  7951. }
  7952. }
  7953. }
  7954. }
  7955. // Call the postDispatch hook for the mapped type
  7956. if ( special.postDispatch ) {
  7957. special.postDispatch.call( this, event );
  7958. }
  7959. return event.result;
  7960. },
  7961. handlers: function( event, handlers ) {
  7962. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  7963. handlerQueue = [],
  7964. delegateCount = handlers.delegateCount,
  7965. cur = event.target;
  7966. // Find delegate handlers
  7967. if ( delegateCount &&
  7968. // Support: IE <=9
  7969. // Black-hole SVG <use> instance trees (trac-13180)
  7970. cur.nodeType &&
  7971. // Support: Firefox <=42
  7972. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  7973. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  7974. // Support: IE 11 only
  7975. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  7976. !( event.type === "click" && event.button >= 1 ) ) {
  7977. for ( ; cur !== this; cur = cur.parentNode || this ) {
  7978. // Don't check non-elements (#13208)
  7979. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  7980. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  7981. matchedHandlers = [];
  7982. matchedSelectors = {};
  7983. for ( i = 0; i < delegateCount; i++ ) {
  7984. handleObj = handlers[ i ];
  7985. // Don't conflict with Object.prototype properties (#13203)
  7986. sel = handleObj.selector + " ";
  7987. if ( matchedSelectors[ sel ] === undefined ) {
  7988. matchedSelectors[ sel ] = handleObj.needsContext ?
  7989. jQuery( sel, this ).index( cur ) > -1 :
  7990. jQuery.find( sel, this, null, [ cur ] ).length;
  7991. }
  7992. if ( matchedSelectors[ sel ] ) {
  7993. matchedHandlers.push( handleObj );
  7994. }
  7995. }
  7996. if ( matchedHandlers.length ) {
  7997. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  7998. }
  7999. }
  8000. }
  8001. }
  8002. // Add the remaining (directly-bound) handlers
  8003. cur = this;
  8004. if ( delegateCount < handlers.length ) {
  8005. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  8006. }
  8007. return handlerQueue;
  8008. },
  8009. addProp: function( name, hook ) {
  8010. Object.defineProperty( jQuery.Event.prototype, name, {
  8011. enumerable: true,
  8012. configurable: true,
  8013. get: jQuery.isFunction( hook ) ?
  8014. function() {
  8015. if ( this.originalEvent ) {
  8016. return hook( this.originalEvent );
  8017. }
  8018. } :
  8019. function() {
  8020. if ( this.originalEvent ) {
  8021. return this.originalEvent[ name ];
  8022. }
  8023. },
  8024. set: function( value ) {
  8025. Object.defineProperty( this, name, {
  8026. enumerable: true,
  8027. configurable: true,
  8028. writable: true,
  8029. value: value
  8030. } );
  8031. }
  8032. } );
  8033. },
  8034. fix: function( originalEvent ) {
  8035. return originalEvent[ jQuery.expando ] ?
  8036. originalEvent :
  8037. new jQuery.Event( originalEvent );
  8038. },
  8039. special: {
  8040. load: {
  8041. // Prevent triggered image.load events from bubbling to window.load
  8042. noBubble: true
  8043. },
  8044. focus: {
  8045. // Fire native event if possible so blur/focus sequence is correct
  8046. trigger: function() {
  8047. if ( this !== safeActiveElement() && this.focus ) {
  8048. this.focus();
  8049. return false;
  8050. }
  8051. },
  8052. delegateType: "focusin"
  8053. },
  8054. blur: {
  8055. trigger: function() {
  8056. if ( this === safeActiveElement() && this.blur ) {
  8057. this.blur();
  8058. return false;
  8059. }
  8060. },
  8061. delegateType: "focusout"
  8062. },
  8063. click: {
  8064. // For checkbox, fire native event so checked state will be right
  8065. trigger: function() {
  8066. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  8067. this.click();
  8068. return false;
  8069. }
  8070. },
  8071. // For cross-browser consistency, don't fire native .click() on links
  8072. _default: function( event ) {
  8073. return jQuery.nodeName( event.target, "a" );
  8074. }
  8075. },
  8076. beforeunload: {
  8077. postDispatch: function( event ) {
  8078. // Support: Firefox 20+
  8079. // Firefox doesn't alert if the returnValue field is not set.
  8080. if ( event.result !== undefined && event.originalEvent ) {
  8081. event.originalEvent.returnValue = event.result;
  8082. }
  8083. }
  8084. }
  8085. }
  8086. };
  8087. jQuery.removeEvent = function( elem, type, handle ) {
  8088. // This "if" is needed for plain objects
  8089. if ( elem.removeEventListener ) {
  8090. elem.removeEventListener( type, handle );
  8091. }
  8092. };
  8093. jQuery.Event = function( src, props ) {
  8094. // Allow instantiation without the 'new' keyword
  8095. if ( !( this instanceof jQuery.Event ) ) {
  8096. return new jQuery.Event( src, props );
  8097. }
  8098. // Event object
  8099. if ( src && src.type ) {
  8100. this.originalEvent = src;
  8101. this.type = src.type;
  8102. // Events bubbling up the document may have been marked as prevented
  8103. // by a handler lower down the tree; reflect the correct value.
  8104. this.isDefaultPrevented = src.defaultPrevented ||
  8105. src.defaultPrevented === undefined &&
  8106. // Support: Android <=2.3 only
  8107. src.returnValue === false ?
  8108. returnTrue :
  8109. returnFalse;
  8110. // Create target properties
  8111. // Support: Safari <=6 - 7 only
  8112. // Target should not be a text node (#504, #13143)
  8113. this.target = ( src.target && src.target.nodeType === 3 ) ?
  8114. src.target.parentNode :
  8115. src.target;
  8116. this.currentTarget = src.currentTarget;
  8117. this.relatedTarget = src.relatedTarget;
  8118. // Event type
  8119. } else {
  8120. this.type = src;
  8121. }
  8122. // Put explicitly provided properties onto the event object
  8123. if ( props ) {
  8124. jQuery.extend( this, props );
  8125. }
  8126. // Create a timestamp if incoming event doesn't have one
  8127. this.timeStamp = src && src.timeStamp || jQuery.now();
  8128. // Mark it as fixed
  8129. this[ jQuery.expando ] = true;
  8130. };
  8131. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  8132. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  8133. jQuery.Event.prototype = {
  8134. constructor: jQuery.Event,
  8135. isDefaultPrevented: returnFalse,
  8136. isPropagationStopped: returnFalse,
  8137. isImmediatePropagationStopped: returnFalse,
  8138. isSimulated: false,
  8139. preventDefault: function() {
  8140. var e = this.originalEvent;
  8141. this.isDefaultPrevented = returnTrue;
  8142. if ( e && !this.isSimulated ) {
  8143. e.preventDefault();
  8144. }
  8145. },
  8146. stopPropagation: function() {
  8147. var e = this.originalEvent;
  8148. this.isPropagationStopped = returnTrue;
  8149. if ( e && !this.isSimulated ) {
  8150. e.stopPropagation();
  8151. }
  8152. },
  8153. stopImmediatePropagation: function() {
  8154. var e = this.originalEvent;
  8155. this.isImmediatePropagationStopped = returnTrue;
  8156. if ( e && !this.isSimulated ) {
  8157. e.stopImmediatePropagation();
  8158. }
  8159. this.stopPropagation();
  8160. }
  8161. };
  8162. // Includes all common event props including KeyEvent and MouseEvent specific props
  8163. jQuery.each( {
  8164. altKey: true,
  8165. bubbles: true,
  8166. cancelable: true,
  8167. changedTouches: true,
  8168. ctrlKey: true,
  8169. detail: true,
  8170. eventPhase: true,
  8171. metaKey: true,
  8172. pageX: true,
  8173. pageY: true,
  8174. shiftKey: true,
  8175. view: true,
  8176. "char": true,
  8177. charCode: true,
  8178. key: true,
  8179. keyCode: true,
  8180. button: true,
  8181. buttons: true,
  8182. clientX: true,
  8183. clientY: true,
  8184. offsetX: true,
  8185. offsetY: true,
  8186. pointerId: true,
  8187. pointerType: true,
  8188. screenX: true,
  8189. screenY: true,
  8190. targetTouches: true,
  8191. toElement: true,
  8192. touches: true,
  8193. which: function( event ) {
  8194. var button = event.button;
  8195. // Add which for key events
  8196. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  8197. return event.charCode != null ? event.charCode : event.keyCode;
  8198. }
  8199. // Add which for click: 1 === left; 2 === middle; 3 === right
  8200. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  8201. if ( button & 1 ) {
  8202. return 1;
  8203. }
  8204. if ( button & 2 ) {
  8205. return 3;
  8206. }
  8207. if ( button & 4 ) {
  8208. return 2;
  8209. }
  8210. return 0;
  8211. }
  8212. return event.which;
  8213. }
  8214. }, jQuery.event.addProp );
  8215. // Create mouseenter/leave events using mouseover/out and event-time checks
  8216. // so that event delegation works in jQuery.
  8217. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  8218. //
  8219. // Support: Safari 7 only
  8220. // Safari sends mouseenter too often; see:
  8221. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  8222. // for the description of the bug (it existed in older Chrome versions as well).
  8223. jQuery.each( {
  8224. mouseenter: "mouseover",
  8225. mouseleave: "mouseout",
  8226. pointerenter: "pointerover",
  8227. pointerleave: "pointerout"
  8228. }, function( orig, fix ) {
  8229. jQuery.event.special[ orig ] = {
  8230. delegateType: fix,
  8231. bindType: fix,
  8232. handle: function( event ) {
  8233. var ret,
  8234. target = this,
  8235. related = event.relatedTarget,
  8236. handleObj = event.handleObj;
  8237. // For mouseenter/leave call the handler if related is outside the target.
  8238. // NB: No relatedTarget if the mouse left/entered the browser window
  8239. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  8240. event.type = handleObj.origType;
  8241. ret = handleObj.handler.apply( this, arguments );
  8242. event.type = fix;
  8243. }
  8244. return ret;
  8245. }
  8246. };
  8247. } );
  8248. jQuery.fn.extend( {
  8249. on: function( types, selector, data, fn ) {
  8250. return on( this, types, selector, data, fn );
  8251. },
  8252. one: function( types, selector, data, fn ) {
  8253. return on( this, types, selector, data, fn, 1 );
  8254. },
  8255. off: function( types, selector, fn ) {
  8256. var handleObj, type;
  8257. if ( types && types.preventDefault && types.handleObj ) {
  8258. // ( event ) dispatched jQuery.Event
  8259. handleObj = types.handleObj;
  8260. jQuery( types.delegateTarget ).off(
  8261. handleObj.namespace ?
  8262. handleObj.origType + "." + handleObj.namespace :
  8263. handleObj.origType,
  8264. handleObj.selector,
  8265. handleObj.handler
  8266. );
  8267. return this;
  8268. }
  8269. if ( typeof types === "object" ) {
  8270. // ( types-object [, selector] )
  8271. for ( type in types ) {
  8272. this.off( type, selector, types[ type ] );
  8273. }
  8274. return this;
  8275. }
  8276. if ( selector === false || typeof selector === "function" ) {
  8277. // ( types [, fn] )
  8278. fn = selector;
  8279. selector = undefined;
  8280. }
  8281. if ( fn === false ) {
  8282. fn = returnFalse;
  8283. }
  8284. return this.each( function() {
  8285. jQuery.event.remove( this, types, fn, selector );
  8286. } );
  8287. }
  8288. } );
  8289. var
  8290. /* eslint-disable max-len */
  8291. // See https://github.com/eslint/eslint/issues/3229
  8292. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  8293. /* eslint-enable */
  8294. // Support: IE <=10 - 11, Edge 12 - 13
  8295. // In IE/Edge using regex groups here causes severe slowdowns.
  8296. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  8297. rnoInnerhtml = /<script|<style|<link/i,
  8298. // checked="checked" or checked
  8299. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  8300. rscriptTypeMasked = /^true\/(.*)/,
  8301. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  8302. function manipulationTarget( elem, content ) {
  8303. if ( jQuery.nodeName( elem, "table" ) &&
  8304. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  8305. return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
  8306. }
  8307. return elem;
  8308. }
  8309. // Replace/restore the type attribute of script elements for safe DOM manipulation
  8310. function disableScript( elem ) {
  8311. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  8312. return elem;
  8313. }
  8314. function restoreScript( elem ) {
  8315. var match = rscriptTypeMasked.exec( elem.type );
  8316. if ( match ) {
  8317. elem.type = match[ 1 ];
  8318. } else {
  8319. elem.removeAttribute( "type" );
  8320. }
  8321. return elem;
  8322. }
  8323. function cloneCopyEvent( src, dest ) {
  8324. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  8325. if ( dest.nodeType !== 1 ) {
  8326. return;
  8327. }
  8328. // 1. Copy private data: events, handlers, etc.
  8329. if ( dataPriv.hasData( src ) ) {
  8330. pdataOld = dataPriv.access( src );
  8331. pdataCur = dataPriv.set( dest, pdataOld );
  8332. events = pdataOld.events;
  8333. if ( events ) {
  8334. delete pdataCur.handle;
  8335. pdataCur.events = {};
  8336. for ( type in events ) {
  8337. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  8338. jQuery.event.add( dest, type, events[ type ][ i ] );
  8339. }
  8340. }
  8341. }
  8342. }
  8343. // 2. Copy user data
  8344. if ( dataUser.hasData( src ) ) {
  8345. udataOld = dataUser.access( src );
  8346. udataCur = jQuery.extend( {}, udataOld );
  8347. dataUser.set( dest, udataCur );
  8348. }
  8349. }
  8350. // Fix IE bugs, see support tests
  8351. function fixInput( src, dest ) {
  8352. var nodeName = dest.nodeName.toLowerCase();
  8353. // Fails to persist the checked state of a cloned checkbox or radio button.
  8354. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  8355. dest.checked = src.checked;
  8356. // Fails to return the selected option to the default selected state when cloning options
  8357. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  8358. dest.defaultValue = src.defaultValue;
  8359. }
  8360. }
  8361. function domManip( collection, args, callback, ignored ) {
  8362. // Flatten any nested arrays
  8363. args = concat.apply( [], args );
  8364. var fragment, first, scripts, hasScripts, node, doc,
  8365. i = 0,
  8366. l = collection.length,
  8367. iNoClone = l - 1,
  8368. value = args[ 0 ],
  8369. isFunction = jQuery.isFunction( value );
  8370. // We can't cloneNode fragments that contain checked, in WebKit
  8371. if ( isFunction ||
  8372. ( l > 1 && typeof value === "string" &&
  8373. !support.checkClone && rchecked.test( value ) ) ) {
  8374. return collection.each( function( index ) {
  8375. var self = collection.eq( index );
  8376. if ( isFunction ) {
  8377. args[ 0 ] = value.call( this, index, self.html() );
  8378. }
  8379. domManip( self, args, callback, ignored );
  8380. } );
  8381. }
  8382. if ( l ) {
  8383. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  8384. first = fragment.firstChild;
  8385. if ( fragment.childNodes.length === 1 ) {
  8386. fragment = first;
  8387. }
  8388. // Require either new content or an interest in ignored elements to invoke the callback
  8389. if ( first || ignored ) {
  8390. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  8391. hasScripts = scripts.length;
  8392. // Use the original fragment for the last item
  8393. // instead of the first because it can end up
  8394. // being emptied incorrectly in certain situations (#8070).
  8395. for ( ; i < l; i++ ) {
  8396. node = fragment;
  8397. if ( i !== iNoClone ) {
  8398. node = jQuery.clone( node, true, true );
  8399. // Keep references to cloned scripts for later restoration
  8400. if ( hasScripts ) {
  8401. // Support: Android <=4.0 only, PhantomJS 1 only
  8402. // push.apply(_, arraylike) throws on ancient WebKit
  8403. jQuery.merge( scripts, getAll( node, "script" ) );
  8404. }
  8405. }
  8406. callback.call( collection[ i ], node, i );
  8407. }
  8408. if ( hasScripts ) {
  8409. doc = scripts[ scripts.length - 1 ].ownerDocument;
  8410. // Reenable scripts
  8411. jQuery.map( scripts, restoreScript );
  8412. // Evaluate executable scripts on first document insertion
  8413. for ( i = 0; i < hasScripts; i++ ) {
  8414. node = scripts[ i ];
  8415. if ( rscriptType.test( node.type || "" ) &&
  8416. !dataPriv.access( node, "globalEval" ) &&
  8417. jQuery.contains( doc, node ) ) {
  8418. if ( node.src ) {
  8419. // Optional AJAX dependency, but won't run scripts if not present
  8420. if ( jQuery._evalUrl ) {
  8421. jQuery._evalUrl( node.src );
  8422. }
  8423. } else {
  8424. DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
  8425. }
  8426. }
  8427. }
  8428. }
  8429. }
  8430. }
  8431. return collection;
  8432. }
  8433. function remove( elem, selector, keepData ) {
  8434. var node,
  8435. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  8436. i = 0;
  8437. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  8438. if ( !keepData && node.nodeType === 1 ) {
  8439. jQuery.cleanData( getAll( node ) );
  8440. }
  8441. if ( node.parentNode ) {
  8442. if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
  8443. setGlobalEval( getAll( node, "script" ) );
  8444. }
  8445. node.parentNode.removeChild( node );
  8446. }
  8447. }
  8448. return elem;
  8449. }
  8450. jQuery.extend( {
  8451. htmlPrefilter: function( html ) {
  8452. return html.replace( rxhtmlTag, "<$1></$2>" );
  8453. },
  8454. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  8455. var i, l, srcElements, destElements,
  8456. clone = elem.cloneNode( true ),
  8457. inPage = jQuery.contains( elem.ownerDocument, elem );
  8458. // Fix IE cloning issues
  8459. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  8460. !jQuery.isXMLDoc( elem ) ) {
  8461. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  8462. destElements = getAll( clone );
  8463. srcElements = getAll( elem );
  8464. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  8465. fixInput( srcElements[ i ], destElements[ i ] );
  8466. }
  8467. }
  8468. // Copy the events from the original to the clone
  8469. if ( dataAndEvents ) {
  8470. if ( deepDataAndEvents ) {
  8471. srcElements = srcElements || getAll( elem );
  8472. destElements = destElements || getAll( clone );
  8473. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  8474. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  8475. }
  8476. } else {
  8477. cloneCopyEvent( elem, clone );
  8478. }
  8479. }
  8480. // Preserve script evaluation history
  8481. destElements = getAll( clone, "script" );
  8482. if ( destElements.length > 0 ) {
  8483. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  8484. }
  8485. // Return the cloned set
  8486. return clone;
  8487. },
  8488. cleanData: function( elems ) {
  8489. var data, elem, type,
  8490. special = jQuery.event.special,
  8491. i = 0;
  8492. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  8493. if ( acceptData( elem ) ) {
  8494. if ( ( data = elem[ dataPriv.expando ] ) ) {
  8495. if ( data.events ) {
  8496. for ( type in data.events ) {
  8497. if ( special[ type ] ) {
  8498. jQuery.event.remove( elem, type );
  8499. // This is a shortcut to avoid jQuery.event.remove's overhead
  8500. } else {
  8501. jQuery.removeEvent( elem, type, data.handle );
  8502. }
  8503. }
  8504. }
  8505. // Support: Chrome <=35 - 45+
  8506. // Assign undefined instead of using delete, see Data#remove
  8507. elem[ dataPriv.expando ] = undefined;
  8508. }
  8509. if ( elem[ dataUser.expando ] ) {
  8510. // Support: Chrome <=35 - 45+
  8511. // Assign undefined instead of using delete, see Data#remove
  8512. elem[ dataUser.expando ] = undefined;
  8513. }
  8514. }
  8515. }
  8516. }
  8517. } );
  8518. jQuery.fn.extend( {
  8519. detach: function( selector ) {
  8520. return remove( this, selector, true );
  8521. },
  8522. remove: function( selector ) {
  8523. return remove( this, selector );
  8524. },
  8525. text: function( value ) {
  8526. return access( this, function( value ) {
  8527. return value === undefined ?
  8528. jQuery.text( this ) :
  8529. this.empty().each( function() {
  8530. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8531. this.textContent = value;
  8532. }
  8533. } );
  8534. }, null, value, arguments.length );
  8535. },
  8536. append: function() {
  8537. return domManip( this, arguments, function( elem ) {
  8538. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8539. var target = manipulationTarget( this, elem );
  8540. target.appendChild( elem );
  8541. }
  8542. } );
  8543. },
  8544. prepend: function() {
  8545. return domManip( this, arguments, function( elem ) {
  8546. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  8547. var target = manipulationTarget( this, elem );
  8548. target.insertBefore( elem, target.firstChild );
  8549. }
  8550. } );
  8551. },
  8552. before: function() {
  8553. return domManip( this, arguments, function( elem ) {
  8554. if ( this.parentNode ) {
  8555. this.parentNode.insertBefore( elem, this );
  8556. }
  8557. } );
  8558. },
  8559. after: function() {
  8560. return domManip( this, arguments, function( elem ) {
  8561. if ( this.parentNode ) {
  8562. this.parentNode.insertBefore( elem, this.nextSibling );
  8563. }
  8564. } );
  8565. },
  8566. empty: function() {
  8567. var elem,
  8568. i = 0;
  8569. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  8570. if ( elem.nodeType === 1 ) {
  8571. // Prevent memory leaks
  8572. jQuery.cleanData( getAll( elem, false ) );
  8573. // Remove any remaining nodes
  8574. elem.textContent = "";
  8575. }
  8576. }
  8577. return this;
  8578. },
  8579. clone: function( dataAndEvents, deepDataAndEvents ) {
  8580. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  8581. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  8582. return this.map( function() {
  8583. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  8584. } );
  8585. },
  8586. html: function( value ) {
  8587. return access( this, function( value ) {
  8588. var elem = this[ 0 ] || {},
  8589. i = 0,
  8590. l = this.length;
  8591. if ( value === undefined && elem.nodeType === 1 ) {
  8592. return elem.innerHTML;
  8593. }
  8594. // See if we can take a shortcut and just use innerHTML
  8595. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  8596. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  8597. value = jQuery.htmlPrefilter( value );
  8598. try {
  8599. for ( ; i < l; i++ ) {
  8600. elem = this[ i ] || {};
  8601. // Remove element nodes and prevent memory leaks
  8602. if ( elem.nodeType === 1 ) {
  8603. jQuery.cleanData( getAll( elem, false ) );
  8604. elem.innerHTML = value;
  8605. }
  8606. }
  8607. elem = 0;
  8608. // If using innerHTML throws an exception, use the fallback method
  8609. } catch ( e ) {}
  8610. }
  8611. if ( elem ) {
  8612. this.empty().append( value );
  8613. }
  8614. }, null, value, arguments.length );
  8615. },
  8616. replaceWith: function() {
  8617. var ignored = [];
  8618. // Make the changes, replacing each non-ignored context element with the new content
  8619. return domManip( this, arguments, function( elem ) {
  8620. var parent = this.parentNode;
  8621. if ( jQuery.inArray( this, ignored ) < 0 ) {
  8622. jQuery.cleanData( getAll( this ) );
  8623. if ( parent ) {
  8624. parent.replaceChild( elem, this );
  8625. }
  8626. }
  8627. // Force callback invocation
  8628. }, ignored );
  8629. }
  8630. } );
  8631. jQuery.each( {
  8632. appendTo: "append",
  8633. prependTo: "prepend",
  8634. insertBefore: "before",
  8635. insertAfter: "after",
  8636. replaceAll: "replaceWith"
  8637. }, function( name, original ) {
  8638. jQuery.fn[ name ] = function( selector ) {
  8639. var elems,
  8640. ret = [],
  8641. insert = jQuery( selector ),
  8642. last = insert.length - 1,
  8643. i = 0;
  8644. for ( ; i <= last; i++ ) {
  8645. elems = i === last ? this : this.clone( true );
  8646. jQuery( insert[ i ] )[ original ]( elems );
  8647. // Support: Android <=4.0 only, PhantomJS 1 only
  8648. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  8649. push.apply( ret, elems.get() );
  8650. }
  8651. return this.pushStack( ret );
  8652. };
  8653. } );
  8654. var rmargin = ( /^margin/ );
  8655. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  8656. var getStyles = function( elem ) {
  8657. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  8658. // IE throws on elements created in popups
  8659. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  8660. var view = elem.ownerDocument.defaultView;
  8661. if ( !view || !view.opener ) {
  8662. view = window;
  8663. }
  8664. return view.getComputedStyle( elem );
  8665. };
  8666. ( function() {
  8667. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  8668. // so they're executed at the same time to save the second computation.
  8669. function computeStyleTests() {
  8670. // This is a singleton, we need to execute it only once
  8671. if ( !div ) {
  8672. return;
  8673. }
  8674. div.style.cssText =
  8675. "box-sizing:border-box;" +
  8676. "position:relative;display:block;" +
  8677. "margin:auto;border:1px;padding:1px;" +
  8678. "top:1%;width:50%";
  8679. div.innerHTML = "";
  8680. documentElement.appendChild( container );
  8681. var divStyle = window.getComputedStyle( div );
  8682. pixelPositionVal = divStyle.top !== "1%";
  8683. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  8684. reliableMarginLeftVal = divStyle.marginLeft === "2px";
  8685. boxSizingReliableVal = divStyle.width === "4px";
  8686. // Support: Android 4.0 - 4.3 only
  8687. // Some styles come back with percentage values, even though they shouldn't
  8688. div.style.marginRight = "50%";
  8689. pixelMarginRightVal = divStyle.marginRight === "4px";
  8690. documentElement.removeChild( container );
  8691. // Nullify the div so it wouldn't be stored in the memory and
  8692. // it will also be a sign that checks already performed
  8693. div = null;
  8694. }
  8695. var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
  8696. container = document.createElement( "div" ),
  8697. div = document.createElement( "div" );
  8698. // Finish early in limited (non-browser) environments
  8699. if ( !div.style ) {
  8700. return;
  8701. }
  8702. // Support: IE <=9 - 11 only
  8703. // Style of cloned element affects source element cloned (#8908)
  8704. div.style.backgroundClip = "content-box";
  8705. div.cloneNode( true ).style.backgroundClip = "";
  8706. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  8707. container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  8708. "padding:0;margin-top:1px;position:absolute";
  8709. container.appendChild( div );
  8710. jQuery.extend( support, {
  8711. pixelPosition: function() {
  8712. computeStyleTests();
  8713. return pixelPositionVal;
  8714. },
  8715. boxSizingReliable: function() {
  8716. computeStyleTests();
  8717. return boxSizingReliableVal;
  8718. },
  8719. pixelMarginRight: function() {
  8720. computeStyleTests();
  8721. return pixelMarginRightVal;
  8722. },
  8723. reliableMarginLeft: function() {
  8724. computeStyleTests();
  8725. return reliableMarginLeftVal;
  8726. }
  8727. } );
  8728. } )();
  8729. function curCSS( elem, name, computed ) {
  8730. var width, minWidth, maxWidth, ret,
  8731. style = elem.style;
  8732. computed = computed || getStyles( elem );
  8733. // Support: IE <=9 only
  8734. // getPropertyValue is only needed for .css('filter') (#12537)
  8735. if ( computed ) {
  8736. ret = computed.getPropertyValue( name ) || computed[ name ];
  8737. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  8738. ret = jQuery.style( elem, name );
  8739. }
  8740. // A tribute to the "awesome hack by Dean Edwards"
  8741. // Android Browser returns percentage for some values,
  8742. // but width seems to be reliably pixels.
  8743. // This is against the CSSOM draft spec:
  8744. // https://drafts.csswg.org/cssom/#resolved-values
  8745. if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  8746. // Remember the original values
  8747. width = style.width;
  8748. minWidth = style.minWidth;
  8749. maxWidth = style.maxWidth;
  8750. // Put in the new values to get a computed value out
  8751. style.minWidth = style.maxWidth = style.width = ret;
  8752. ret = computed.width;
  8753. // Revert the changed values
  8754. style.width = width;
  8755. style.minWidth = minWidth;
  8756. style.maxWidth = maxWidth;
  8757. }
  8758. }
  8759. return ret !== undefined ?
  8760. // Support: IE <=9 - 11 only
  8761. // IE returns zIndex value as an integer.
  8762. ret + "" :
  8763. ret;
  8764. }
  8765. function addGetHookIf( conditionFn, hookFn ) {
  8766. // Define the hook, we'll check on the first run if it's really needed.
  8767. return {
  8768. get: function() {
  8769. if ( conditionFn() ) {
  8770. // Hook not needed (or it's not possible to use it due
  8771. // to missing dependency), remove it.
  8772. delete this.get;
  8773. return;
  8774. }
  8775. // Hook needed; redefine it so that the support test is not executed again.
  8776. return ( this.get = hookFn ).apply( this, arguments );
  8777. }
  8778. };
  8779. }
  8780. var
  8781. // Swappable if display is none or starts with table
  8782. // except "table", "table-cell", or "table-caption"
  8783. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  8784. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  8785. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  8786. cssNormalTransform = {
  8787. letterSpacing: "0",
  8788. fontWeight: "400"
  8789. },
  8790. cssPrefixes = [ "Webkit", "Moz", "ms" ],
  8791. emptyStyle = document.createElement( "div" ).style;
  8792. // Return a css property mapped to a potentially vendor prefixed property
  8793. function vendorPropName( name ) {
  8794. // Shortcut for names that are not vendor prefixed
  8795. if ( name in emptyStyle ) {
  8796. return name;
  8797. }
  8798. // Check for vendor prefixed names
  8799. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  8800. i = cssPrefixes.length;
  8801. while ( i-- ) {
  8802. name = cssPrefixes[ i ] + capName;
  8803. if ( name in emptyStyle ) {
  8804. return name;
  8805. }
  8806. }
  8807. }
  8808. function setPositiveNumber( elem, value, subtract ) {
  8809. // Any relative (+/-) values have already been
  8810. // normalized at this point
  8811. var matches = rcssNum.exec( value );
  8812. return matches ?
  8813. // Guard against undefined "subtract", e.g., when used as in cssHooks
  8814. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  8815. value;
  8816. }
  8817. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  8818. var i,
  8819. val = 0;
  8820. // If we already have the right measurement, avoid augmentation
  8821. if ( extra === ( isBorderBox ? "border" : "content" ) ) {
  8822. i = 4;
  8823. // Otherwise initialize for horizontal or vertical properties
  8824. } else {
  8825. i = name === "width" ? 1 : 0;
  8826. }
  8827. for ( ; i < 4; i += 2 ) {
  8828. // Both box models exclude margin, so add it if we want it
  8829. if ( extra === "margin" ) {
  8830. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  8831. }
  8832. if ( isBorderBox ) {
  8833. // border-box includes padding, so remove it if we want content
  8834. if ( extra === "content" ) {
  8835. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  8836. }
  8837. // At this point, extra isn't border nor margin, so remove border
  8838. if ( extra !== "margin" ) {
  8839. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  8840. }
  8841. } else {
  8842. // At this point, extra isn't content, so add padding
  8843. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  8844. // At this point, extra isn't content nor padding, so add border
  8845. if ( extra !== "padding" ) {
  8846. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  8847. }
  8848. }
  8849. }
  8850. return val;
  8851. }
  8852. function getWidthOrHeight( elem, name, extra ) {
  8853. // Start with offset property, which is equivalent to the border-box value
  8854. var val,
  8855. valueIsBorderBox = true,
  8856. styles = getStyles( elem ),
  8857. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  8858. // Support: IE <=11 only
  8859. // Running getBoundingClientRect on a disconnected node
  8860. // in IE throws an error.
  8861. if ( elem.getClientRects().length ) {
  8862. val = elem.getBoundingClientRect()[ name ];
  8863. }
  8864. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  8865. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  8866. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  8867. if ( val <= 0 || val == null ) {
  8868. // Fall back to computed then uncomputed css if necessary
  8869. val = curCSS( elem, name, styles );
  8870. if ( val < 0 || val == null ) {
  8871. val = elem.style[ name ];
  8872. }
  8873. // Computed unit is not pixels. Stop here and return.
  8874. if ( rnumnonpx.test( val ) ) {
  8875. return val;
  8876. }
  8877. // Check for style in case a browser which returns unreliable values
  8878. // for getComputedStyle silently falls back to the reliable elem.style
  8879. valueIsBorderBox = isBorderBox &&
  8880. ( support.boxSizingReliable() || val === elem.style[ name ] );
  8881. // Normalize "", auto, and prepare for extra
  8882. val = parseFloat( val ) || 0;
  8883. }
  8884. // Use the active box-sizing model to add/subtract irrelevant styles
  8885. return ( val +
  8886. augmentWidthOrHeight(
  8887. elem,
  8888. name,
  8889. extra || ( isBorderBox ? "border" : "content" ),
  8890. valueIsBorderBox,
  8891. styles
  8892. )
  8893. ) + "px";
  8894. }
  8895. jQuery.extend( {
  8896. // Add in style property hooks for overriding the default
  8897. // behavior of getting and setting a style property
  8898. cssHooks: {
  8899. opacity: {
  8900. get: function( elem, computed ) {
  8901. if ( computed ) {
  8902. // We should always get a number back from opacity
  8903. var ret = curCSS( elem, "opacity" );
  8904. return ret === "" ? "1" : ret;
  8905. }
  8906. }
  8907. }
  8908. },
  8909. // Don't automatically add "px" to these possibly-unitless properties
  8910. cssNumber: {
  8911. "animationIterationCount": true,
  8912. "columnCount": true,
  8913. "fillOpacity": true,
  8914. "flexGrow": true,
  8915. "flexShrink": true,
  8916. "fontWeight": true,
  8917. "lineHeight": true,
  8918. "opacity": true,
  8919. "order": true,
  8920. "orphans": true,
  8921. "widows": true,
  8922. "zIndex": true,
  8923. "zoom": true
  8924. },
  8925. // Add in properties whose names you wish to fix before
  8926. // setting or getting the value
  8927. cssProps: {
  8928. "float": "cssFloat"
  8929. },
  8930. // Get and set the style property on a DOM Node
  8931. style: function( elem, name, value, extra ) {
  8932. // Don't set styles on text and comment nodes
  8933. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  8934. return;
  8935. }
  8936. // Make sure that we're working with the right name
  8937. var ret, type, hooks,
  8938. origName = jQuery.camelCase( name ),
  8939. style = elem.style;
  8940. name = jQuery.cssProps[ origName ] ||
  8941. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  8942. // Gets hook for the prefixed version, then unprefixed version
  8943. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  8944. // Check if we're setting a value
  8945. if ( value !== undefined ) {
  8946. type = typeof value;
  8947. // Convert "+=" or "-=" to relative numbers (#7345)
  8948. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  8949. value = adjustCSS( elem, name, ret );
  8950. // Fixes bug #9237
  8951. type = "number";
  8952. }
  8953. // Make sure that null and NaN values aren't set (#7116)
  8954. if ( value == null || value !== value ) {
  8955. return;
  8956. }
  8957. // If a number was passed in, add the unit (except for certain CSS properties)
  8958. if ( type === "number" ) {
  8959. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  8960. }
  8961. // background-* props affect original clone's values
  8962. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  8963. style[ name ] = "inherit";
  8964. }
  8965. // If a hook was provided, use that value, otherwise just set the specified value
  8966. if ( !hooks || !( "set" in hooks ) ||
  8967. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  8968. style[ name ] = value;
  8969. }
  8970. } else {
  8971. // If a hook was provided get the non-computed value from there
  8972. if ( hooks && "get" in hooks &&
  8973. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  8974. return ret;
  8975. }
  8976. // Otherwise just get the value from the style object
  8977. return style[ name ];
  8978. }
  8979. },
  8980. css: function( elem, name, extra, styles ) {
  8981. var val, num, hooks,
  8982. origName = jQuery.camelCase( name );
  8983. // Make sure that we're working with the right name
  8984. name = jQuery.cssProps[ origName ] ||
  8985. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  8986. // Try prefixed name followed by the unprefixed name
  8987. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  8988. // If a hook was provided get the computed value from there
  8989. if ( hooks && "get" in hooks ) {
  8990. val = hooks.get( elem, true, extra );
  8991. }
  8992. // Otherwise, if a way to get the computed value exists, use that
  8993. if ( val === undefined ) {
  8994. val = curCSS( elem, name, styles );
  8995. }
  8996. // Convert "normal" to computed value
  8997. if ( val === "normal" && name in cssNormalTransform ) {
  8998. val = cssNormalTransform[ name ];
  8999. }
  9000. // Make numeric if forced or a qualifier was provided and val looks numeric
  9001. if ( extra === "" || extra ) {
  9002. num = parseFloat( val );
  9003. return extra === true || isFinite( num ) ? num || 0 : val;
  9004. }
  9005. return val;
  9006. }
  9007. } );
  9008. jQuery.each( [ "height", "width" ], function( i, name ) {
  9009. jQuery.cssHooks[ name ] = {
  9010. get: function( elem, computed, extra ) {
  9011. if ( computed ) {
  9012. // Certain elements can have dimension info if we invisibly show them
  9013. // but it must have a current display style that would benefit
  9014. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  9015. // Support: Safari 8+
  9016. // Table columns in Safari have non-zero offsetWidth & zero
  9017. // getBoundingClientRect().width unless display is changed.
  9018. // Support: IE <=11 only
  9019. // Running getBoundingClientRect on a disconnected node
  9020. // in IE throws an error.
  9021. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  9022. swap( elem, cssShow, function() {
  9023. return getWidthOrHeight( elem, name, extra );
  9024. } ) :
  9025. getWidthOrHeight( elem, name, extra );
  9026. }
  9027. },
  9028. set: function( elem, value, extra ) {
  9029. var matches,
  9030. styles = extra && getStyles( elem ),
  9031. subtract = extra && augmentWidthOrHeight(
  9032. elem,
  9033. name,
  9034. extra,
  9035. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  9036. styles
  9037. );
  9038. // Convert to pixels if value adjustment is needed
  9039. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  9040. ( matches[ 3 ] || "px" ) !== "px" ) {
  9041. elem.style[ name ] = value;
  9042. value = jQuery.css( elem, name );
  9043. }
  9044. return setPositiveNumber( elem, value, subtract );
  9045. }
  9046. };
  9047. } );
  9048. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  9049. function( elem, computed ) {
  9050. if ( computed ) {
  9051. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  9052. elem.getBoundingClientRect().left -
  9053. swap( elem, { marginLeft: 0 }, function() {
  9054. return elem.getBoundingClientRect().left;
  9055. } )
  9056. ) + "px";
  9057. }
  9058. }
  9059. );
  9060. // These hooks are used by animate to expand properties
  9061. jQuery.each( {
  9062. margin: "",
  9063. padding: "",
  9064. border: "Width"
  9065. }, function( prefix, suffix ) {
  9066. jQuery.cssHooks[ prefix + suffix ] = {
  9067. expand: function( value ) {
  9068. var i = 0,
  9069. expanded = {},
  9070. // Assumes a single number if not a string
  9071. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  9072. for ( ; i < 4; i++ ) {
  9073. expanded[ prefix + cssExpand[ i ] + suffix ] =
  9074. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  9075. }
  9076. return expanded;
  9077. }
  9078. };
  9079. if ( !rmargin.test( prefix ) ) {
  9080. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  9081. }
  9082. } );
  9083. jQuery.fn.extend( {
  9084. css: function( name, value ) {
  9085. return access( this, function( elem, name, value ) {
  9086. var styles, len,
  9087. map = {},
  9088. i = 0;
  9089. if ( jQuery.isArray( name ) ) {
  9090. styles = getStyles( elem );
  9091. len = name.length;
  9092. for ( ; i < len; i++ ) {
  9093. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  9094. }
  9095. return map;
  9096. }
  9097. return value !== undefined ?
  9098. jQuery.style( elem, name, value ) :
  9099. jQuery.css( elem, name );
  9100. }, name, value, arguments.length > 1 );
  9101. }
  9102. } );
  9103. function Tween( elem, options, prop, end, easing ) {
  9104. return new Tween.prototype.init( elem, options, prop, end, easing );
  9105. }
  9106. jQuery.Tween = Tween;
  9107. Tween.prototype = {
  9108. constructor: Tween,
  9109. init: function( elem, options, prop, end, easing, unit ) {
  9110. this.elem = elem;
  9111. this.prop = prop;
  9112. this.easing = easing || jQuery.easing._default;
  9113. this.options = options;
  9114. this.start = this.now = this.cur();
  9115. this.end = end;
  9116. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  9117. },
  9118. cur: function() {
  9119. var hooks = Tween.propHooks[ this.prop ];
  9120. return hooks && hooks.get ?
  9121. hooks.get( this ) :
  9122. Tween.propHooks._default.get( this );
  9123. },
  9124. run: function( percent ) {
  9125. var eased,
  9126. hooks = Tween.propHooks[ this.prop ];
  9127. if ( this.options.duration ) {
  9128. this.pos = eased = jQuery.easing[ this.easing ](
  9129. percent, this.options.duration * percent, 0, 1, this.options.duration
  9130. );
  9131. } else {
  9132. this.pos = eased = percent;
  9133. }
  9134. this.now = ( this.end - this.start ) * eased + this.start;
  9135. if ( this.options.step ) {
  9136. this.options.step.call( this.elem, this.now, this );
  9137. }
  9138. if ( hooks && hooks.set ) {
  9139. hooks.set( this );
  9140. } else {
  9141. Tween.propHooks._default.set( this );
  9142. }
  9143. return this;
  9144. }
  9145. };
  9146. Tween.prototype.init.prototype = Tween.prototype;
  9147. Tween.propHooks = {
  9148. _default: {
  9149. get: function( tween ) {
  9150. var result;
  9151. // Use a property on the element directly when it is not a DOM element,
  9152. // or when there is no matching style property that exists.
  9153. if ( tween.elem.nodeType !== 1 ||
  9154. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  9155. return tween.elem[ tween.prop ];
  9156. }
  9157. // Passing an empty string as a 3rd parameter to .css will automatically
  9158. // attempt a parseFloat and fallback to a string if the parse fails.
  9159. // Simple values such as "10px" are parsed to Float;
  9160. // complex values such as "rotate(1rad)" are returned as-is.
  9161. result = jQuery.css( tween.elem, tween.prop, "" );
  9162. // Empty strings, null, undefined and "auto" are converted to 0.
  9163. return !result || result === "auto" ? 0 : result;
  9164. },
  9165. set: function( tween ) {
  9166. // Use step hook for back compat.
  9167. // Use cssHook if its there.
  9168. // Use .style if available and use plain properties where available.
  9169. if ( jQuery.fx.step[ tween.prop ] ) {
  9170. jQuery.fx.step[ tween.prop ]( tween );
  9171. } else if ( tween.elem.nodeType === 1 &&
  9172. ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
  9173. jQuery.cssHooks[ tween.prop ] ) ) {
  9174. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  9175. } else {
  9176. tween.elem[ tween.prop ] = tween.now;
  9177. }
  9178. }
  9179. }
  9180. };
  9181. // Support: IE <=9 only
  9182. // Panic based approach to setting things on disconnected nodes
  9183. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  9184. set: function( tween ) {
  9185. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  9186. tween.elem[ tween.prop ] = tween.now;
  9187. }
  9188. }
  9189. };
  9190. jQuery.easing = {
  9191. linear: function( p ) {
  9192. return p;
  9193. },
  9194. swing: function( p ) {
  9195. return 0.5 - Math.cos( p * Math.PI ) / 2;
  9196. },
  9197. _default: "swing"
  9198. };
  9199. jQuery.fx = Tween.prototype.init;
  9200. // Back compat <1.8 extension point
  9201. jQuery.fx.step = {};
  9202. var
  9203. fxNow, timerId,
  9204. rfxtypes = /^(?:toggle|show|hide)$/,
  9205. rrun = /queueHooks$/;
  9206. function raf() {
  9207. if ( timerId ) {
  9208. window.requestAnimationFrame( raf );
  9209. jQuery.fx.tick();
  9210. }
  9211. }
  9212. // Animations created synchronously will run synchronously
  9213. function createFxNow() {
  9214. window.setTimeout( function() {
  9215. fxNow = undefined;
  9216. } );
  9217. return ( fxNow = jQuery.now() );
  9218. }
  9219. // Generate parameters to create a standard animation
  9220. function genFx( type, includeWidth ) {
  9221. var which,
  9222. i = 0,
  9223. attrs = { height: type };
  9224. // If we include width, step value is 1 to do all cssExpand values,
  9225. // otherwise step value is 2 to skip over Left and Right
  9226. includeWidth = includeWidth ? 1 : 0;
  9227. for ( ; i < 4; i += 2 - includeWidth ) {
  9228. which = cssExpand[ i ];
  9229. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  9230. }
  9231. if ( includeWidth ) {
  9232. attrs.opacity = attrs.width = type;
  9233. }
  9234. return attrs;
  9235. }
  9236. function createTween( value, prop, animation ) {
  9237. var tween,
  9238. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  9239. index = 0,
  9240. length = collection.length;
  9241. for ( ; index < length; index++ ) {
  9242. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  9243. // We're done with this property
  9244. return tween;
  9245. }
  9246. }
  9247. }
  9248. function defaultPrefilter( elem, props, opts ) {
  9249. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  9250. isBox = "width" in props || "height" in props,
  9251. anim = this,
  9252. orig = {},
  9253. style = elem.style,
  9254. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  9255. dataShow = dataPriv.get( elem, "fxshow" );
  9256. // Queue-skipping animations hijack the fx hooks
  9257. if ( !opts.queue ) {
  9258. hooks = jQuery._queueHooks( elem, "fx" );
  9259. if ( hooks.unqueued == null ) {
  9260. hooks.unqueued = 0;
  9261. oldfire = hooks.empty.fire;
  9262. hooks.empty.fire = function() {
  9263. if ( !hooks.unqueued ) {
  9264. oldfire();
  9265. }
  9266. };
  9267. }
  9268. hooks.unqueued++;
  9269. anim.always( function() {
  9270. // Ensure the complete handler is called before this completes
  9271. anim.always( function() {
  9272. hooks.unqueued--;
  9273. if ( !jQuery.queue( elem, "fx" ).length ) {
  9274. hooks.empty.fire();
  9275. }
  9276. } );
  9277. } );
  9278. }
  9279. // Detect show/hide animations
  9280. for ( prop in props ) {
  9281. value = props[ prop ];
  9282. if ( rfxtypes.test( value ) ) {
  9283. delete props[ prop ];
  9284. toggle = toggle || value === "toggle";
  9285. if ( value === ( hidden ? "hide" : "show" ) ) {
  9286. // Pretend to be hidden if this is a "show" and
  9287. // there is still data from a stopped show/hide
  9288. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  9289. hidden = true;
  9290. // Ignore all other no-op show/hide data
  9291. } else {
  9292. continue;
  9293. }
  9294. }
  9295. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  9296. }
  9297. }
  9298. // Bail out if this is a no-op like .hide().hide()
  9299. propTween = !jQuery.isEmptyObject( props );
  9300. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  9301. return;
  9302. }
  9303. // Restrict "overflow" and "display" styles during box animations
  9304. if ( isBox && elem.nodeType === 1 ) {
  9305. // Support: IE <=9 - 11, Edge 12 - 13
  9306. // Record all 3 overflow attributes because IE does not infer the shorthand
  9307. // from identically-valued overflowX and overflowY
  9308. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  9309. // Identify a display type, preferring old show/hide data over the CSS cascade
  9310. restoreDisplay = dataShow && dataShow.display;
  9311. if ( restoreDisplay == null ) {
  9312. restoreDisplay = dataPriv.get( elem, "display" );
  9313. }
  9314. display = jQuery.css( elem, "display" );
  9315. if ( display === "none" ) {
  9316. if ( restoreDisplay ) {
  9317. display = restoreDisplay;
  9318. } else {
  9319. // Get nonempty value(s) by temporarily forcing visibility
  9320. showHide( [ elem ], true );
  9321. restoreDisplay = elem.style.display || restoreDisplay;
  9322. display = jQuery.css( elem, "display" );
  9323. showHide( [ elem ] );
  9324. }
  9325. }
  9326. // Animate inline elements as inline-block
  9327. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  9328. if ( jQuery.css( elem, "float" ) === "none" ) {
  9329. // Restore the original display value at the end of pure show/hide animations
  9330. if ( !propTween ) {
  9331. anim.done( function() {
  9332. style.display = restoreDisplay;
  9333. } );
  9334. if ( restoreDisplay == null ) {
  9335. display = style.display;
  9336. restoreDisplay = display === "none" ? "" : display;
  9337. }
  9338. }
  9339. style.display = "inline-block";
  9340. }
  9341. }
  9342. }
  9343. if ( opts.overflow ) {
  9344. style.overflow = "hidden";
  9345. anim.always( function() {
  9346. style.overflow = opts.overflow[ 0 ];
  9347. style.overflowX = opts.overflow[ 1 ];
  9348. style.overflowY = opts.overflow[ 2 ];
  9349. } );
  9350. }
  9351. // Implement show/hide animations
  9352. propTween = false;
  9353. for ( prop in orig ) {
  9354. // General show/hide setup for this element animation
  9355. if ( !propTween ) {
  9356. if ( dataShow ) {
  9357. if ( "hidden" in dataShow ) {
  9358. hidden = dataShow.hidden;
  9359. }
  9360. } else {
  9361. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  9362. }
  9363. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  9364. if ( toggle ) {
  9365. dataShow.hidden = !hidden;
  9366. }
  9367. // Show elements before animating them
  9368. if ( hidden ) {
  9369. showHide( [ elem ], true );
  9370. }
  9371. /* eslint-disable no-loop-func */
  9372. anim.done( function() {
  9373. /* eslint-enable no-loop-func */
  9374. // The final step of a "hide" animation is actually hiding the element
  9375. if ( !hidden ) {
  9376. showHide( [ elem ] );
  9377. }
  9378. dataPriv.remove( elem, "fxshow" );
  9379. for ( prop in orig ) {
  9380. jQuery.style( elem, prop, orig[ prop ] );
  9381. }
  9382. } );
  9383. }
  9384. // Per-property setup
  9385. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  9386. if ( !( prop in dataShow ) ) {
  9387. dataShow[ prop ] = propTween.start;
  9388. if ( hidden ) {
  9389. propTween.end = propTween.start;
  9390. propTween.start = 0;
  9391. }
  9392. }
  9393. }
  9394. }
  9395. function propFilter( props, specialEasing ) {
  9396. var index, name, easing, value, hooks;
  9397. // camelCase, specialEasing and expand cssHook pass
  9398. for ( index in props ) {
  9399. name = jQuery.camelCase( index );
  9400. easing = specialEasing[ name ];
  9401. value = props[ index ];
  9402. if ( jQuery.isArray( value ) ) {
  9403. easing = value[ 1 ];
  9404. value = props[ index ] = value[ 0 ];
  9405. }
  9406. if ( index !== name ) {
  9407. props[ name ] = value;
  9408. delete props[ index ];
  9409. }
  9410. hooks = jQuery.cssHooks[ name ];
  9411. if ( hooks && "expand" in hooks ) {
  9412. value = hooks.expand( value );
  9413. delete props[ name ];
  9414. // Not quite $.extend, this won't overwrite existing keys.
  9415. // Reusing 'index' because we have the correct "name"
  9416. for ( index in value ) {
  9417. if ( !( index in props ) ) {
  9418. props[ index ] = value[ index ];
  9419. specialEasing[ index ] = easing;
  9420. }
  9421. }
  9422. } else {
  9423. specialEasing[ name ] = easing;
  9424. }
  9425. }
  9426. }
  9427. function Animation( elem, properties, options ) {
  9428. var result,
  9429. stopped,
  9430. index = 0,
  9431. length = Animation.prefilters.length,
  9432. deferred = jQuery.Deferred().always( function() {
  9433. // Don't match elem in the :animated selector
  9434. delete tick.elem;
  9435. } ),
  9436. tick = function() {
  9437. if ( stopped ) {
  9438. return false;
  9439. }
  9440. var currentTime = fxNow || createFxNow(),
  9441. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  9442. // Support: Android 2.3 only
  9443. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  9444. temp = remaining / animation.duration || 0,
  9445. percent = 1 - temp,
  9446. index = 0,
  9447. length = animation.tweens.length;
  9448. for ( ; index < length; index++ ) {
  9449. animation.tweens[ index ].run( percent );
  9450. }
  9451. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  9452. if ( percent < 1 && length ) {
  9453. return remaining;
  9454. } else {
  9455. deferred.resolveWith( elem, [ animation ] );
  9456. return false;
  9457. }
  9458. },
  9459. animation = deferred.promise( {
  9460. elem: elem,
  9461. props: jQuery.extend( {}, properties ),
  9462. opts: jQuery.extend( true, {
  9463. specialEasing: {},
  9464. easing: jQuery.easing._default
  9465. }, options ),
  9466. originalProperties: properties,
  9467. originalOptions: options,
  9468. startTime: fxNow || createFxNow(),
  9469. duration: options.duration,
  9470. tweens: [],
  9471. createTween: function( prop, end ) {
  9472. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  9473. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  9474. animation.tweens.push( tween );
  9475. return tween;
  9476. },
  9477. stop: function( gotoEnd ) {
  9478. var index = 0,
  9479. // If we are going to the end, we want to run all the tweens
  9480. // otherwise we skip this part
  9481. length = gotoEnd ? animation.tweens.length : 0;
  9482. if ( stopped ) {
  9483. return this;
  9484. }
  9485. stopped = true;
  9486. for ( ; index < length; index++ ) {
  9487. animation.tweens[ index ].run( 1 );
  9488. }
  9489. // Resolve when we played the last frame; otherwise, reject
  9490. if ( gotoEnd ) {
  9491. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  9492. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  9493. } else {
  9494. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  9495. }
  9496. return this;
  9497. }
  9498. } ),
  9499. props = animation.props;
  9500. propFilter( props, animation.opts.specialEasing );
  9501. for ( ; index < length; index++ ) {
  9502. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  9503. if ( result ) {
  9504. if ( jQuery.isFunction( result.stop ) ) {
  9505. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  9506. jQuery.proxy( result.stop, result );
  9507. }
  9508. return result;
  9509. }
  9510. }
  9511. jQuery.map( props, createTween, animation );
  9512. if ( jQuery.isFunction( animation.opts.start ) ) {
  9513. animation.opts.start.call( elem, animation );
  9514. }
  9515. jQuery.fx.timer(
  9516. jQuery.extend( tick, {
  9517. elem: elem,
  9518. anim: animation,
  9519. queue: animation.opts.queue
  9520. } )
  9521. );
  9522. // attach callbacks from options
  9523. return animation.progress( animation.opts.progress )
  9524. .done( animation.opts.done, animation.opts.complete )
  9525. .fail( animation.opts.fail )
  9526. .always( animation.opts.always );
  9527. }
  9528. jQuery.Animation = jQuery.extend( Animation, {
  9529. tweeners: {
  9530. "*": [ function( prop, value ) {
  9531. var tween = this.createTween( prop, value );
  9532. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  9533. return tween;
  9534. } ]
  9535. },
  9536. tweener: function( props, callback ) {
  9537. if ( jQuery.isFunction( props ) ) {
  9538. callback = props;
  9539. props = [ "*" ];
  9540. } else {
  9541. props = props.match( rnothtmlwhite );
  9542. }
  9543. var prop,
  9544. index = 0,
  9545. length = props.length;
  9546. for ( ; index < length; index++ ) {
  9547. prop = props[ index ];
  9548. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  9549. Animation.tweeners[ prop ].unshift( callback );
  9550. }
  9551. },
  9552. prefilters: [ defaultPrefilter ],
  9553. prefilter: function( callback, prepend ) {
  9554. if ( prepend ) {
  9555. Animation.prefilters.unshift( callback );
  9556. } else {
  9557. Animation.prefilters.push( callback );
  9558. }
  9559. }
  9560. } );
  9561. jQuery.speed = function( speed, easing, fn ) {
  9562. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  9563. complete: fn || !fn && easing ||
  9564. jQuery.isFunction( speed ) && speed,
  9565. duration: speed,
  9566. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  9567. };
  9568. // Go to the end state if fx are off or if document is hidden
  9569. if ( jQuery.fx.off || document.hidden ) {
  9570. opt.duration = 0;
  9571. } else {
  9572. if ( typeof opt.duration !== "number" ) {
  9573. if ( opt.duration in jQuery.fx.speeds ) {
  9574. opt.duration = jQuery.fx.speeds[ opt.duration ];
  9575. } else {
  9576. opt.duration = jQuery.fx.speeds._default;
  9577. }
  9578. }
  9579. }
  9580. // Normalize opt.queue - true/undefined/null -> "fx"
  9581. if ( opt.queue == null || opt.queue === true ) {
  9582. opt.queue = "fx";
  9583. }
  9584. // Queueing
  9585. opt.old = opt.complete;
  9586. opt.complete = function() {
  9587. if ( jQuery.isFunction( opt.old ) ) {
  9588. opt.old.call( this );
  9589. }
  9590. if ( opt.queue ) {
  9591. jQuery.dequeue( this, opt.queue );
  9592. }
  9593. };
  9594. return opt;
  9595. };
  9596. jQuery.fn.extend( {
  9597. fadeTo: function( speed, to, easing, callback ) {
  9598. // Show any hidden elements after setting opacity to 0
  9599. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  9600. // Animate to the value specified
  9601. .end().animate( { opacity: to }, speed, easing, callback );
  9602. },
  9603. animate: function( prop, speed, easing, callback ) {
  9604. var empty = jQuery.isEmptyObject( prop ),
  9605. optall = jQuery.speed( speed, easing, callback ),
  9606. doAnimation = function() {
  9607. // Operate on a copy of prop so per-property easing won't be lost
  9608. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  9609. // Empty animations, or finishing resolves immediately
  9610. if ( empty || dataPriv.get( this, "finish" ) ) {
  9611. anim.stop( true );
  9612. }
  9613. };
  9614. doAnimation.finish = doAnimation;
  9615. return empty || optall.queue === false ?
  9616. this.each( doAnimation ) :
  9617. this.queue( optall.queue, doAnimation );
  9618. },
  9619. stop: function( type, clearQueue, gotoEnd ) {
  9620. var stopQueue = function( hooks ) {
  9621. var stop = hooks.stop;
  9622. delete hooks.stop;
  9623. stop( gotoEnd );
  9624. };
  9625. if ( typeof type !== "string" ) {
  9626. gotoEnd = clearQueue;
  9627. clearQueue = type;
  9628. type = undefined;
  9629. }
  9630. if ( clearQueue && type !== false ) {
  9631. this.queue( type || "fx", [] );
  9632. }
  9633. return this.each( function() {
  9634. var dequeue = true,
  9635. index = type != null && type + "queueHooks",
  9636. timers = jQuery.timers,
  9637. data = dataPriv.get( this );
  9638. if ( index ) {
  9639. if ( data[ index ] && data[ index ].stop ) {
  9640. stopQueue( data[ index ] );
  9641. }
  9642. } else {
  9643. for ( index in data ) {
  9644. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  9645. stopQueue( data[ index ] );
  9646. }
  9647. }
  9648. }
  9649. for ( index = timers.length; index--; ) {
  9650. if ( timers[ index ].elem === this &&
  9651. ( type == null || timers[ index ].queue === type ) ) {
  9652. timers[ index ].anim.stop( gotoEnd );
  9653. dequeue = false;
  9654. timers.splice( index, 1 );
  9655. }
  9656. }
  9657. // Start the next in the queue if the last step wasn't forced.
  9658. // Timers currently will call their complete callbacks, which
  9659. // will dequeue but only if they were gotoEnd.
  9660. if ( dequeue || !gotoEnd ) {
  9661. jQuery.dequeue( this, type );
  9662. }
  9663. } );
  9664. },
  9665. finish: function( type ) {
  9666. if ( type !== false ) {
  9667. type = type || "fx";
  9668. }
  9669. return this.each( function() {
  9670. var index,
  9671. data = dataPriv.get( this ),
  9672. queue = data[ type + "queue" ],
  9673. hooks = data[ type + "queueHooks" ],
  9674. timers = jQuery.timers,
  9675. length = queue ? queue.length : 0;
  9676. // Enable finishing flag on private data
  9677. data.finish = true;
  9678. // Empty the queue first
  9679. jQuery.queue( this, type, [] );
  9680. if ( hooks && hooks.stop ) {
  9681. hooks.stop.call( this, true );
  9682. }
  9683. // Look for any active animations, and finish them
  9684. for ( index = timers.length; index--; ) {
  9685. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  9686. timers[ index ].anim.stop( true );
  9687. timers.splice( index, 1 );
  9688. }
  9689. }
  9690. // Look for any animations in the old queue and finish them
  9691. for ( index = 0; index < length; index++ ) {
  9692. if ( queue[ index ] && queue[ index ].finish ) {
  9693. queue[ index ].finish.call( this );
  9694. }
  9695. }
  9696. // Turn off finishing flag
  9697. delete data.finish;
  9698. } );
  9699. }
  9700. } );
  9701. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  9702. var cssFn = jQuery.fn[ name ];
  9703. jQuery.fn[ name ] = function( speed, easing, callback ) {
  9704. return speed == null || typeof speed === "boolean" ?
  9705. cssFn.apply( this, arguments ) :
  9706. this.animate( genFx( name, true ), speed, easing, callback );
  9707. };
  9708. } );
  9709. // Generate shortcuts for custom animations
  9710. jQuery.each( {
  9711. slideDown: genFx( "show" ),
  9712. slideUp: genFx( "hide" ),
  9713. slideToggle: genFx( "toggle" ),
  9714. fadeIn: { opacity: "show" },
  9715. fadeOut: { opacity: "hide" },
  9716. fadeToggle: { opacity: "toggle" }
  9717. }, function( name, props ) {
  9718. jQuery.fn[ name ] = function( speed, easing, callback ) {
  9719. return this.animate( props, speed, easing, callback );
  9720. };
  9721. } );
  9722. jQuery.timers = [];
  9723. jQuery.fx.tick = function() {
  9724. var timer,
  9725. i = 0,
  9726. timers = jQuery.timers;
  9727. fxNow = jQuery.now();
  9728. for ( ; i < timers.length; i++ ) {
  9729. timer = timers[ i ];
  9730. // Checks the timer has not already been removed
  9731. if ( !timer() && timers[ i ] === timer ) {
  9732. timers.splice( i--, 1 );
  9733. }
  9734. }
  9735. if ( !timers.length ) {
  9736. jQuery.fx.stop();
  9737. }
  9738. fxNow = undefined;
  9739. };
  9740. jQuery.fx.timer = function( timer ) {
  9741. jQuery.timers.push( timer );
  9742. if ( timer() ) {
  9743. jQuery.fx.start();
  9744. } else {
  9745. jQuery.timers.pop();
  9746. }
  9747. };
  9748. jQuery.fx.interval = 13;
  9749. jQuery.fx.start = function() {
  9750. if ( !timerId ) {
  9751. timerId = window.requestAnimationFrame ?
  9752. window.requestAnimationFrame( raf ) :
  9753. window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
  9754. }
  9755. };
  9756. jQuery.fx.stop = function() {
  9757. if ( window.cancelAnimationFrame ) {
  9758. window.cancelAnimationFrame( timerId );
  9759. } else {
  9760. window.clearInterval( timerId );
  9761. }
  9762. timerId = null;
  9763. };
  9764. jQuery.fx.speeds = {
  9765. slow: 600,
  9766. fast: 200,
  9767. // Default speed
  9768. _default: 400
  9769. };
  9770. // Based off of the plugin by Clint Helfers, with permission.
  9771. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  9772. jQuery.fn.delay = function( time, type ) {
  9773. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  9774. type = type || "fx";
  9775. return this.queue( type, function( next, hooks ) {
  9776. var timeout = window.setTimeout( next, time );
  9777. hooks.stop = function() {
  9778. window.clearTimeout( timeout );
  9779. };
  9780. } );
  9781. };
  9782. ( function() {
  9783. var input = document.createElement( "input" ),
  9784. select = document.createElement( "select" ),
  9785. opt = select.appendChild( document.createElement( "option" ) );
  9786. input.type = "checkbox";
  9787. // Support: Android <=4.3 only
  9788. // Default value for a checkbox should be "on"
  9789. support.checkOn = input.value !== "";
  9790. // Support: IE <=11 only
  9791. // Must access selectedIndex to make default options select
  9792. support.optSelected = opt.selected;
  9793. // Support: IE <=11 only
  9794. // An input loses its value after becoming a radio
  9795. input = document.createElement( "input" );
  9796. input.value = "t";
  9797. input.type = "radio";
  9798. support.radioValue = input.value === "t";
  9799. } )();
  9800. var boolHook,
  9801. attrHandle = jQuery.expr.attrHandle;
  9802. jQuery.fn.extend( {
  9803. attr: function( name, value ) {
  9804. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  9805. },
  9806. removeAttr: function( name ) {
  9807. return this.each( function() {
  9808. jQuery.removeAttr( this, name );
  9809. } );
  9810. }
  9811. } );
  9812. jQuery.extend( {
  9813. attr: function( elem, name, value ) {
  9814. var ret, hooks,
  9815. nType = elem.nodeType;
  9816. // Don't get/set attributes on text, comment and attribute nodes
  9817. if ( nType === 3 || nType === 8 || nType === 2 ) {
  9818. return;
  9819. }
  9820. // Fallback to prop when attributes are not supported
  9821. if ( typeof elem.getAttribute === "undefined" ) {
  9822. return jQuery.prop( elem, name, value );
  9823. }
  9824. // Attribute hooks are determined by the lowercase version
  9825. // Grab necessary hook if one is defined
  9826. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  9827. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  9828. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  9829. }
  9830. if ( value !== undefined ) {
  9831. if ( value === null ) {
  9832. jQuery.removeAttr( elem, name );
  9833. return;
  9834. }
  9835. if ( hooks && "set" in hooks &&
  9836. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  9837. return ret;
  9838. }
  9839. elem.setAttribute( name, value + "" );
  9840. return value;
  9841. }
  9842. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  9843. return ret;
  9844. }
  9845. ret = jQuery.find.attr( elem, name );
  9846. // Non-existent attributes return null, we normalize to undefined
  9847. return ret == null ? undefined : ret;
  9848. },
  9849. attrHooks: {
  9850. type: {
  9851. set: function( elem, value ) {
  9852. if ( !support.radioValue && value === "radio" &&
  9853. jQuery.nodeName( elem, "input" ) ) {
  9854. var val = elem.value;
  9855. elem.setAttribute( "type", value );
  9856. if ( val ) {
  9857. elem.value = val;
  9858. }
  9859. return value;
  9860. }
  9861. }
  9862. }
  9863. },
  9864. removeAttr: function( elem, value ) {
  9865. var name,
  9866. i = 0,
  9867. // Attribute names can contain non-HTML whitespace characters
  9868. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  9869. attrNames = value && value.match( rnothtmlwhite );
  9870. if ( attrNames && elem.nodeType === 1 ) {
  9871. while ( ( name = attrNames[ i++ ] ) ) {
  9872. elem.removeAttribute( name );
  9873. }
  9874. }
  9875. }
  9876. } );
  9877. // Hooks for boolean attributes
  9878. boolHook = {
  9879. set: function( elem, value, name ) {
  9880. if ( value === false ) {
  9881. // Remove boolean attributes when set to false
  9882. jQuery.removeAttr( elem, name );
  9883. } else {
  9884. elem.setAttribute( name, name );
  9885. }
  9886. return name;
  9887. }
  9888. };
  9889. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  9890. var getter = attrHandle[ name ] || jQuery.find.attr;
  9891. attrHandle[ name ] = function( elem, name, isXML ) {
  9892. var ret, handle,
  9893. lowercaseName = name.toLowerCase();
  9894. if ( !isXML ) {
  9895. // Avoid an infinite loop by temporarily removing this function from the getter
  9896. handle = attrHandle[ lowercaseName ];
  9897. attrHandle[ lowercaseName ] = ret;
  9898. ret = getter( elem, name, isXML ) != null ?
  9899. lowercaseName :
  9900. null;
  9901. attrHandle[ lowercaseName ] = handle;
  9902. }
  9903. return ret;
  9904. };
  9905. } );
  9906. var rfocusable = /^(?:input|select|textarea|button)$/i,
  9907. rclickable = /^(?:a|area)$/i;
  9908. jQuery.fn.extend( {
  9909. prop: function( name, value ) {
  9910. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  9911. },
  9912. removeProp: function( name ) {
  9913. return this.each( function() {
  9914. delete this[ jQuery.propFix[ name ] || name ];
  9915. } );
  9916. }
  9917. } );
  9918. jQuery.extend( {
  9919. prop: function( elem, name, value ) {
  9920. var ret, hooks,
  9921. nType = elem.nodeType;
  9922. // Don't get/set properties on text, comment and attribute nodes
  9923. if ( nType === 3 || nType === 8 || nType === 2 ) {
  9924. return;
  9925. }
  9926. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  9927. // Fix name and attach hooks
  9928. name = jQuery.propFix[ name ] || name;
  9929. hooks = jQuery.propHooks[ name ];
  9930. }
  9931. if ( value !== undefined ) {
  9932. if ( hooks && "set" in hooks &&
  9933. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  9934. return ret;
  9935. }
  9936. return ( elem[ name ] = value );
  9937. }
  9938. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  9939. return ret;
  9940. }
  9941. return elem[ name ];
  9942. },
  9943. propHooks: {
  9944. tabIndex: {
  9945. get: function( elem ) {
  9946. // Support: IE <=9 - 11 only
  9947. // elem.tabIndex doesn't always return the
  9948. // correct value when it hasn't been explicitly set
  9949. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  9950. // Use proper attribute retrieval(#12072)
  9951. var tabindex = jQuery.find.attr( elem, "tabindex" );
  9952. if ( tabindex ) {
  9953. return parseInt( tabindex, 10 );
  9954. }
  9955. if (
  9956. rfocusable.test( elem.nodeName ) ||
  9957. rclickable.test( elem.nodeName ) &&
  9958. elem.href
  9959. ) {
  9960. return 0;
  9961. }
  9962. return -1;
  9963. }
  9964. }
  9965. },
  9966. propFix: {
  9967. "for": "htmlFor",
  9968. "class": "className"
  9969. }
  9970. } );
  9971. // Support: IE <=11 only
  9972. // Accessing the selectedIndex property
  9973. // forces the browser to respect setting selected
  9974. // on the option
  9975. // The getter ensures a default option is selected
  9976. // when in an optgroup
  9977. // eslint rule "no-unused-expressions" is disabled for this code
  9978. // since it considers such accessions noop
  9979. if ( !support.optSelected ) {
  9980. jQuery.propHooks.selected = {
  9981. get: function( elem ) {
  9982. /* eslint no-unused-expressions: "off" */
  9983. var parent = elem.parentNode;
  9984. if ( parent && parent.parentNode ) {
  9985. parent.parentNode.selectedIndex;
  9986. }
  9987. return null;
  9988. },
  9989. set: function( elem ) {
  9990. /* eslint no-unused-expressions: "off" */
  9991. var parent = elem.parentNode;
  9992. if ( parent ) {
  9993. parent.selectedIndex;
  9994. if ( parent.parentNode ) {
  9995. parent.parentNode.selectedIndex;
  9996. }
  9997. }
  9998. }
  9999. };
  10000. }
  10001. jQuery.each( [
  10002. "tabIndex",
  10003. "readOnly",
  10004. "maxLength",
  10005. "cellSpacing",
  10006. "cellPadding",
  10007. "rowSpan",
  10008. "colSpan",
  10009. "useMap",
  10010. "frameBorder",
  10011. "contentEditable"
  10012. ], function() {
  10013. jQuery.propFix[ this.toLowerCase() ] = this;
  10014. } );
  10015. // Strip and collapse whitespace according to HTML spec
  10016. // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
  10017. function stripAndCollapse( value ) {
  10018. var tokens = value.match( rnothtmlwhite ) || [];
  10019. return tokens.join( " " );
  10020. }
  10021. function getClass( elem ) {
  10022. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  10023. }
  10024. jQuery.fn.extend( {
  10025. addClass: function( value ) {
  10026. var classes, elem, cur, curValue, clazz, j, finalValue,
  10027. i = 0;
  10028. if ( jQuery.isFunction( value ) ) {
  10029. return this.each( function( j ) {
  10030. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  10031. } );
  10032. }
  10033. if ( typeof value === "string" && value ) {
  10034. classes = value.match( rnothtmlwhite ) || [];
  10035. while ( ( elem = this[ i++ ] ) ) {
  10036. curValue = getClass( elem );
  10037. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  10038. if ( cur ) {
  10039. j = 0;
  10040. while ( ( clazz = classes[ j++ ] ) ) {
  10041. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  10042. cur += clazz + " ";
  10043. }
  10044. }
  10045. // Only assign if different to avoid unneeded rendering.
  10046. finalValue = stripAndCollapse( cur );
  10047. if ( curValue !== finalValue ) {
  10048. elem.setAttribute( "class", finalValue );
  10049. }
  10050. }
  10051. }
  10052. }
  10053. return this;
  10054. },
  10055. removeClass: function( value ) {
  10056. var classes, elem, cur, curValue, clazz, j, finalValue,
  10057. i = 0;
  10058. if ( jQuery.isFunction( value ) ) {
  10059. return this.each( function( j ) {
  10060. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  10061. } );
  10062. }
  10063. if ( !arguments.length ) {
  10064. return this.attr( "class", "" );
  10065. }
  10066. if ( typeof value === "string" && value ) {
  10067. classes = value.match( rnothtmlwhite ) || [];
  10068. while ( ( elem = this[ i++ ] ) ) {
  10069. curValue = getClass( elem );
  10070. // This expression is here for better compressibility (see addClass)
  10071. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  10072. if ( cur ) {
  10073. j = 0;
  10074. while ( ( clazz = classes[ j++ ] ) ) {
  10075. // Remove *all* instances
  10076. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  10077. cur = cur.replace( " " + clazz + " ", " " );
  10078. }
  10079. }
  10080. // Only assign if different to avoid unneeded rendering.
  10081. finalValue = stripAndCollapse( cur );
  10082. if ( curValue !== finalValue ) {
  10083. elem.setAttribute( "class", finalValue );
  10084. }
  10085. }
  10086. }
  10087. }
  10088. return this;
  10089. },
  10090. toggleClass: function( value, stateVal ) {
  10091. var type = typeof value;
  10092. if ( typeof stateVal === "boolean" && type === "string" ) {
  10093. return stateVal ? this.addClass( value ) : this.removeClass( value );
  10094. }
  10095. if ( jQuery.isFunction( value ) ) {
  10096. return this.each( function( i ) {
  10097. jQuery( this ).toggleClass(
  10098. value.call( this, i, getClass( this ), stateVal ),
  10099. stateVal
  10100. );
  10101. } );
  10102. }
  10103. return this.each( function() {
  10104. var className, i, self, classNames;
  10105. if ( type === "string" ) {
  10106. // Toggle individual class names
  10107. i = 0;
  10108. self = jQuery( this );
  10109. classNames = value.match( rnothtmlwhite ) || [];
  10110. while ( ( className = classNames[ i++ ] ) ) {
  10111. // Check each className given, space separated list
  10112. if ( self.hasClass( className ) ) {
  10113. self.removeClass( className );
  10114. } else {
  10115. self.addClass( className );
  10116. }
  10117. }
  10118. // Toggle whole class name
  10119. } else if ( value === undefined || type === "boolean" ) {
  10120. className = getClass( this );
  10121. if ( className ) {
  10122. // Store className if set
  10123. dataPriv.set( this, "__className__", className );
  10124. }
  10125. // If the element has a class name or if we're passed `false`,
  10126. // then remove the whole classname (if there was one, the above saved it).
  10127. // Otherwise bring back whatever was previously saved (if anything),
  10128. // falling back to the empty string if nothing was stored.
  10129. if ( this.setAttribute ) {
  10130. this.setAttribute( "class",
  10131. className || value === false ?
  10132. "" :
  10133. dataPriv.get( this, "__className__" ) || ""
  10134. );
  10135. }
  10136. }
  10137. } );
  10138. },
  10139. hasClass: function( selector ) {
  10140. var className, elem,
  10141. i = 0;
  10142. className = " " + selector + " ";
  10143. while ( ( elem = this[ i++ ] ) ) {
  10144. if ( elem.nodeType === 1 &&
  10145. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  10146. return true;
  10147. }
  10148. }
  10149. return false;
  10150. }
  10151. } );
  10152. var rreturn = /\r/g;
  10153. jQuery.fn.extend( {
  10154. val: function( value ) {
  10155. var hooks, ret, isFunction,
  10156. elem = this[ 0 ];
  10157. if ( !arguments.length ) {
  10158. if ( elem ) {
  10159. hooks = jQuery.valHooks[ elem.type ] ||
  10160. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  10161. if ( hooks &&
  10162. "get" in hooks &&
  10163. ( ret = hooks.get( elem, "value" ) ) !== undefined
  10164. ) {
  10165. return ret;
  10166. }
  10167. ret = elem.value;
  10168. // Handle most common string cases
  10169. if ( typeof ret === "string" ) {
  10170. return ret.replace( rreturn, "" );
  10171. }
  10172. // Handle cases where value is null/undef or number
  10173. return ret == null ? "" : ret;
  10174. }
  10175. return;
  10176. }
  10177. isFunction = jQuery.isFunction( value );
  10178. return this.each( function( i ) {
  10179. var val;
  10180. if ( this.nodeType !== 1 ) {
  10181. return;
  10182. }
  10183. if ( isFunction ) {
  10184. val = value.call( this, i, jQuery( this ).val() );
  10185. } else {
  10186. val = value;
  10187. }
  10188. // Treat null/undefined as ""; convert numbers to string
  10189. if ( val == null ) {
  10190. val = "";
  10191. } else if ( typeof val === "number" ) {
  10192. val += "";
  10193. } else if ( jQuery.isArray( val ) ) {
  10194. val = jQuery.map( val, function( value ) {
  10195. return value == null ? "" : value + "";
  10196. } );
  10197. }
  10198. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  10199. // If set returns undefined, fall back to normal setting
  10200. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  10201. this.value = val;
  10202. }
  10203. } );
  10204. }
  10205. } );
  10206. jQuery.extend( {
  10207. valHooks: {
  10208. option: {
  10209. get: function( elem ) {
  10210. var val = jQuery.find.attr( elem, "value" );
  10211. return val != null ?
  10212. val :
  10213. // Support: IE <=10 - 11 only
  10214. // option.text throws exceptions (#14686, #14858)
  10215. // Strip and collapse whitespace
  10216. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  10217. stripAndCollapse( jQuery.text( elem ) );
  10218. }
  10219. },
  10220. select: {
  10221. get: function( elem ) {
  10222. var value, option, i,
  10223. options = elem.options,
  10224. index = elem.selectedIndex,
  10225. one = elem.type === "select-one",
  10226. values = one ? null : [],
  10227. max = one ? index + 1 : options.length;
  10228. if ( index < 0 ) {
  10229. i = max;
  10230. } else {
  10231. i = one ? index : 0;
  10232. }
  10233. // Loop through all the selected options
  10234. for ( ; i < max; i++ ) {
  10235. option = options[ i ];
  10236. // Support: IE <=9 only
  10237. // IE8-9 doesn't update selected after form reset (#2551)
  10238. if ( ( option.selected || i === index ) &&
  10239. // Don't return options that are disabled or in a disabled optgroup
  10240. !option.disabled &&
  10241. ( !option.parentNode.disabled ||
  10242. !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  10243. // Get the specific value for the option
  10244. value = jQuery( option ).val();
  10245. // We don't need an array for one selects
  10246. if ( one ) {
  10247. return value;
  10248. }
  10249. // Multi-Selects return an array
  10250. values.push( value );
  10251. }
  10252. }
  10253. return values;
  10254. },
  10255. set: function( elem, value ) {
  10256. var optionSet, option,
  10257. options = elem.options,
  10258. values = jQuery.makeArray( value ),
  10259. i = options.length;
  10260. while ( i-- ) {
  10261. option = options[ i ];
  10262. /* eslint-disable no-cond-assign */
  10263. if ( option.selected =
  10264. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  10265. ) {
  10266. optionSet = true;
  10267. }
  10268. /* eslint-enable no-cond-assign */
  10269. }
  10270. // Force browsers to behave consistently when non-matching value is set
  10271. if ( !optionSet ) {
  10272. elem.selectedIndex = -1;
  10273. }
  10274. return values;
  10275. }
  10276. }
  10277. }
  10278. } );
  10279. // Radios and checkboxes getter/setter
  10280. jQuery.each( [ "radio", "checkbox" ], function() {
  10281. jQuery.valHooks[ this ] = {
  10282. set: function( elem, value ) {
  10283. if ( jQuery.isArray( value ) ) {
  10284. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  10285. }
  10286. }
  10287. };
  10288. if ( !support.checkOn ) {
  10289. jQuery.valHooks[ this ].get = function( elem ) {
  10290. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  10291. };
  10292. }
  10293. } );
  10294. // Return jQuery for attributes-only inclusion
  10295. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
  10296. jQuery.extend( jQuery.event, {
  10297. trigger: function( event, data, elem, onlyHandlers ) {
  10298. var i, cur, tmp, bubbleType, ontype, handle, special,
  10299. eventPath = [ elem || document ],
  10300. type = hasOwn.call( event, "type" ) ? event.type : event,
  10301. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  10302. cur = tmp = elem = elem || document;
  10303. // Don't do events on text and comment nodes
  10304. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  10305. return;
  10306. }
  10307. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  10308. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  10309. return;
  10310. }
  10311. if ( type.indexOf( "." ) > -1 ) {
  10312. // Namespaced trigger; create a regexp to match event type in handle()
  10313. namespaces = type.split( "." );
  10314. type = namespaces.shift();
  10315. namespaces.sort();
  10316. }
  10317. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  10318. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  10319. event = event[ jQuery.expando ] ?
  10320. event :
  10321. new jQuery.Event( type, typeof event === "object" && event );
  10322. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  10323. event.isTrigger = onlyHandlers ? 2 : 3;
  10324. event.namespace = namespaces.join( "." );
  10325. event.rnamespace = event.namespace ?
  10326. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  10327. null;
  10328. // Clean up the event in case it is being reused
  10329. event.result = undefined;
  10330. if ( !event.target ) {
  10331. event.target = elem;
  10332. }
  10333. // Clone any incoming data and prepend the event, creating the handler arg list
  10334. data = data == null ?
  10335. [ event ] :
  10336. jQuery.makeArray( data, [ event ] );
  10337. // Allow special events to draw outside the lines
  10338. special = jQuery.event.special[ type ] || {};
  10339. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  10340. return;
  10341. }
  10342. // Determine event propagation path in advance, per W3C events spec (#9951)
  10343. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  10344. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  10345. bubbleType = special.delegateType || type;
  10346. if ( !rfocusMorph.test( bubbleType + type ) ) {
  10347. cur = cur.parentNode;
  10348. }
  10349. for ( ; cur; cur = cur.parentNode ) {
  10350. eventPath.push( cur );
  10351. tmp = cur;
  10352. }
  10353. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  10354. if ( tmp === ( elem.ownerDocument || document ) ) {
  10355. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  10356. }
  10357. }
  10358. // Fire handlers on the event path
  10359. i = 0;
  10360. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  10361. event.type = i > 1 ?
  10362. bubbleType :
  10363. special.bindType || type;
  10364. // jQuery handler
  10365. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  10366. dataPriv.get( cur, "handle" );
  10367. if ( handle ) {
  10368. handle.apply( cur, data );
  10369. }
  10370. // Native handler
  10371. handle = ontype && cur[ ontype ];
  10372. if ( handle && handle.apply && acceptData( cur ) ) {
  10373. event.result = handle.apply( cur, data );
  10374. if ( event.result === false ) {
  10375. event.preventDefault();
  10376. }
  10377. }
  10378. }
  10379. event.type = type;
  10380. // If nobody prevented the default action, do it now
  10381. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  10382. if ( ( !special._default ||
  10383. special._default.apply( eventPath.pop(), data ) === false ) &&
  10384. acceptData( elem ) ) {
  10385. // Call a native DOM method on the target with the same name as the event.
  10386. // Don't do default actions on window, that's where global variables be (#6170)
  10387. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  10388. // Don't re-trigger an onFOO event when we call its FOO() method
  10389. tmp = elem[ ontype ];
  10390. if ( tmp ) {
  10391. elem[ ontype ] = null;
  10392. }
  10393. // Prevent re-triggering of the same event, since we already bubbled it above
  10394. jQuery.event.triggered = type;
  10395. elem[ type ]();
  10396. jQuery.event.triggered = undefined;
  10397. if ( tmp ) {
  10398. elem[ ontype ] = tmp;
  10399. }
  10400. }
  10401. }
  10402. }
  10403. return event.result;
  10404. },
  10405. // Piggyback on a donor event to simulate a different one
  10406. // Used only for `focus(in | out)` events
  10407. simulate: function( type, elem, event ) {
  10408. var e = jQuery.extend(
  10409. new jQuery.Event(),
  10410. event,
  10411. {
  10412. type: type,
  10413. isSimulated: true
  10414. }
  10415. );
  10416. jQuery.event.trigger( e, null, elem );
  10417. }
  10418. } );
  10419. jQuery.fn.extend( {
  10420. trigger: function( type, data ) {
  10421. return this.each( function() {
  10422. jQuery.event.trigger( type, data, this );
  10423. } );
  10424. },
  10425. triggerHandler: function( type, data ) {
  10426. var elem = this[ 0 ];
  10427. if ( elem ) {
  10428. return jQuery.event.trigger( type, data, elem, true );
  10429. }
  10430. }
  10431. } );
  10432. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  10433. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  10434. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  10435. function( i, name ) {
  10436. // Handle event binding
  10437. jQuery.fn[ name ] = function( data, fn ) {
  10438. return arguments.length > 0 ?
  10439. this.on( name, null, data, fn ) :
  10440. this.trigger( name );
  10441. };
  10442. } );
  10443. jQuery.fn.extend( {
  10444. hover: function( fnOver, fnOut ) {
  10445. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  10446. }
  10447. } );
  10448. support.focusin = "onfocusin" in window;
  10449. // Support: Firefox <=44
  10450. // Firefox doesn't have focus(in | out) events
  10451. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  10452. //
  10453. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  10454. // focus(in | out) events fire after focus & blur events,
  10455. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  10456. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  10457. if ( !support.focusin ) {
  10458. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  10459. // Attach a single capturing handler on the document while someone wants focusin/focusout
  10460. var handler = function( event ) {
  10461. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  10462. };
  10463. jQuery.event.special[ fix ] = {
  10464. setup: function() {
  10465. var doc = this.ownerDocument || this,
  10466. attaches = dataPriv.access( doc, fix );
  10467. if ( !attaches ) {
  10468. doc.addEventListener( orig, handler, true );
  10469. }
  10470. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  10471. },
  10472. teardown: function() {
  10473. var doc = this.ownerDocument || this,
  10474. attaches = dataPriv.access( doc, fix ) - 1;
  10475. if ( !attaches ) {
  10476. doc.removeEventListener( orig, handler, true );
  10477. dataPriv.remove( doc, fix );
  10478. } else {
  10479. dataPriv.access( doc, fix, attaches );
  10480. }
  10481. }
  10482. };
  10483. } );
  10484. }
  10485. var location = window.location;
  10486. var nonce = jQuery.now();
  10487. var rquery = ( /\?/ );
  10488. // Cross-browser xml parsing
  10489. jQuery.parseXML = function( data ) {
  10490. var xml;
  10491. if ( !data || typeof data !== "string" ) {
  10492. return null;
  10493. }
  10494. // Support: IE 9 - 11 only
  10495. // IE throws on parseFromString with invalid input.
  10496. try {
  10497. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  10498. } catch ( e ) {
  10499. xml = undefined;
  10500. }
  10501. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  10502. jQuery.error( "Invalid XML: " + data );
  10503. }
  10504. return xml;
  10505. };
  10506. var
  10507. rbracket = /\[\]$/,
  10508. rCRLF = /\r?\n/g,
  10509. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  10510. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  10511. function buildParams( prefix, obj, traditional, add ) {
  10512. var name;
  10513. if ( jQuery.isArray( obj ) ) {
  10514. // Serialize array item.
  10515. jQuery.each( obj, function( i, v ) {
  10516. if ( traditional || rbracket.test( prefix ) ) {
  10517. // Treat each array item as a scalar.
  10518. add( prefix, v );
  10519. } else {
  10520. // Item is non-scalar (array or object), encode its numeric index.
  10521. buildParams(
  10522. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  10523. v,
  10524. traditional,
  10525. add
  10526. );
  10527. }
  10528. } );
  10529. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  10530. // Serialize object item.
  10531. for ( name in obj ) {
  10532. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  10533. }
  10534. } else {
  10535. // Serialize scalar item.
  10536. add( prefix, obj );
  10537. }
  10538. }
  10539. // Serialize an array of form elements or a set of
  10540. // key/values into a query string
  10541. jQuery.param = function( a, traditional ) {
  10542. var prefix,
  10543. s = [],
  10544. add = function( key, valueOrFunction ) {
  10545. // If value is a function, invoke it and use its return value
  10546. var value = jQuery.isFunction( valueOrFunction ) ?
  10547. valueOrFunction() :
  10548. valueOrFunction;
  10549. s[ s.length ] = encodeURIComponent( key ) + "=" +
  10550. encodeURIComponent( value == null ? "" : value );
  10551. };
  10552. // If an array was passed in, assume that it is an array of form elements.
  10553. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  10554. // Serialize the form elements
  10555. jQuery.each( a, function() {
  10556. add( this.name, this.value );
  10557. } );
  10558. } else {
  10559. // If traditional, encode the "old" way (the way 1.3.2 or older
  10560. // did it), otherwise encode params recursively.
  10561. for ( prefix in a ) {
  10562. buildParams( prefix, a[ prefix ], traditional, add );
  10563. }
  10564. }
  10565. // Return the resulting serialization
  10566. return s.join( "&" );
  10567. };
  10568. jQuery.fn.extend( {
  10569. serialize: function() {
  10570. return jQuery.param( this.serializeArray() );
  10571. },
  10572. serializeArray: function() {
  10573. return this.map( function() {
  10574. // Can add propHook for "elements" to filter or add form elements
  10575. var elements = jQuery.prop( this, "elements" );
  10576. return elements ? jQuery.makeArray( elements ) : this;
  10577. } )
  10578. .filter( function() {
  10579. var type = this.type;
  10580. // Use .is( ":disabled" ) so that fieldset[disabled] works
  10581. return this.name && !jQuery( this ).is( ":disabled" ) &&
  10582. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  10583. ( this.checked || !rcheckableType.test( type ) );
  10584. } )
  10585. .map( function( i, elem ) {
  10586. var val = jQuery( this ).val();
  10587. if ( val == null ) {
  10588. return null;
  10589. }
  10590. if ( jQuery.isArray( val ) ) {
  10591. return jQuery.map( val, function( val ) {
  10592. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  10593. } );
  10594. }
  10595. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  10596. } ).get();
  10597. }
  10598. } );
  10599. var
  10600. r20 = /%20/g,
  10601. rhash = /#.*$/,
  10602. rantiCache = /([?&])_=[^&]*/,
  10603. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  10604. // #7653, #8125, #8152: local protocol detection
  10605. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  10606. rnoContent = /^(?:GET|HEAD)$/,
  10607. rprotocol = /^\/\//,
  10608. /* Prefilters
  10609. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  10610. * 2) These are called:
  10611. * - BEFORE asking for a transport
  10612. * - AFTER param serialization (s.data is a string if s.processData is true)
  10613. * 3) key is the dataType
  10614. * 4) the catchall symbol "*" can be used
  10615. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  10616. */
  10617. prefilters = {},
  10618. /* Transports bindings
  10619. * 1) key is the dataType
  10620. * 2) the catchall symbol "*" can be used
  10621. * 3) selection will start with transport dataType and THEN go to "*" if needed
  10622. */
  10623. transports = {},
  10624. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  10625. allTypes = "*/".concat( "*" ),
  10626. // Anchor tag for parsing the document origin
  10627. originAnchor = document.createElement( "a" );
  10628. originAnchor.href = location.href;
  10629. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  10630. function addToPrefiltersOrTransports( structure ) {
  10631. // dataTypeExpression is optional and defaults to "*"
  10632. return function( dataTypeExpression, func ) {
  10633. if ( typeof dataTypeExpression !== "string" ) {
  10634. func = dataTypeExpression;
  10635. dataTypeExpression = "*";
  10636. }
  10637. var dataType,
  10638. i = 0,
  10639. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  10640. if ( jQuery.isFunction( func ) ) {
  10641. // For each dataType in the dataTypeExpression
  10642. while ( ( dataType = dataTypes[ i++ ] ) ) {
  10643. // Prepend if requested
  10644. if ( dataType[ 0 ] === "+" ) {
  10645. dataType = dataType.slice( 1 ) || "*";
  10646. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  10647. // Otherwise append
  10648. } else {
  10649. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  10650. }
  10651. }
  10652. }
  10653. };
  10654. }
  10655. // Base inspection function for prefilters and transports
  10656. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  10657. var inspected = {},
  10658. seekingTransport = ( structure === transports );
  10659. function inspect( dataType ) {
  10660. var selected;
  10661. inspected[ dataType ] = true;
  10662. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  10663. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  10664. if ( typeof dataTypeOrTransport === "string" &&
  10665. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  10666. options.dataTypes.unshift( dataTypeOrTransport );
  10667. inspect( dataTypeOrTransport );
  10668. return false;
  10669. } else if ( seekingTransport ) {
  10670. return !( selected = dataTypeOrTransport );
  10671. }
  10672. } );
  10673. return selected;
  10674. }
  10675. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  10676. }
  10677. // A special extend for ajax options
  10678. // that takes "flat" options (not to be deep extended)
  10679. // Fixes #9887
  10680. function ajaxExtend( target, src ) {
  10681. var key, deep,
  10682. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  10683. for ( key in src ) {
  10684. if ( src[ key ] !== undefined ) {
  10685. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  10686. }
  10687. }
  10688. if ( deep ) {
  10689. jQuery.extend( true, target, deep );
  10690. }
  10691. return target;
  10692. }
  10693. /* Handles responses to an ajax request:
  10694. * - finds the right dataType (mediates between content-type and expected dataType)
  10695. * - returns the corresponding response
  10696. */
  10697. function ajaxHandleResponses( s, jqXHR, responses ) {
  10698. var ct, type, finalDataType, firstDataType,
  10699. contents = s.contents,
  10700. dataTypes = s.dataTypes;
  10701. // Remove auto dataType and get content-type in the process
  10702. while ( dataTypes[ 0 ] === "*" ) {
  10703. dataTypes.shift();
  10704. if ( ct === undefined ) {
  10705. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  10706. }
  10707. }
  10708. // Check if we're dealing with a known content-type
  10709. if ( ct ) {
  10710. for ( type in contents ) {
  10711. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  10712. dataTypes.unshift( type );
  10713. break;
  10714. }
  10715. }
  10716. }
  10717. // Check to see if we have a response for the expected dataType
  10718. if ( dataTypes[ 0 ] in responses ) {
  10719. finalDataType = dataTypes[ 0 ];
  10720. } else {
  10721. // Try convertible dataTypes
  10722. for ( type in responses ) {
  10723. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  10724. finalDataType = type;
  10725. break;
  10726. }
  10727. if ( !firstDataType ) {
  10728. firstDataType = type;
  10729. }
  10730. }
  10731. // Or just use first one
  10732. finalDataType = finalDataType || firstDataType;
  10733. }
  10734. // If we found a dataType
  10735. // We add the dataType to the list if needed
  10736. // and return the corresponding response
  10737. if ( finalDataType ) {
  10738. if ( finalDataType !== dataTypes[ 0 ] ) {
  10739. dataTypes.unshift( finalDataType );
  10740. }
  10741. return responses[ finalDataType ];
  10742. }
  10743. }
  10744. /* Chain conversions given the request and the original response
  10745. * Also sets the responseXXX fields on the jqXHR instance
  10746. */
  10747. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  10748. var conv2, current, conv, tmp, prev,
  10749. converters = {},
  10750. // Work with a copy of dataTypes in case we need to modify it for conversion
  10751. dataTypes = s.dataTypes.slice();
  10752. // Create converters map with lowercased keys
  10753. if ( dataTypes[ 1 ] ) {
  10754. for ( conv in s.converters ) {
  10755. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  10756. }
  10757. }
  10758. current = dataTypes.shift();
  10759. // Convert to each sequential dataType
  10760. while ( current ) {
  10761. if ( s.responseFields[ current ] ) {
  10762. jqXHR[ s.responseFields[ current ] ] = response;
  10763. }
  10764. // Apply the dataFilter if provided
  10765. if ( !prev && isSuccess && s.dataFilter ) {
  10766. response = s.dataFilter( response, s.dataType );
  10767. }
  10768. prev = current;
  10769. current = dataTypes.shift();
  10770. if ( current ) {
  10771. // There's only work to do if current dataType is non-auto
  10772. if ( current === "*" ) {
  10773. current = prev;
  10774. // Convert response if prev dataType is non-auto and differs from current
  10775. } else if ( prev !== "*" && prev !== current ) {
  10776. // Seek a direct converter
  10777. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  10778. // If none found, seek a pair
  10779. if ( !conv ) {
  10780. for ( conv2 in converters ) {
  10781. // If conv2 outputs current
  10782. tmp = conv2.split( " " );
  10783. if ( tmp[ 1 ] === current ) {
  10784. // If prev can be converted to accepted input
  10785. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  10786. converters[ "* " + tmp[ 0 ] ];
  10787. if ( conv ) {
  10788. // Condense equivalence converters
  10789. if ( conv === true ) {
  10790. conv = converters[ conv2 ];
  10791. // Otherwise, insert the intermediate dataType
  10792. } else if ( converters[ conv2 ] !== true ) {
  10793. current = tmp[ 0 ];
  10794. dataTypes.unshift( tmp[ 1 ] );
  10795. }
  10796. break;
  10797. }
  10798. }
  10799. }
  10800. }
  10801. // Apply converter (if not an equivalence)
  10802. if ( conv !== true ) {
  10803. // Unless errors are allowed to bubble, catch and return them
  10804. if ( conv && s.throws ) {
  10805. response = conv( response );
  10806. } else {
  10807. try {
  10808. response = conv( response );
  10809. } catch ( e ) {
  10810. return {
  10811. state: "parsererror",
  10812. error: conv ? e : "No conversion from " + prev + " to " + current
  10813. };
  10814. }
  10815. }
  10816. }
  10817. }
  10818. }
  10819. }
  10820. return { state: "success", data: response };
  10821. }
  10822. jQuery.extend( {
  10823. // Counter for holding the number of active queries
  10824. active: 0,
  10825. // Last-Modified header cache for next request
  10826. lastModified: {},
  10827. etag: {},
  10828. ajaxSettings: {
  10829. url: location.href,
  10830. type: "GET",
  10831. isLocal: rlocalProtocol.test( location.protocol ),
  10832. global: true,
  10833. processData: true,
  10834. async: true,
  10835. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  10836. /*
  10837. timeout: 0,
  10838. data: null,
  10839. dataType: null,
  10840. username: null,
  10841. password: null,
  10842. cache: null,
  10843. throws: false,
  10844. traditional: false,
  10845. headers: {},
  10846. */
  10847. accepts: {
  10848. "*": allTypes,
  10849. text: "text/plain",
  10850. html: "text/html",
  10851. xml: "application/xml, text/xml",
  10852. json: "application/json, text/javascript"
  10853. },
  10854. contents: {
  10855. xml: /\bxml\b/,
  10856. html: /\bhtml/,
  10857. json: /\bjson\b/
  10858. },
  10859. responseFields: {
  10860. xml: "responseXML",
  10861. text: "responseText",
  10862. json: "responseJSON"
  10863. },
  10864. // Data converters
  10865. // Keys separate source (or catchall "*") and destination types with a single space
  10866. converters: {
  10867. // Convert anything to text
  10868. "* text": String,
  10869. // Text to html (true = no transformation)
  10870. "text html": true,
  10871. // Evaluate text as a json expression
  10872. "text json": JSON.parse,
  10873. // Parse text as xml
  10874. "text xml": jQuery.parseXML
  10875. },
  10876. // For options that shouldn't be deep extended:
  10877. // you can add your own custom options here if
  10878. // and when you create one that shouldn't be
  10879. // deep extended (see ajaxExtend)
  10880. flatOptions: {
  10881. url: true,
  10882. context: true
  10883. }
  10884. },
  10885. // Creates a full fledged settings object into target
  10886. // with both ajaxSettings and settings fields.
  10887. // If target is omitted, writes into ajaxSettings.
  10888. ajaxSetup: function( target, settings ) {
  10889. return settings ?
  10890. // Building a settings object
  10891. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  10892. // Extending ajaxSettings
  10893. ajaxExtend( jQuery.ajaxSettings, target );
  10894. },
  10895. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  10896. ajaxTransport: addToPrefiltersOrTransports( transports ),
  10897. // Main method
  10898. ajax: function( url, options ) {
  10899. // If url is an object, simulate pre-1.5 signature
  10900. if ( typeof url === "object" ) {
  10901. options = url;
  10902. url = undefined;
  10903. }
  10904. // Force options to be an object
  10905. options = options || {};
  10906. var transport,
  10907. // URL without anti-cache param
  10908. cacheURL,
  10909. // Response headers
  10910. responseHeadersString,
  10911. responseHeaders,
  10912. // timeout handle
  10913. timeoutTimer,
  10914. // Url cleanup var
  10915. urlAnchor,
  10916. // Request state (becomes false upon send and true upon completion)
  10917. completed,
  10918. // To know if global events are to be dispatched
  10919. fireGlobals,
  10920. // Loop variable
  10921. i,
  10922. // uncached part of the url
  10923. uncached,
  10924. // Create the final options object
  10925. s = jQuery.ajaxSetup( {}, options ),
  10926. // Callbacks context
  10927. callbackContext = s.context || s,
  10928. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  10929. globalEventContext = s.context &&
  10930. ( callbackContext.nodeType || callbackContext.jquery ) ?
  10931. jQuery( callbackContext ) :
  10932. jQuery.event,
  10933. // Deferreds
  10934. deferred = jQuery.Deferred(),
  10935. completeDeferred = jQuery.Callbacks( "once memory" ),
  10936. // Status-dependent callbacks
  10937. statusCode = s.statusCode || {},
  10938. // Headers (they are sent all at once)
  10939. requestHeaders = {},
  10940. requestHeadersNames = {},
  10941. // Default abort message
  10942. strAbort = "canceled",
  10943. // Fake xhr
  10944. jqXHR = {
  10945. readyState: 0,
  10946. // Builds headers hashtable if needed
  10947. getResponseHeader: function( key ) {
  10948. var match;
  10949. if ( completed ) {
  10950. if ( !responseHeaders ) {
  10951. responseHeaders = {};
  10952. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  10953. responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
  10954. }
  10955. }
  10956. match = responseHeaders[ key.toLowerCase() ];
  10957. }
  10958. return match == null ? null : match;
  10959. },
  10960. // Raw string
  10961. getAllResponseHeaders: function() {
  10962. return completed ? responseHeadersString : null;
  10963. },
  10964. // Caches the header
  10965. setRequestHeader: function( name, value ) {
  10966. if ( completed == null ) {
  10967. name = requestHeadersNames[ name.toLowerCase() ] =
  10968. requestHeadersNames[ name.toLowerCase() ] || name;
  10969. requestHeaders[ name ] = value;
  10970. }
  10971. return this;
  10972. },
  10973. // Overrides response content-type header
  10974. overrideMimeType: function( type ) {
  10975. if ( completed == null ) {
  10976. s.mimeType = type;
  10977. }
  10978. return this;
  10979. },
  10980. // Status-dependent callbacks
  10981. statusCode: function( map ) {
  10982. var code;
  10983. if ( map ) {
  10984. if ( completed ) {
  10985. // Execute the appropriate callbacks
  10986. jqXHR.always( map[ jqXHR.status ] );
  10987. } else {
  10988. // Lazy-add the new callbacks in a way that preserves old ones
  10989. for ( code in map ) {
  10990. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  10991. }
  10992. }
  10993. }
  10994. return this;
  10995. },
  10996. // Cancel the request
  10997. abort: function( statusText ) {
  10998. var finalText = statusText || strAbort;
  10999. if ( transport ) {
  11000. transport.abort( finalText );
  11001. }
  11002. done( 0, finalText );
  11003. return this;
  11004. }
  11005. };
  11006. // Attach deferreds
  11007. deferred.promise( jqXHR );
  11008. // Add protocol if not provided (prefilters might expect it)
  11009. // Handle falsy url in the settings object (#10093: consistency with old signature)
  11010. // We also use the url parameter if available
  11011. s.url = ( ( url || s.url || location.href ) + "" )
  11012. .replace( rprotocol, location.protocol + "//" );
  11013. // Alias method option to type as per ticket #12004
  11014. s.type = options.method || options.type || s.method || s.type;
  11015. // Extract dataTypes list
  11016. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  11017. // A cross-domain request is in order when the origin doesn't match the current origin.
  11018. if ( s.crossDomain == null ) {
  11019. urlAnchor = document.createElement( "a" );
  11020. // Support: IE <=8 - 11, Edge 12 - 13
  11021. // IE throws exception on accessing the href property if url is malformed,
  11022. // e.g. http://example.com:80x/
  11023. try {
  11024. urlAnchor.href = s.url;
  11025. // Support: IE <=8 - 11 only
  11026. // Anchor's host property isn't correctly set when s.url is relative
  11027. urlAnchor.href = urlAnchor.href;
  11028. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  11029. urlAnchor.protocol + "//" + urlAnchor.host;
  11030. } catch ( e ) {
  11031. // If there is an error parsing the URL, assume it is crossDomain,
  11032. // it can be rejected by the transport if it is invalid
  11033. s.crossDomain = true;
  11034. }
  11035. }
  11036. // Convert data if not already a string
  11037. if ( s.data && s.processData && typeof s.data !== "string" ) {
  11038. s.data = jQuery.param( s.data, s.traditional );
  11039. }
  11040. // Apply prefilters
  11041. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  11042. // If request was aborted inside a prefilter, stop there
  11043. if ( completed ) {
  11044. return jqXHR;
  11045. }
  11046. // We can fire global events as of now if asked to
  11047. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  11048. fireGlobals = jQuery.event && s.global;
  11049. // Watch for a new set of requests
  11050. if ( fireGlobals && jQuery.active++ === 0 ) {
  11051. jQuery.event.trigger( "ajaxStart" );
  11052. }
  11053. // Uppercase the type
  11054. s.type = s.type.toUpperCase();
  11055. // Determine if request has content
  11056. s.hasContent = !rnoContent.test( s.type );
  11057. // Save the URL in case we're toying with the If-Modified-Since
  11058. // and/or If-None-Match header later on
  11059. // Remove hash to simplify url manipulation
  11060. cacheURL = s.url.replace( rhash, "" );
  11061. // More options handling for requests with no content
  11062. if ( !s.hasContent ) {
  11063. // Remember the hash so we can put it back
  11064. uncached = s.url.slice( cacheURL.length );
  11065. // If data is available, append data to url
  11066. if ( s.data ) {
  11067. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  11068. // #9682: remove data so that it's not used in an eventual retry
  11069. delete s.data;
  11070. }
  11071. // Add or update anti-cache param if needed
  11072. if ( s.cache === false ) {
  11073. cacheURL = cacheURL.replace( rantiCache, "$1" );
  11074. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  11075. }
  11076. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  11077. s.url = cacheURL + uncached;
  11078. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  11079. } else if ( s.data && s.processData &&
  11080. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  11081. s.data = s.data.replace( r20, "+" );
  11082. }
  11083. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  11084. if ( s.ifModified ) {
  11085. if ( jQuery.lastModified[ cacheURL ] ) {
  11086. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  11087. }
  11088. if ( jQuery.etag[ cacheURL ] ) {
  11089. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  11090. }
  11091. }
  11092. // Set the correct header, if data is being sent
  11093. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  11094. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  11095. }
  11096. // Set the Accepts header for the server, depending on the dataType
  11097. jqXHR.setRequestHeader(
  11098. "Accept",
  11099. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  11100. s.accepts[ s.dataTypes[ 0 ] ] +
  11101. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  11102. s.accepts[ "*" ]
  11103. );
  11104. // Check for headers option
  11105. for ( i in s.headers ) {
  11106. jqXHR.setRequestHeader( i, s.headers[ i ] );
  11107. }
  11108. // Allow custom headers/mimetypes and early abort
  11109. if ( s.beforeSend &&
  11110. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  11111. // Abort if not done already and return
  11112. return jqXHR.abort();
  11113. }
  11114. // Aborting is no longer a cancellation
  11115. strAbort = "abort";
  11116. // Install callbacks on deferreds
  11117. completeDeferred.add( s.complete );
  11118. jqXHR.done( s.success );
  11119. jqXHR.fail( s.error );
  11120. // Get transport
  11121. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  11122. // If no transport, we auto-abort
  11123. if ( !transport ) {
  11124. done( -1, "No Transport" );
  11125. } else {
  11126. jqXHR.readyState = 1;
  11127. // Send global event
  11128. if ( fireGlobals ) {
  11129. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  11130. }
  11131. // If request was aborted inside ajaxSend, stop there
  11132. if ( completed ) {
  11133. return jqXHR;
  11134. }
  11135. // Timeout
  11136. if ( s.async && s.timeout > 0 ) {
  11137. timeoutTimer = window.setTimeout( function() {
  11138. jqXHR.abort( "timeout" );
  11139. }, s.timeout );
  11140. }
  11141. try {
  11142. completed = false;
  11143. transport.send( requestHeaders, done );
  11144. } catch ( e ) {
  11145. // Rethrow post-completion exceptions
  11146. if ( completed ) {
  11147. throw e;
  11148. }
  11149. // Propagate others as results
  11150. done( -1, e );
  11151. }
  11152. }
  11153. // Callback for when everything is done
  11154. function done( status, nativeStatusText, responses, headers ) {
  11155. var isSuccess, success, error, response, modified,
  11156. statusText = nativeStatusText;
  11157. // Ignore repeat invocations
  11158. if ( completed ) {
  11159. return;
  11160. }
  11161. completed = true;
  11162. // Clear timeout if it exists
  11163. if ( timeoutTimer ) {
  11164. window.clearTimeout( timeoutTimer );
  11165. }
  11166. // Dereference transport for early garbage collection
  11167. // (no matter how long the jqXHR object will be used)
  11168. transport = undefined;
  11169. // Cache response headers
  11170. responseHeadersString = headers || "";
  11171. // Set readyState
  11172. jqXHR.readyState = status > 0 ? 4 : 0;
  11173. // Determine if successful
  11174. isSuccess = status >= 200 && status < 300 || status === 304;
  11175. // Get response data
  11176. if ( responses ) {
  11177. response = ajaxHandleResponses( s, jqXHR, responses );
  11178. }
  11179. // Convert no matter what (that way responseXXX fields are always set)
  11180. response = ajaxConvert( s, response, jqXHR, isSuccess );
  11181. // If successful, handle type chaining
  11182. if ( isSuccess ) {
  11183. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  11184. if ( s.ifModified ) {
  11185. modified = jqXHR.getResponseHeader( "Last-Modified" );
  11186. if ( modified ) {
  11187. jQuery.lastModified[ cacheURL ] = modified;
  11188. }
  11189. modified = jqXHR.getResponseHeader( "etag" );
  11190. if ( modified ) {
  11191. jQuery.etag[ cacheURL ] = modified;
  11192. }
  11193. }
  11194. // if no content
  11195. if ( status === 204 || s.type === "HEAD" ) {
  11196. statusText = "nocontent";
  11197. // if not modified
  11198. } else if ( status === 304 ) {
  11199. statusText = "notmodified";
  11200. // If we have data, let's convert it
  11201. } else {
  11202. statusText = response.state;
  11203. success = response.data;
  11204. error = response.error;
  11205. isSuccess = !error;
  11206. }
  11207. } else {
  11208. // Extract error from statusText and normalize for non-aborts
  11209. error = statusText;
  11210. if ( status || !statusText ) {
  11211. statusText = "error";
  11212. if ( status < 0 ) {
  11213. status = 0;
  11214. }
  11215. }
  11216. }
  11217. // Set data for the fake xhr object
  11218. jqXHR.status = status;
  11219. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  11220. // Success/Error
  11221. if ( isSuccess ) {
  11222. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  11223. } else {
  11224. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  11225. }
  11226. // Status-dependent callbacks
  11227. jqXHR.statusCode( statusCode );
  11228. statusCode = undefined;
  11229. if ( fireGlobals ) {
  11230. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  11231. [ jqXHR, s, isSuccess ? success : error ] );
  11232. }
  11233. // Complete
  11234. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  11235. if ( fireGlobals ) {
  11236. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  11237. // Handle the global AJAX counter
  11238. if ( !( --jQuery.active ) ) {
  11239. jQuery.event.trigger( "ajaxStop" );
  11240. }
  11241. }
  11242. }
  11243. return jqXHR;
  11244. },
  11245. getJSON: function( url, data, callback ) {
  11246. return jQuery.get( url, data, callback, "json" );
  11247. },
  11248. getScript: function( url, callback ) {
  11249. return jQuery.get( url, undefined, callback, "script" );
  11250. }
  11251. } );
  11252. jQuery.each( [ "get", "post" ], function( i, method ) {
  11253. jQuery[ method ] = function( url, data, callback, type ) {
  11254. // Shift arguments if data argument was omitted
  11255. if ( jQuery.isFunction( data ) ) {
  11256. type = type || callback;
  11257. callback = data;
  11258. data = undefined;
  11259. }
  11260. // The url can be an options object (which then must have .url)
  11261. return jQuery.ajax( jQuery.extend( {
  11262. url: url,
  11263. type: method,
  11264. dataType: type,
  11265. data: data,
  11266. success: callback
  11267. }, jQuery.isPlainObject( url ) && url ) );
  11268. };
  11269. } );
  11270. jQuery._evalUrl = function( url ) {
  11271. return jQuery.ajax( {
  11272. url: url,
  11273. // Make this explicit, since user can override this through ajaxSetup (#11264)
  11274. type: "GET",
  11275. dataType: "script",
  11276. cache: true,
  11277. async: false,
  11278. global: false,
  11279. "throws": true
  11280. } );
  11281. };
  11282. jQuery.fn.extend( {
  11283. wrapAll: function( html ) {
  11284. var wrap;
  11285. if ( this[ 0 ] ) {
  11286. if ( jQuery.isFunction( html ) ) {
  11287. html = html.call( this[ 0 ] );
  11288. }
  11289. // The elements to wrap the target around
  11290. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  11291. if ( this[ 0 ].parentNode ) {
  11292. wrap.insertBefore( this[ 0 ] );
  11293. }
  11294. wrap.map( function() {
  11295. var elem = this;
  11296. while ( elem.firstElementChild ) {
  11297. elem = elem.firstElementChild;
  11298. }
  11299. return elem;
  11300. } ).append( this );
  11301. }
  11302. return this;
  11303. },
  11304. wrapInner: function( html ) {
  11305. if ( jQuery.isFunction( html ) ) {
  11306. return this.each( function( i ) {
  11307. jQuery( this ).wrapInner( html.call( this, i ) );
  11308. } );
  11309. }
  11310. return this.each( function() {
  11311. var self = jQuery( this ),
  11312. contents = self.contents();
  11313. if ( contents.length ) {
  11314. contents.wrapAll( html );
  11315. } else {
  11316. self.append( html );
  11317. }
  11318. } );
  11319. },
  11320. wrap: function( html ) {
  11321. var isFunction = jQuery.isFunction( html );
  11322. return this.each( function( i ) {
  11323. jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
  11324. } );
  11325. },
  11326. unwrap: function( selector ) {
  11327. this.parent( selector ).not( "body" ).each( function() {
  11328. jQuery( this ).replaceWith( this.childNodes );
  11329. } );
  11330. return this;
  11331. }
  11332. } );
  11333. jQuery.expr.pseudos.hidden = function( elem ) {
  11334. return !jQuery.expr.pseudos.visible( elem );
  11335. };
  11336. jQuery.expr.pseudos.visible = function( elem ) {
  11337. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  11338. };
  11339. jQuery.ajaxSettings.xhr = function() {
  11340. try {
  11341. return new window.XMLHttpRequest();
  11342. } catch ( e ) {}
  11343. };
  11344. var xhrSuccessStatus = {
  11345. // File protocol always yields status code 0, assume 200
  11346. 0: 200,
  11347. // Support: IE <=9 only
  11348. // #1450: sometimes IE returns 1223 when it should be 204
  11349. 1223: 204
  11350. },
  11351. xhrSupported = jQuery.ajaxSettings.xhr();
  11352. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  11353. support.ajax = xhrSupported = !!xhrSupported;
  11354. jQuery.ajaxTransport( function( options ) {
  11355. var callback, errorCallback;
  11356. // Cross domain only allowed if supported through XMLHttpRequest
  11357. if ( support.cors || xhrSupported && !options.crossDomain ) {
  11358. return {
  11359. send: function( headers, complete ) {
  11360. var i,
  11361. xhr = options.xhr();
  11362. xhr.open(
  11363. options.type,
  11364. options.url,
  11365. options.async,
  11366. options.username,
  11367. options.password
  11368. );
  11369. // Apply custom fields if provided
  11370. if ( options.xhrFields ) {
  11371. for ( i in options.xhrFields ) {
  11372. xhr[ i ] = options.xhrFields[ i ];
  11373. }
  11374. }
  11375. // Override mime type if needed
  11376. if ( options.mimeType && xhr.overrideMimeType ) {
  11377. xhr.overrideMimeType( options.mimeType );
  11378. }
  11379. // X-Requested-With header
  11380. // For cross-domain requests, seeing as conditions for a preflight are
  11381. // akin to a jigsaw puzzle, we simply never set it to be sure.
  11382. // (it can always be set on a per-request basis or even using ajaxSetup)
  11383. // For same-domain requests, won't change header if already provided.
  11384. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  11385. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  11386. }
  11387. // Set headers
  11388. for ( i in headers ) {
  11389. xhr.setRequestHeader( i, headers[ i ] );
  11390. }
  11391. // Callback
  11392. callback = function( type ) {
  11393. return function() {
  11394. if ( callback ) {
  11395. callback = errorCallback = xhr.onload =
  11396. xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
  11397. if ( type === "abort" ) {
  11398. xhr.abort();
  11399. } else if ( type === "error" ) {
  11400. // Support: IE <=9 only
  11401. // On a manual native abort, IE9 throws
  11402. // errors on any property access that is not readyState
  11403. if ( typeof xhr.status !== "number" ) {
  11404. complete( 0, "error" );
  11405. } else {
  11406. complete(
  11407. // File: protocol always yields status 0; see #8605, #14207
  11408. xhr.status,
  11409. xhr.statusText
  11410. );
  11411. }
  11412. } else {
  11413. complete(
  11414. xhrSuccessStatus[ xhr.status ] || xhr.status,
  11415. xhr.statusText,
  11416. // Support: IE <=9 only
  11417. // IE9 has no XHR2 but throws on binary (trac-11426)
  11418. // For XHR2 non-text, let the caller handle it (gh-2498)
  11419. ( xhr.responseType || "text" ) !== "text" ||
  11420. typeof xhr.responseText !== "string" ?
  11421. { binary: xhr.response } :
  11422. { text: xhr.responseText },
  11423. xhr.getAllResponseHeaders()
  11424. );
  11425. }
  11426. }
  11427. };
  11428. };
  11429. // Listen to events
  11430. xhr.onload = callback();
  11431. errorCallback = xhr.onerror = callback( "error" );
  11432. // Support: IE 9 only
  11433. // Use onreadystatechange to replace onabort
  11434. // to handle uncaught aborts
  11435. if ( xhr.onabort !== undefined ) {
  11436. xhr.onabort = errorCallback;
  11437. } else {
  11438. xhr.onreadystatechange = function() {
  11439. // Check readyState before timeout as it changes
  11440. if ( xhr.readyState === 4 ) {
  11441. // Allow onerror to be called first,
  11442. // but that will not handle a native abort
  11443. // Also, save errorCallback to a variable
  11444. // as xhr.onerror cannot be accessed
  11445. window.setTimeout( function() {
  11446. if ( callback ) {
  11447. errorCallback();
  11448. }
  11449. } );
  11450. }
  11451. };
  11452. }
  11453. // Create the abort callback
  11454. callback = callback( "abort" );
  11455. try {
  11456. // Do send the request (this may raise an exception)
  11457. xhr.send( options.hasContent && options.data || null );
  11458. } catch ( e ) {
  11459. // #14683: Only rethrow if this hasn't been notified as an error yet
  11460. if ( callback ) {
  11461. throw e;
  11462. }
  11463. }
  11464. },
  11465. abort: function() {
  11466. if ( callback ) {
  11467. callback();
  11468. }
  11469. }
  11470. };
  11471. }
  11472. } );
  11473. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  11474. jQuery.ajaxPrefilter( function( s ) {
  11475. if ( s.crossDomain ) {
  11476. s.contents.script = false;
  11477. }
  11478. } );
  11479. // Install script dataType
  11480. jQuery.ajaxSetup( {
  11481. accepts: {
  11482. script: "text/javascript, application/javascript, " +
  11483. "application/ecmascript, application/x-ecmascript"
  11484. },
  11485. contents: {
  11486. script: /\b(?:java|ecma)script\b/
  11487. },
  11488. converters: {
  11489. "text script": function( text ) {
  11490. jQuery.globalEval( text );
  11491. return text;
  11492. }
  11493. }
  11494. } );
  11495. // Handle cache's special case and crossDomain
  11496. jQuery.ajaxPrefilter( "script", function( s ) {
  11497. if ( s.cache === undefined ) {
  11498. s.cache = false;
  11499. }
  11500. if ( s.crossDomain ) {
  11501. s.type = "GET";
  11502. }
  11503. } );
  11504. // Bind script tag hack transport
  11505. jQuery.ajaxTransport( "script", function( s ) {
  11506. // This transport only deals with cross domain requests
  11507. if ( s.crossDomain ) {
  11508. var script, callback;
  11509. return {
  11510. send: function( _, complete ) {
  11511. script = jQuery( "<script>" ).prop( {
  11512. charset: s.scriptCharset,
  11513. src: s.url
  11514. } ).on(
  11515. "load error",
  11516. callback = function( evt ) {
  11517. script.remove();
  11518. callback = null;
  11519. if ( evt ) {
  11520. complete( evt.type === "error" ? 404 : 200, evt.type );
  11521. }
  11522. }
  11523. );
  11524. // Use native DOM manipulation to avoid our domManip AJAX trickery
  11525. document.head.appendChild( script[ 0 ] );
  11526. },
  11527. abort: function() {
  11528. if ( callback ) {
  11529. callback();
  11530. }
  11531. }
  11532. };
  11533. }
  11534. } );
  11535. var oldCallbacks = [],
  11536. rjsonp = /(=)\?(?=&|$)|\?\?/;
  11537. // Default jsonp settings
  11538. jQuery.ajaxSetup( {
  11539. jsonp: "callback",
  11540. jsonpCallback: function() {
  11541. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  11542. this[ callback ] = true;
  11543. return callback;
  11544. }
  11545. } );
  11546. // Detect, normalize options and install callbacks for jsonp requests
  11547. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  11548. var callbackName, overwritten, responseContainer,
  11549. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  11550. "url" :
  11551. typeof s.data === "string" &&
  11552. ( s.contentType || "" )
  11553. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  11554. rjsonp.test( s.data ) && "data"
  11555. );
  11556. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  11557. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  11558. // Get callback name, remembering preexisting value associated with it
  11559. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  11560. s.jsonpCallback() :
  11561. s.jsonpCallback;
  11562. // Insert callback into url or form data
  11563. if ( jsonProp ) {
  11564. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  11565. } else if ( s.jsonp !== false ) {
  11566. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  11567. }
  11568. // Use data converter to retrieve json after script execution
  11569. s.converters[ "script json" ] = function() {
  11570. if ( !responseContainer ) {
  11571. jQuery.error( callbackName + " was not called" );
  11572. }
  11573. return responseContainer[ 0 ];
  11574. };
  11575. // Force json dataType
  11576. s.dataTypes[ 0 ] = "json";
  11577. // Install callback
  11578. overwritten = window[ callbackName ];
  11579. window[ callbackName ] = function() {
  11580. responseContainer = arguments;
  11581. };
  11582. // Clean-up function (fires after converters)
  11583. jqXHR.always( function() {
  11584. // If previous value didn't exist - remove it
  11585. if ( overwritten === undefined ) {
  11586. jQuery( window ).removeProp( callbackName );
  11587. // Otherwise restore preexisting value
  11588. } else {
  11589. window[ callbackName ] = overwritten;
  11590. }
  11591. // Save back as free
  11592. if ( s[ callbackName ] ) {
  11593. // Make sure that re-using the options doesn't screw things around
  11594. s.jsonpCallback = originalSettings.jsonpCallback;
  11595. // Save the callback name for future use
  11596. oldCallbacks.push( callbackName );
  11597. }
  11598. // Call if it was a function and we have a response
  11599. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  11600. overwritten( responseContainer[ 0 ] );
  11601. }
  11602. responseContainer = overwritten = undefined;
  11603. } );
  11604. // Delegate to script
  11605. return "script";
  11606. }
  11607. } );
  11608. // Support: Safari 8 only
  11609. // In Safari 8 documents created via document.implementation.createHTMLDocument
  11610. // collapse sibling forms: the second one becomes a child of the first one.
  11611. // Because of that, this security measure has to be disabled in Safari 8.
  11612. // https://bugs.webkit.org/show_bug.cgi?id=137337
  11613. support.createHTMLDocument = ( function() {
  11614. var body = document.implementation.createHTMLDocument( "" ).body;
  11615. body.innerHTML = "<form></form><form></form>";
  11616. return body.childNodes.length === 2;
  11617. } )();
  11618. // Argument "data" should be string of html
  11619. // context (optional): If specified, the fragment will be created in this context,
  11620. // defaults to document
  11621. // keepScripts (optional): If true, will include scripts passed in the html string
  11622. jQuery.parseHTML = function( data, context, keepScripts ) {
  11623. if ( typeof data !== "string" ) {
  11624. return [];
  11625. }
  11626. if ( typeof context === "boolean" ) {
  11627. keepScripts = context;
  11628. context = false;
  11629. }
  11630. var base, parsed, scripts;
  11631. if ( !context ) {
  11632. // Stop scripts or inline event handlers from being executed immediately
  11633. // by using document.implementation
  11634. if ( support.createHTMLDocument ) {
  11635. context = document.implementation.createHTMLDocument( "" );
  11636. // Set the base href for the created document
  11637. // so any parsed elements with URLs
  11638. // are based on the document's URL (gh-2965)
  11639. base = context.createElement( "base" );
  11640. base.href = document.location.href;
  11641. context.head.appendChild( base );
  11642. } else {
  11643. context = document;
  11644. }
  11645. }
  11646. parsed = rsingleTag.exec( data );
  11647. scripts = !keepScripts && [];
  11648. // Single tag
  11649. if ( parsed ) {
  11650. return [ context.createElement( parsed[ 1 ] ) ];
  11651. }
  11652. parsed = buildFragment( [ data ], context, scripts );
  11653. if ( scripts && scripts.length ) {
  11654. jQuery( scripts ).remove();
  11655. }
  11656. return jQuery.merge( [], parsed.childNodes );
  11657. };
  11658. /**
  11659. * Load a url into a page
  11660. */
  11661. jQuery.fn.load = function( url, params, callback ) {
  11662. var selector, type, response,
  11663. self = this,
  11664. off = url.indexOf( " " );
  11665. if ( off > -1 ) {
  11666. selector = stripAndCollapse( url.slice( off ) );
  11667. url = url.slice( 0, off );
  11668. }
  11669. // If it's a function
  11670. if ( jQuery.isFunction( params ) ) {
  11671. // We assume that it's the callback
  11672. callback = params;
  11673. params = undefined;
  11674. // Otherwise, build a param string
  11675. } else if ( params && typeof params === "object" ) {
  11676. type = "POST";
  11677. }
  11678. // If we have elements to modify, make the request
  11679. if ( self.length > 0 ) {
  11680. jQuery.ajax( {
  11681. url: url,
  11682. // If "type" variable is undefined, then "GET" method will be used.
  11683. // Make value of this field explicit since
  11684. // user can override it through ajaxSetup method
  11685. type: type || "GET",
  11686. dataType: "html",
  11687. data: params
  11688. } ).done( function( responseText ) {
  11689. // Save response for use in complete callback
  11690. response = arguments;
  11691. self.html( selector ?
  11692. // If a selector was specified, locate the right elements in a dummy div
  11693. // Exclude scripts to avoid IE 'Permission Denied' errors
  11694. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  11695. // Otherwise use the full result
  11696. responseText );
  11697. // If the request succeeds, this function gets "data", "status", "jqXHR"
  11698. // but they are ignored because response was set above.
  11699. // If it fails, this function gets "jqXHR", "status", "error"
  11700. } ).always( callback && function( jqXHR, status ) {
  11701. self.each( function() {
  11702. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  11703. } );
  11704. } );
  11705. }
  11706. return this;
  11707. };
  11708. // Attach a bunch of functions for handling common AJAX events
  11709. jQuery.each( [
  11710. "ajaxStart",
  11711. "ajaxStop",
  11712. "ajaxComplete",
  11713. "ajaxError",
  11714. "ajaxSuccess",
  11715. "ajaxSend"
  11716. ], function( i, type ) {
  11717. jQuery.fn[ type ] = function( fn ) {
  11718. return this.on( type, fn );
  11719. };
  11720. } );
  11721. jQuery.expr.pseudos.animated = function( elem ) {
  11722. return jQuery.grep( jQuery.timers, function( fn ) {
  11723. return elem === fn.elem;
  11724. } ).length;
  11725. };
  11726. /**
  11727. * Gets a window from an element
  11728. */
  11729. function getWindow( elem ) {
  11730. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  11731. }
  11732. jQuery.offset = {
  11733. setOffset: function( elem, options, i ) {
  11734. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  11735. position = jQuery.css( elem, "position" ),
  11736. curElem = jQuery( elem ),
  11737. props = {};
  11738. // Set position first, in-case top/left are set even on static elem
  11739. if ( position === "static" ) {
  11740. elem.style.position = "relative";
  11741. }
  11742. curOffset = curElem.offset();
  11743. curCSSTop = jQuery.css( elem, "top" );
  11744. curCSSLeft = jQuery.css( elem, "left" );
  11745. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  11746. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  11747. // Need to be able to calculate position if either
  11748. // top or left is auto and position is either absolute or fixed
  11749. if ( calculatePosition ) {
  11750. curPosition = curElem.position();
  11751. curTop = curPosition.top;
  11752. curLeft = curPosition.left;
  11753. } else {
  11754. curTop = parseFloat( curCSSTop ) || 0;
  11755. curLeft = parseFloat( curCSSLeft ) || 0;
  11756. }
  11757. if ( jQuery.isFunction( options ) ) {
  11758. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  11759. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  11760. }
  11761. if ( options.top != null ) {
  11762. props.top = ( options.top - curOffset.top ) + curTop;
  11763. }
  11764. if ( options.left != null ) {
  11765. props.left = ( options.left - curOffset.left ) + curLeft;
  11766. }
  11767. if ( "using" in options ) {
  11768. options.using.call( elem, props );
  11769. } else {
  11770. curElem.css( props );
  11771. }
  11772. }
  11773. };
  11774. jQuery.fn.extend( {
  11775. offset: function( options ) {
  11776. // Preserve chaining for setter
  11777. if ( arguments.length ) {
  11778. return options === undefined ?
  11779. this :
  11780. this.each( function( i ) {
  11781. jQuery.offset.setOffset( this, options, i );
  11782. } );
  11783. }
  11784. var docElem, win, rect, doc,
  11785. elem = this[ 0 ];
  11786. if ( !elem ) {
  11787. return;
  11788. }
  11789. // Support: IE <=11 only
  11790. // Running getBoundingClientRect on a
  11791. // disconnected node in IE throws an error
  11792. if ( !elem.getClientRects().length ) {
  11793. return { top: 0, left: 0 };
  11794. }
  11795. rect = elem.getBoundingClientRect();
  11796. // Make sure element is not hidden (display: none)
  11797. if ( rect.width || rect.height ) {
  11798. doc = elem.ownerDocument;
  11799. win = getWindow( doc );
  11800. docElem = doc.documentElement;
  11801. return {
  11802. top: rect.top + win.pageYOffset - docElem.clientTop,
  11803. left: rect.left + win.pageXOffset - docElem.clientLeft
  11804. };
  11805. }
  11806. // Return zeros for disconnected and hidden elements (gh-2310)
  11807. return rect;
  11808. },
  11809. position: function() {
  11810. if ( !this[ 0 ] ) {
  11811. return;
  11812. }
  11813. var offsetParent, offset,
  11814. elem = this[ 0 ],
  11815. parentOffset = { top: 0, left: 0 };
  11816. // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
  11817. // because it is its only offset parent
  11818. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  11819. // Assume getBoundingClientRect is there when computed position is fixed
  11820. offset = elem.getBoundingClientRect();
  11821. } else {
  11822. // Get *real* offsetParent
  11823. offsetParent = this.offsetParent();
  11824. // Get correct offsets
  11825. offset = this.offset();
  11826. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  11827. parentOffset = offsetParent.offset();
  11828. }
  11829. // Add offsetParent borders
  11830. parentOffset = {
  11831. top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
  11832. left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
  11833. };
  11834. }
  11835. // Subtract parent offsets and element margins
  11836. return {
  11837. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  11838. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  11839. };
  11840. },
  11841. // This method will return documentElement in the following cases:
  11842. // 1) For the element inside the iframe without offsetParent, this method will return
  11843. // documentElement of the parent window
  11844. // 2) For the hidden or detached element
  11845. // 3) For body or html element, i.e. in case of the html node - it will return itself
  11846. //
  11847. // but those exceptions were never presented as a real life use-cases
  11848. // and might be considered as more preferable results.
  11849. //
  11850. // This logic, however, is not guaranteed and can change at any point in the future
  11851. offsetParent: function() {
  11852. return this.map( function() {
  11853. var offsetParent = this.offsetParent;
  11854. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  11855. offsetParent = offsetParent.offsetParent;
  11856. }
  11857. return offsetParent || documentElement;
  11858. } );
  11859. }
  11860. } );
  11861. // Create scrollLeft and scrollTop methods
  11862. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  11863. var top = "pageYOffset" === prop;
  11864. jQuery.fn[ method ] = function( val ) {
  11865. return access( this, function( elem, method, val ) {
  11866. var win = getWindow( elem );
  11867. if ( val === undefined ) {
  11868. return win ? win[ prop ] : elem[ method ];
  11869. }
  11870. if ( win ) {
  11871. win.scrollTo(
  11872. !top ? val : win.pageXOffset,
  11873. top ? val : win.pageYOffset
  11874. );
  11875. } else {
  11876. elem[ method ] = val;
  11877. }
  11878. }, method, val, arguments.length );
  11879. };
  11880. } );
  11881. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  11882. // Add the top/left cssHooks using jQuery.fn.position
  11883. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  11884. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  11885. // getComputedStyle returns percent when specified for top/left/bottom/right;
  11886. // rather than make the css module depend on the offset module, just check for it here
  11887. jQuery.each( [ "top", "left" ], function( i, prop ) {
  11888. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  11889. function( elem, computed ) {
  11890. if ( computed ) {
  11891. computed = curCSS( elem, prop );
  11892. // If curCSS returns percentage, fallback to offset
  11893. return rnumnonpx.test( computed ) ?
  11894. jQuery( elem ).position()[ prop ] + "px" :
  11895. computed;
  11896. }
  11897. }
  11898. );
  11899. } );
  11900. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  11901. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  11902. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  11903. function( defaultExtra, funcName ) {
  11904. // Margin is only for outerHeight, outerWidth
  11905. jQuery.fn[ funcName ] = function( margin, value ) {
  11906. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  11907. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  11908. return access( this, function( elem, type, value ) {
  11909. var doc;
  11910. if ( jQuery.isWindow( elem ) ) {
  11911. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  11912. return funcName.indexOf( "outer" ) === 0 ?
  11913. elem[ "inner" + name ] :
  11914. elem.document.documentElement[ "client" + name ];
  11915. }
  11916. // Get document width or height
  11917. if ( elem.nodeType === 9 ) {
  11918. doc = elem.documentElement;
  11919. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  11920. // whichever is greatest
  11921. return Math.max(
  11922. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  11923. elem.body[ "offset" + name ], doc[ "offset" + name ],
  11924. doc[ "client" + name ]
  11925. );
  11926. }
  11927. return value === undefined ?
  11928. // Get width or height on the element, requesting but not forcing parseFloat
  11929. jQuery.css( elem, type, extra ) :
  11930. // Set width or height on the element
  11931. jQuery.style( elem, type, value, extra );
  11932. }, type, chainable ? margin : undefined, chainable );
  11933. };
  11934. } );
  11935. } );
  11936. jQuery.fn.extend( {
  11937. bind: function( types, data, fn ) {
  11938. return this.on( types, null, data, fn );
  11939. },
  11940. unbind: function( types, fn ) {
  11941. return this.off( types, null, fn );
  11942. },
  11943. delegate: function( selector, types, data, fn ) {
  11944. return this.on( types, selector, data, fn );
  11945. },
  11946. undelegate: function( selector, types, fn ) {
  11947. // ( namespace ) or ( selector, types [, fn] )
  11948. return arguments.length === 1 ?
  11949. this.off( selector, "**" ) :
  11950. this.off( types, selector || "**", fn );
  11951. }
  11952. } );
  11953. jQuery.parseJSON = JSON.parse;
  11954. // Register as a named AMD module, since jQuery can be concatenated with other
  11955. // files that may use define, but not via a proper concatenation script that
  11956. // understands anonymous AMD modules. A named AMD is safest and most robust
  11957. // way to register. Lowercase jquery is used because AMD module names are
  11958. // derived from file names, and jQuery is normally delivered in a lowercase
  11959. // file name. Do this after creating the global so that if an AMD module wants
  11960. // to call noConflict to hide this version of jQuery, it will work.
  11961. // Note that for maximum portability, libraries that are not jQuery should
  11962. // declare themselves as anonymous modules, and avoid setting a global if an
  11963. // AMD loader is present. jQuery is a special case. For more information, see
  11964. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  11965. if ( true ) {
  11966. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11967. return jQuery;
  11968. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  11969. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11970. }
  11971. var
  11972. // Map over jQuery in case of overwrite
  11973. _jQuery = window.jQuery,
  11974. // Map over the $ in case of overwrite
  11975. _$ = window.$;
  11976. jQuery.noConflict = function( deep ) {
  11977. if ( window.$ === jQuery ) {
  11978. window.$ = _$;
  11979. }
  11980. if ( deep && window.jQuery === jQuery ) {
  11981. window.jQuery = _jQuery;
  11982. }
  11983. return jQuery;
  11984. };
  11985. // Expose jQuery and $ identifiers, even in AMD
  11986. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  11987. // and CommonJS for browser emulators (#13566)
  11988. if ( !noGlobal ) {
  11989. window.jQuery = window.$ = jQuery;
  11990. }
  11991. return jQuery;
  11992. } );
  11993. /***/ }),
  11994. /* 3 */
  11995. /***/ (function(module, exports, __webpack_require__) {
  11996. /*!
  11997. * sweetalert2 v6.4.2
  11998. * Released under the MIT License.
  11999. */
  12000. (function (global, factory) {
  12001. true ? module.exports = factory() :
  12002. typeof define === 'function' && define.amd ? define(factory) :
  12003. (global.Sweetalert2 = factory());
  12004. }(this, (function () { 'use strict';
  12005. var defaultParams = {
  12006. title: '',
  12007. titleText: '',
  12008. text: '',
  12009. html: '',
  12010. type: null,
  12011. customClass: '',
  12012. target: 'body',
  12013. animation: true,
  12014. allowOutsideClick: true,
  12015. allowEscapeKey: true,
  12016. allowEnterKey: true,
  12017. showConfirmButton: true,
  12018. showCancelButton: false,
  12019. preConfirm: null,
  12020. confirmButtonText: 'OK',
  12021. confirmButtonColor: '#3085d6',
  12022. confirmButtonClass: null,
  12023. cancelButtonText: 'Cancel',
  12024. cancelButtonColor: '#aaa',
  12025. cancelButtonClass: null,
  12026. buttonsStyling: true,
  12027. reverseButtons: false,
  12028. focusCancel: false,
  12029. showCloseButton: false,
  12030. showLoaderOnConfirm: false,
  12031. imageUrl: null,
  12032. imageWidth: null,
  12033. imageHeight: null,
  12034. imageClass: null,
  12035. timer: null,
  12036. width: 500,
  12037. padding: 20,
  12038. background: '#fff',
  12039. input: null,
  12040. inputPlaceholder: '',
  12041. inputValue: '',
  12042. inputOptions: {},
  12043. inputAutoTrim: true,
  12044. inputClass: null,
  12045. inputAttributes: {},
  12046. inputValidator: null,
  12047. progressSteps: [],
  12048. currentProgressStep: null,
  12049. progressStepsDistance: '40px',
  12050. onOpen: null,
  12051. onClose: null
  12052. };
  12053. var swalPrefix = 'swal2-';
  12054. var prefix = function prefix(items) {
  12055. var result = {};
  12056. for (var i in items) {
  12057. result[items[i]] = swalPrefix + items[i];
  12058. }
  12059. return result;
  12060. };
  12061. 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']);
  12062. var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);
  12063. /*
  12064. * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
  12065. */
  12066. var colorLuminance = function colorLuminance(hex, lum) {
  12067. // Validate hex string
  12068. hex = String(hex).replace(/[^0-9a-f]/gi, '');
  12069. if (hex.length < 6) {
  12070. hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
  12071. }
  12072. lum = lum || 0;
  12073. // Convert to decimal and change luminosity
  12074. var rgb = '#';
  12075. for (var i = 0; i < 3; i++) {
  12076. var c = parseInt(hex.substr(i * 2, 2), 16);
  12077. c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
  12078. rgb += ('00' + c).substr(c.length);
  12079. }
  12080. return rgb;
  12081. };
  12082. /* global MouseEvent */
  12083. // Remember state in cases where opening and handling a modal will fiddle with it.
  12084. var states = {
  12085. previousWindowKeyDown: null,
  12086. previousActiveElement: null,
  12087. previousBodyPadding: null
  12088. };
  12089. /*
  12090. * Add modal + overlay to DOM
  12091. */
  12092. var init = function init(params) {
  12093. if (typeof document === 'undefined') {
  12094. console.error('SweetAlert2 requires document to initialize');
  12095. return;
  12096. }
  12097. var container = document.createElement('div');
  12098. container.className = swalClasses.container;
  12099. container.innerHTML = sweetHTML;
  12100. var targetElement = document.querySelector(params.target);
  12101. if (!targetElement) {
  12102. console.warn('SweetAlert2: Can\'t find the target "' + params.target + '"');
  12103. targetElement = document.body;
  12104. }
  12105. targetElement.appendChild(container);
  12106. var modal = getModal();
  12107. var input = getChildByClass(modal, swalClasses.input);
  12108. var file = getChildByClass(modal, swalClasses.file);
  12109. var range = modal.querySelector('.' + swalClasses.range + ' input');
  12110. var rangeOutput = modal.querySelector('.' + swalClasses.range + ' output');
  12111. var select = getChildByClass(modal, swalClasses.select);
  12112. var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input');
  12113. var textarea = getChildByClass(modal, swalClasses.textarea);
  12114. input.oninput = function () {
  12115. sweetAlert.resetValidationError();
  12116. };
  12117. input.onkeydown = function (event) {
  12118. setTimeout(function () {
  12119. if (event.keyCode === 13 && params.allowEnterKey) {
  12120. event.stopPropagation();
  12121. sweetAlert.clickConfirm();
  12122. }
  12123. }, 0);
  12124. };
  12125. file.onchange = function () {
  12126. sweetAlert.resetValidationError();
  12127. };
  12128. range.oninput = function () {
  12129. sweetAlert.resetValidationError();
  12130. rangeOutput.value = range.value;
  12131. };
  12132. range.onchange = function () {
  12133. sweetAlert.resetValidationError();
  12134. range.previousSibling.value = range.value;
  12135. };
  12136. select.onchange = function () {
  12137. sweetAlert.resetValidationError();
  12138. };
  12139. checkbox.onchange = function () {
  12140. sweetAlert.resetValidationError();
  12141. };
  12142. textarea.oninput = function () {
  12143. sweetAlert.resetValidationError();
  12144. };
  12145. return modal;
  12146. };
  12147. /*
  12148. * Manipulate DOM
  12149. */
  12150. 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, '');
  12151. var getContainer = function getContainer() {
  12152. return document.body.querySelector('.' + swalClasses.container);
  12153. };
  12154. var getModal = function getModal() {
  12155. return getContainer() ? getContainer().querySelector('.' + swalClasses.modal) : null;
  12156. };
  12157. var getIcons = function getIcons() {
  12158. var modal = getModal();
  12159. return modal.querySelectorAll('.' + swalClasses.icon);
  12160. };
  12161. var elementByClass = function elementByClass(className) {
  12162. return getContainer() ? getContainer().querySelector('.' + className) : null;
  12163. };
  12164. var getTitle = function getTitle() {
  12165. return elementByClass(swalClasses.title);
  12166. };
  12167. var getContent = function getContent() {
  12168. return elementByClass(swalClasses.content);
  12169. };
  12170. var getImage = function getImage() {
  12171. return elementByClass(swalClasses.image);
  12172. };
  12173. var getSpacer = function getSpacer() {
  12174. return elementByClass(swalClasses.spacer);
  12175. };
  12176. var getProgressSteps = function getProgressSteps() {
  12177. return elementByClass(swalClasses.progresssteps);
  12178. };
  12179. var getValidationError = function getValidationError() {
  12180. return elementByClass(swalClasses.validationerror);
  12181. };
  12182. var getConfirmButton = function getConfirmButton() {
  12183. return elementByClass(swalClasses.confirm);
  12184. };
  12185. var getCancelButton = function getCancelButton() {
  12186. return elementByClass(swalClasses.cancel);
  12187. };
  12188. var getCloseButton = function getCloseButton() {
  12189. return elementByClass(swalClasses.close);
  12190. };
  12191. var getFocusableElements = function getFocusableElements(focusCancel) {
  12192. var buttons = [getConfirmButton(), getCancelButton()];
  12193. if (focusCancel) {
  12194. buttons.reverse();
  12195. }
  12196. return buttons.concat(Array.prototype.slice.call(getModal().querySelectorAll('button:not([class^=' + swalPrefix + ']), input:not([type=hidden]), textarea, select')));
  12197. };
  12198. var hasClass = function hasClass(elem, className) {
  12199. if (elem.classList) {
  12200. return elem.classList.contains(className);
  12201. }
  12202. return false;
  12203. };
  12204. var focusInput = function focusInput(input) {
  12205. input.focus();
  12206. // place cursor at end of text in text input
  12207. if (input.type !== 'file') {
  12208. // http://stackoverflow.com/a/2345915/1331425
  12209. var val = input.value;
  12210. input.value = '';
  12211. input.value = val;
  12212. }
  12213. };
  12214. var addClass = function addClass(elem, className) {
  12215. if (!elem || !className) {
  12216. return;
  12217. }
  12218. var classes = className.split(/\s+/).filter(Boolean);
  12219. classes.forEach(function (className) {
  12220. elem.classList.add(className);
  12221. });
  12222. };
  12223. var removeClass = function removeClass(elem, className) {
  12224. if (!elem || !className) {
  12225. return;
  12226. }
  12227. var classes = className.split(/\s+/).filter(Boolean);
  12228. classes.forEach(function (className) {
  12229. elem.classList.remove(className);
  12230. });
  12231. };
  12232. var getChildByClass = function getChildByClass(elem, className) {
  12233. for (var i = 0; i < elem.childNodes.length; i++) {
  12234. if (hasClass(elem.childNodes[i], className)) {
  12235. return elem.childNodes[i];
  12236. }
  12237. }
  12238. };
  12239. var show = function show(elem, display) {
  12240. if (!display) {
  12241. display = 'block';
  12242. }
  12243. elem.style.opacity = '';
  12244. elem.style.display = display;
  12245. };
  12246. var hide = function hide(elem) {
  12247. elem.style.opacity = '';
  12248. elem.style.display = 'none';
  12249. };
  12250. var empty = function empty(elem) {
  12251. while (elem.firstChild) {
  12252. elem.removeChild(elem.firstChild);
  12253. }
  12254. };
  12255. // borrowed from jqeury $(elem).is(':visible') implementation
  12256. var isVisible = function isVisible(elem) {
  12257. return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length;
  12258. };
  12259. var removeStyleProperty = function removeStyleProperty(elem, property) {
  12260. if (elem.style.removeProperty) {
  12261. elem.style.removeProperty(property);
  12262. } else {
  12263. elem.style.removeAttribute(property);
  12264. }
  12265. };
  12266. var fireClick = function fireClick(node) {
  12267. if (!isVisible(node)) {
  12268. return false;
  12269. }
  12270. // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/
  12271. // Then fixed for today's Chrome browser.
  12272. if (typeof MouseEvent === 'function') {
  12273. // Up-to-date approach
  12274. var mevt = new MouseEvent('click', {
  12275. view: window,
  12276. bubbles: false,
  12277. cancelable: true
  12278. });
  12279. node.dispatchEvent(mevt);
  12280. } else if (document.createEvent) {
  12281. // Fallback
  12282. var evt = document.createEvent('MouseEvents');
  12283. evt.initEvent('click', false, false);
  12284. node.dispatchEvent(evt);
  12285. } else if (document.createEventObject) {
  12286. node.fireEvent('onclick');
  12287. } else if (typeof node.onclick === 'function') {
  12288. node.onclick();
  12289. }
  12290. };
  12291. var animationEndEvent = function () {
  12292. var testEl = document.createElement('div');
  12293. var transEndEventNames = {
  12294. 'WebkitAnimation': 'webkitAnimationEnd',
  12295. 'OAnimation': 'oAnimationEnd oanimationend',
  12296. 'msAnimation': 'MSAnimationEnd',
  12297. 'animation': 'animationend'
  12298. };
  12299. for (var i in transEndEventNames) {
  12300. if (transEndEventNames.hasOwnProperty(i) && testEl.style[i] !== undefined) {
  12301. return transEndEventNames[i];
  12302. }
  12303. }
  12304. return false;
  12305. }();
  12306. // Reset previous window keydown handler and focued element
  12307. var resetPrevState = function resetPrevState() {
  12308. window.onkeydown = states.previousWindowKeyDown;
  12309. if (states.previousActiveElement && states.previousActiveElement.focus) {
  12310. var x = window.scrollX;
  12311. var y = window.scrollY;
  12312. states.previousActiveElement.focus();
  12313. if (x && y) {
  12314. // IE has no scrollX/scrollY support
  12315. window.scrollTo(x, y);
  12316. }
  12317. }
  12318. };
  12319. // Measure width of scrollbar
  12320. // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
  12321. var measureScrollbar = function measureScrollbar() {
  12322. var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
  12323. if (supportsTouch) {
  12324. return 0;
  12325. }
  12326. var scrollDiv = document.createElement('div');
  12327. scrollDiv.style.width = '50px';
  12328. scrollDiv.style.height = '50px';
  12329. scrollDiv.style.overflow = 'scroll';
  12330. document.body.appendChild(scrollDiv);
  12331. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  12332. document.body.removeChild(scrollDiv);
  12333. return scrollbarWidth;
  12334. };
  12335. // JavaScript Debounce Function
  12336. // Simplivied version of https://davidwalsh.name/javascript-debounce-function
  12337. var debounce = function debounce(func, wait) {
  12338. var timeout = void 0;
  12339. return function () {
  12340. var later = function later() {
  12341. timeout = null;
  12342. func();
  12343. };
  12344. clearTimeout(timeout);
  12345. timeout = setTimeout(later, wait);
  12346. };
  12347. };
  12348. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  12349. return typeof obj;
  12350. } : function (obj) {
  12351. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  12352. };
  12353. var _extends = Object.assign || function (target) {
  12354. for (var i = 1; i < arguments.length; i++) {
  12355. var source = arguments[i];
  12356. for (var key in source) {
  12357. if (Object.prototype.hasOwnProperty.call(source, key)) {
  12358. target[key] = source[key];
  12359. }
  12360. }
  12361. }
  12362. return target;
  12363. };
  12364. var modalParams = _extends({}, defaultParams);
  12365. var queue = [];
  12366. var swal2Observer = void 0;
  12367. /*
  12368. * Set type, text and actions on modal
  12369. */
  12370. var setParameters = function setParameters(params) {
  12371. var modal = getModal() || init(params);
  12372. for (var param in params) {
  12373. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  12374. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  12375. }
  12376. }
  12377. // set modal width and margin-left
  12378. modal.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
  12379. modal.style.padding = params.padding + 'px';
  12380. modal.style.background = params.background;
  12381. var title = getTitle();
  12382. var content = getContent();
  12383. var confirmButton = getConfirmButton();
  12384. var cancelButton = getCancelButton();
  12385. var closeButton = getCloseButton();
  12386. // Title
  12387. if (params.titleText) {
  12388. title.innerText = params.titleText;
  12389. } else {
  12390. title.innerHTML = params.title.split('\n').join('<br>');
  12391. }
  12392. // Content
  12393. if (params.text || params.html) {
  12394. if (_typeof(params.html) === 'object') {
  12395. content.innerHTML = '';
  12396. if (0 in params.html) {
  12397. for (var i = 0; i in params.html; i++) {
  12398. content.appendChild(params.html[i].cloneNode(true));
  12399. }
  12400. } else {
  12401. content.appendChild(params.html.cloneNode(true));
  12402. }
  12403. } else if (params.html) {
  12404. content.innerHTML = params.html;
  12405. } else if (params.text) {
  12406. content.textContent = params.text;
  12407. }
  12408. show(content);
  12409. } else {
  12410. hide(content);
  12411. }
  12412. // Close button
  12413. if (params.showCloseButton) {
  12414. show(closeButton);
  12415. } else {
  12416. hide(closeButton);
  12417. }
  12418. // Custom Class
  12419. modal.className = swalClasses.modal;
  12420. if (params.customClass) {
  12421. addClass(modal, params.customClass);
  12422. }
  12423. // Progress steps
  12424. var progressStepsContainer = getProgressSteps();
  12425. var currentProgressStep = parseInt(params.currentProgressStep === null ? sweetAlert.getQueueStep() : params.currentProgressStep, 10);
  12426. if (params.progressSteps.length) {
  12427. show(progressStepsContainer);
  12428. empty(progressStepsContainer);
  12429. if (currentProgressStep >= params.progressSteps.length) {
  12430. console.warn('SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
  12431. }
  12432. params.progressSteps.forEach(function (step, index) {
  12433. var circle = document.createElement('li');
  12434. addClass(circle, swalClasses.progresscircle);
  12435. circle.innerHTML = step;
  12436. if (index === currentProgressStep) {
  12437. addClass(circle, swalClasses.activeprogressstep);
  12438. }
  12439. progressStepsContainer.appendChild(circle);
  12440. if (index !== params.progressSteps.length - 1) {
  12441. var line = document.createElement('li');
  12442. addClass(line, swalClasses.progressline);
  12443. line.style.width = params.progressStepsDistance;
  12444. progressStepsContainer.appendChild(line);
  12445. }
  12446. });
  12447. } else {
  12448. hide(progressStepsContainer);
  12449. }
  12450. // Icon
  12451. var icons = getIcons();
  12452. for (var _i = 0; _i < icons.length; _i++) {
  12453. hide(icons[_i]);
  12454. }
  12455. if (params.type) {
  12456. var validType = false;
  12457. for (var iconType in iconTypes) {
  12458. if (params.type === iconType) {
  12459. validType = true;
  12460. break;
  12461. }
  12462. }
  12463. if (!validType) {
  12464. console.error('SweetAlert2: Unknown alert type: ' + params.type);
  12465. return false;
  12466. }
  12467. var icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]);
  12468. show(icon);
  12469. // Animate icon
  12470. switch (params.type) {
  12471. case 'success':
  12472. addClass(icon, 'animate');
  12473. addClass(icon.querySelector('.tip'), 'animate-success-tip');
  12474. addClass(icon.querySelector('.long'), 'animate-success-long');
  12475. break;
  12476. case 'error':
  12477. addClass(icon, 'animate-error-icon');
  12478. addClass(icon.querySelector('.x-mark'), 'animate-x-mark');
  12479. break;
  12480. case 'warning':
  12481. addClass(icon, 'pulse-warning');
  12482. break;
  12483. default:
  12484. break;
  12485. }
  12486. }
  12487. // Custom image
  12488. var image = getImage();
  12489. if (params.imageUrl) {
  12490. image.setAttribute('src', params.imageUrl);
  12491. show(image);
  12492. if (params.imageWidth) {
  12493. image.setAttribute('width', params.imageWidth);
  12494. } else {
  12495. image.removeAttribute('width');
  12496. }
  12497. if (params.imageHeight) {
  12498. image.setAttribute('height', params.imageHeight);
  12499. } else {
  12500. image.removeAttribute('height');
  12501. }
  12502. image.className = swalClasses.image;
  12503. if (params.imageClass) {
  12504. addClass(image, params.imageClass);
  12505. }
  12506. } else {
  12507. hide(image);
  12508. }
  12509. // Cancel button
  12510. if (params.showCancelButton) {
  12511. cancelButton.style.display = 'inline-block';
  12512. } else {
  12513. hide(cancelButton);
  12514. }
  12515. // Confirm button
  12516. if (params.showConfirmButton) {
  12517. removeStyleProperty(confirmButton, 'display');
  12518. } else {
  12519. hide(confirmButton);
  12520. }
  12521. // Buttons spacer
  12522. var spacer = getSpacer();
  12523. if (!params.showConfirmButton && !params.showCancelButton) {
  12524. hide(spacer);
  12525. } else {
  12526. show(spacer);
  12527. }
  12528. // Edit text on cancel and confirm buttons
  12529. confirmButton.innerHTML = params.confirmButtonText;
  12530. cancelButton.innerHTML = params.cancelButtonText;
  12531. // Set buttons to selected background colors
  12532. if (params.buttonsStyling) {
  12533. confirmButton.style.backgroundColor = params.confirmButtonColor;
  12534. cancelButton.style.backgroundColor = params.cancelButtonColor;
  12535. }
  12536. // Add buttons custom classes
  12537. confirmButton.className = swalClasses.confirm;
  12538. addClass(confirmButton, params.confirmButtonClass);
  12539. cancelButton.className = swalClasses.cancel;
  12540. addClass(cancelButton, params.cancelButtonClass);
  12541. // Buttons styling
  12542. if (params.buttonsStyling) {
  12543. addClass(confirmButton, swalClasses.styled);
  12544. addClass(cancelButton, swalClasses.styled);
  12545. } else {
  12546. removeClass(confirmButton, swalClasses.styled);
  12547. removeClass(cancelButton, swalClasses.styled);
  12548. confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
  12549. cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
  12550. }
  12551. // CSS animation
  12552. if (params.animation === true) {
  12553. removeClass(modal, swalClasses.noanimation);
  12554. } else {
  12555. addClass(modal, swalClasses.noanimation);
  12556. }
  12557. };
  12558. /*
  12559. * Animations
  12560. */
  12561. var openModal = function openModal(animation, onComplete) {
  12562. var container = getContainer();
  12563. var modal = getModal();
  12564. if (animation) {
  12565. addClass(modal, swalClasses.show);
  12566. addClass(container, swalClasses.fade);
  12567. removeClass(modal, swalClasses.hide);
  12568. } else {
  12569. removeClass(modal, swalClasses.fade);
  12570. }
  12571. show(modal);
  12572. // scrolling is 'hidden' until animation is done, after that 'auto'
  12573. container.style.overflowY = 'hidden';
  12574. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  12575. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  12576. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  12577. container.style.overflowY = 'auto';
  12578. });
  12579. } else {
  12580. container.style.overflowY = 'auto';
  12581. }
  12582. addClass(document.documentElement, swalClasses.shown);
  12583. addClass(document.body, swalClasses.shown);
  12584. addClass(container, swalClasses.shown);
  12585. fixScrollbar();
  12586. iOSfix();
  12587. states.previousActiveElement = document.activeElement;
  12588. if (onComplete !== null && typeof onComplete === 'function') {
  12589. setTimeout(function () {
  12590. onComplete(modal);
  12591. });
  12592. }
  12593. };
  12594. var fixScrollbar = function fixScrollbar() {
  12595. // for queues, do not do this more than once
  12596. if (states.previousBodyPadding !== null) {
  12597. return;
  12598. }
  12599. // if the body has overflow
  12600. if (document.body.scrollHeight > window.innerHeight) {
  12601. // add padding so the content doesn't shift after removal of scrollbar
  12602. states.previousBodyPadding = document.body.style.paddingRight;
  12603. document.body.style.paddingRight = measureScrollbar() + 'px';
  12604. }
  12605. };
  12606. var undoScrollbar = function undoScrollbar() {
  12607. if (states.previousBodyPadding !== null) {
  12608. document.body.style.paddingRight = states.previousBodyPadding;
  12609. states.previousBodyPadding = null;
  12610. }
  12611. };
  12612. // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425
  12613. var iOSfix = function iOSfix() {
  12614. var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
  12615. if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
  12616. var offset = document.body.scrollTop;
  12617. document.body.style.top = offset * -1 + 'px';
  12618. addClass(document.body, swalClasses.iosfix);
  12619. }
  12620. };
  12621. var undoIOSfix = function undoIOSfix() {
  12622. if (hasClass(document.body, swalClasses.iosfix)) {
  12623. var offset = parseInt(document.body.style.top, 10);
  12624. removeClass(document.body, swalClasses.iosfix);
  12625. document.body.style.top = '';
  12626. document.body.scrollTop = offset * -1;
  12627. }
  12628. };
  12629. // SweetAlert entry point
  12630. var sweetAlert = function sweetAlert() {
  12631. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12632. args[_key] = arguments[_key];
  12633. }
  12634. if (args[0] === undefined) {
  12635. console.error('SweetAlert2 expects at least 1 attribute!');
  12636. return false;
  12637. }
  12638. var params = _extends({}, modalParams);
  12639. switch (_typeof(args[0])) {
  12640. case 'string':
  12641. params.title = args[0];
  12642. params.html = args[1];
  12643. params.type = args[2];
  12644. break;
  12645. case 'object':
  12646. _extends(params, args[0]);
  12647. params.extraParams = args[0].extraParams;
  12648. if (params.input === 'email' && params.inputValidator === null) {
  12649. params.inputValidator = function (email) {
  12650. return new Promise(function (resolve, reject) {
  12651. var emailRegex = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
  12652. if (emailRegex.test(email)) {
  12653. resolve();
  12654. } else {
  12655. reject('Invalid email address');
  12656. }
  12657. });
  12658. };
  12659. }
  12660. break;
  12661. default:
  12662. console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0]));
  12663. return false;
  12664. }
  12665. setParameters(params);
  12666. var container = getContainer();
  12667. var modal = getModal();
  12668. return new Promise(function (resolve, reject) {
  12669. // Close on timer
  12670. if (params.timer) {
  12671. modal.timeout = setTimeout(function () {
  12672. sweetAlert.closeModal(params.onClose);
  12673. reject('timer');
  12674. }, params.timer);
  12675. }
  12676. // Get input element by specified type or, if type isn't specified, by params.input
  12677. var getInput = function getInput(inputType) {
  12678. inputType = inputType || params.input;
  12679. if (!inputType) {
  12680. return null;
  12681. }
  12682. switch (inputType) {
  12683. case 'select':
  12684. case 'textarea':
  12685. case 'file':
  12686. return getChildByClass(modal, swalClasses[inputType]);
  12687. case 'checkbox':
  12688. return modal.querySelector('.' + swalClasses.checkbox + ' input');
  12689. case 'radio':
  12690. return modal.querySelector('.' + swalClasses.radio + ' input:checked') || modal.querySelector('.' + swalClasses.radio + ' input:first-child');
  12691. case 'range':
  12692. return modal.querySelector('.' + swalClasses.range + ' input');
  12693. default:
  12694. return getChildByClass(modal, swalClasses.input);
  12695. }
  12696. };
  12697. // Get the value of the modal input
  12698. var getInputValue = function getInputValue() {
  12699. var input = getInput();
  12700. if (!input) {
  12701. return null;
  12702. }
  12703. switch (params.input) {
  12704. case 'checkbox':
  12705. return input.checked ? 1 : 0;
  12706. case 'radio':
  12707. return input.checked ? input.value : null;
  12708. case 'file':
  12709. return input.files.length ? input.files[0] : null;
  12710. default:
  12711. return params.inputAutoTrim ? input.value.trim() : input.value;
  12712. }
  12713. };
  12714. // input autofocus
  12715. if (params.input) {
  12716. setTimeout(function () {
  12717. var input = getInput();
  12718. if (input) {
  12719. focusInput(input);
  12720. }
  12721. }, 0);
  12722. }
  12723. var confirm = function confirm(value) {
  12724. if (params.showLoaderOnConfirm) {
  12725. sweetAlert.showLoading();
  12726. }
  12727. if (params.preConfirm) {
  12728. params.preConfirm(value, params.extraParams).then(function (preConfirmValue) {
  12729. sweetAlert.closeModal(params.onClose);
  12730. resolve(preConfirmValue || value);
  12731. }, function (error) {
  12732. sweetAlert.hideLoading();
  12733. if (error) {
  12734. sweetAlert.showValidationError(error);
  12735. }
  12736. });
  12737. } else {
  12738. sweetAlert.closeModal(params.onClose);
  12739. resolve(value);
  12740. }
  12741. };
  12742. // Mouse interactions
  12743. var onButtonEvent = function onButtonEvent(event) {
  12744. var e = event || window.event;
  12745. var target = e.target || e.srcElement;
  12746. var confirmButton = getConfirmButton();
  12747. var cancelButton = getCancelButton();
  12748. var targetedConfirm = confirmButton === target || confirmButton.contains(target);
  12749. var targetedCancel = cancelButton === target || cancelButton.contains(target);
  12750. switch (e.type) {
  12751. case 'mouseover':
  12752. case 'mouseup':
  12753. if (params.buttonsStyling) {
  12754. if (targetedConfirm) {
  12755. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1);
  12756. } else if (targetedCancel) {
  12757. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1);
  12758. }
  12759. }
  12760. break;
  12761. case 'mouseout':
  12762. if (params.buttonsStyling) {
  12763. if (targetedConfirm) {
  12764. confirmButton.style.backgroundColor = params.confirmButtonColor;
  12765. } else if (targetedCancel) {
  12766. cancelButton.style.backgroundColor = params.cancelButtonColor;
  12767. }
  12768. }
  12769. break;
  12770. case 'mousedown':
  12771. if (params.buttonsStyling) {
  12772. if (targetedConfirm) {
  12773. confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2);
  12774. } else if (targetedCancel) {
  12775. cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2);
  12776. }
  12777. }
  12778. break;
  12779. case 'click':
  12780. // Clicked 'confirm'
  12781. if (targetedConfirm && sweetAlert.isVisible()) {
  12782. sweetAlert.disableButtons();
  12783. if (params.input) {
  12784. (function () {
  12785. var inputValue = getInputValue();
  12786. if (params.inputValidator) {
  12787. sweetAlert.disableInput();
  12788. params.inputValidator(inputValue, params.extraParams).then(function () {
  12789. sweetAlert.enableButtons();
  12790. sweetAlert.enableInput();
  12791. confirm(inputValue);
  12792. }, function (error) {
  12793. sweetAlert.enableButtons();
  12794. sweetAlert.enableInput();
  12795. if (error) {
  12796. sweetAlert.showValidationError(error);
  12797. }
  12798. });
  12799. } else {
  12800. confirm(inputValue);
  12801. }
  12802. })();
  12803. } else {
  12804. confirm(true);
  12805. }
  12806. // Clicked 'cancel'
  12807. } else if (targetedCancel && sweetAlert.isVisible()) {
  12808. sweetAlert.disableButtons();
  12809. sweetAlert.closeModal(params.onClose);
  12810. reject('cancel');
  12811. }
  12812. break;
  12813. default:
  12814. }
  12815. };
  12816. var buttons = modal.querySelectorAll('button');
  12817. for (var i = 0; i < buttons.length; i++) {
  12818. buttons[i].onclick = onButtonEvent;
  12819. buttons[i].onmouseover = onButtonEvent;
  12820. buttons[i].onmouseout = onButtonEvent;
  12821. buttons[i].onmousedown = onButtonEvent;
  12822. }
  12823. // Closing modal by close button
  12824. getCloseButton().onclick = function () {
  12825. sweetAlert.closeModal(params.onClose);
  12826. reject('close');
  12827. };
  12828. // Closing modal by overlay click
  12829. container.onclick = function (e) {
  12830. if (e.target !== container) {
  12831. return;
  12832. }
  12833. if (params.allowOutsideClick) {
  12834. sweetAlert.closeModal(params.onClose);
  12835. reject('overlay');
  12836. }
  12837. };
  12838. var confirmButton = getConfirmButton();
  12839. var cancelButton = getCancelButton();
  12840. // Reverse buttons (Confirm on the right side)
  12841. if (params.reverseButtons) {
  12842. confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
  12843. } else {
  12844. confirmButton.parentNode.insertBefore(confirmButton, cancelButton);
  12845. }
  12846. // Focus handling
  12847. var setFocus = function setFocus(index, increment) {
  12848. var focusableElements = getFocusableElements(params.focusCancel);
  12849. // search for visible elements and select the next possible match
  12850. for (var _i2 = 0; _i2 < focusableElements.length; _i2++) {
  12851. index = index + increment;
  12852. // rollover to first item
  12853. if (index === focusableElements.length) {
  12854. index = 0;
  12855. // go to last item
  12856. } else if (index === -1) {
  12857. index = focusableElements.length - 1;
  12858. }
  12859. // determine if element is visible
  12860. var el = focusableElements[index];
  12861. if (isVisible(el)) {
  12862. return el.focus();
  12863. }
  12864. }
  12865. };
  12866. var handleKeyDown = function handleKeyDown(event) {
  12867. var e = event || window.event;
  12868. var keyCode = e.keyCode || e.which;
  12869. if ([9, 13, 32, 27].indexOf(keyCode) === -1) {
  12870. // Don't do work on keys we don't care about.
  12871. return;
  12872. }
  12873. var targetElement = e.target || e.srcElement;
  12874. var focusableElements = getFocusableElements(params.focusCancel);
  12875. var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
  12876. for (var _i3 = 0; _i3 < focusableElements.length; _i3++) {
  12877. if (targetElement === focusableElements[_i3]) {
  12878. btnIndex = _i3;
  12879. break;
  12880. }
  12881. }
  12882. // TAB
  12883. if (keyCode === 9) {
  12884. if (!e.shiftKey) {
  12885. // Cycle to the next button
  12886. setFocus(btnIndex, 1);
  12887. } else {
  12888. // Cycle to the prev button
  12889. setFocus(btnIndex, -1);
  12890. }
  12891. e.stopPropagation();
  12892. e.preventDefault();
  12893. // ENTER/SPACE
  12894. } else if (keyCode === 13 || keyCode === 32) {
  12895. if (btnIndex === -1 && params.allowEnterKey) {
  12896. // ENTER/SPACE clicked outside of a button.
  12897. if (params.focusCancel) {
  12898. fireClick(cancelButton, e);
  12899. } else {
  12900. fireClick(confirmButton, e);
  12901. }
  12902. }
  12903. // ESC
  12904. } else if (keyCode === 27 && params.allowEscapeKey === true) {
  12905. sweetAlert.closeModal(params.onClose);
  12906. reject('esc');
  12907. }
  12908. };
  12909. states.previousWindowKeyDown = window.onkeydown;
  12910. window.onkeydown = handleKeyDown;
  12911. // Loading state
  12912. if (params.buttonsStyling) {
  12913. confirmButton.style.borderLeftColor = params.confirmButtonColor;
  12914. confirmButton.style.borderRightColor = params.confirmButtonColor;
  12915. }
  12916. /**
  12917. * Show spinner instead of Confirm button and disable Cancel button
  12918. */
  12919. sweetAlert.showLoading = sweetAlert.enableLoading = function () {
  12920. show(getSpacer());
  12921. show(confirmButton, 'inline-block');
  12922. addClass(confirmButton, swalClasses.loading);
  12923. addClass(modal, swalClasses.loading);
  12924. confirmButton.disabled = true;
  12925. cancelButton.disabled = true;
  12926. };
  12927. /**
  12928. * Show spinner instead of Confirm button and disable Cancel button
  12929. */
  12930. sweetAlert.hideLoading = sweetAlert.disableLoading = function () {
  12931. if (!params.showConfirmButton) {
  12932. hide(confirmButton);
  12933. if (!params.showCancelButton) {
  12934. hide(getSpacer());
  12935. }
  12936. }
  12937. removeClass(confirmButton, swalClasses.loading);
  12938. removeClass(modal, swalClasses.loading);
  12939. confirmButton.disabled = false;
  12940. cancelButton.disabled = false;
  12941. };
  12942. sweetAlert.getTitle = function () {
  12943. return getTitle();
  12944. };
  12945. sweetAlert.getContent = function () {
  12946. return getContent();
  12947. };
  12948. sweetAlert.getInput = function () {
  12949. return getInput();
  12950. };
  12951. sweetAlert.getImage = function () {
  12952. return getImage();
  12953. };
  12954. sweetAlert.getConfirmButton = function () {
  12955. return getConfirmButton();
  12956. };
  12957. sweetAlert.getCancelButton = function () {
  12958. return getCancelButton();
  12959. };
  12960. sweetAlert.enableButtons = function () {
  12961. confirmButton.disabled = false;
  12962. cancelButton.disabled = false;
  12963. };
  12964. sweetAlert.disableButtons = function () {
  12965. confirmButton.disabled = true;
  12966. cancelButton.disabled = true;
  12967. };
  12968. sweetAlert.enableConfirmButton = function () {
  12969. confirmButton.disabled = false;
  12970. };
  12971. sweetAlert.disableConfirmButton = function () {
  12972. confirmButton.disabled = true;
  12973. };
  12974. sweetAlert.enableInput = function () {
  12975. var input = getInput();
  12976. if (!input) {
  12977. return false;
  12978. }
  12979. if (input.type === 'radio') {
  12980. var radiosContainer = input.parentNode.parentNode;
  12981. var radios = radiosContainer.querySelectorAll('input');
  12982. for (var _i4 = 0; _i4 < radios.length; _i4++) {
  12983. radios[_i4].disabled = false;
  12984. }
  12985. } else {
  12986. input.disabled = false;
  12987. }
  12988. };
  12989. sweetAlert.disableInput = function () {
  12990. var input = getInput();
  12991. if (!input) {
  12992. return false;
  12993. }
  12994. if (input && input.type === 'radio') {
  12995. var radiosContainer = input.parentNode.parentNode;
  12996. var radios = radiosContainer.querySelectorAll('input');
  12997. for (var _i5 = 0; _i5 < radios.length; _i5++) {
  12998. radios[_i5].disabled = true;
  12999. }
  13000. } else {
  13001. input.disabled = true;
  13002. }
  13003. };
  13004. // Set modal min-height to disable scrolling inside the modal
  13005. sweetAlert.recalculateHeight = debounce(function () {
  13006. var modal = getModal();
  13007. if (!modal) {
  13008. return;
  13009. }
  13010. var prevState = modal.style.display;
  13011. modal.style.minHeight = '';
  13012. show(modal);
  13013. modal.style.minHeight = modal.scrollHeight + 1 + 'px';
  13014. modal.style.display = prevState;
  13015. }, 50);
  13016. // Show block with validation error
  13017. sweetAlert.showValidationError = function (error) {
  13018. var validationError = getValidationError();
  13019. validationError.innerHTML = error;
  13020. show(validationError);
  13021. var input = getInput();
  13022. if (input) {
  13023. focusInput(input);
  13024. addClass(input, swalClasses.inputerror);
  13025. }
  13026. };
  13027. // Hide block with validation error
  13028. sweetAlert.resetValidationError = function () {
  13029. var validationError = getValidationError();
  13030. hide(validationError);
  13031. sweetAlert.recalculateHeight();
  13032. var input = getInput();
  13033. if (input) {
  13034. removeClass(input, swalClasses.inputerror);
  13035. }
  13036. };
  13037. sweetAlert.getProgressSteps = function () {
  13038. return params.progressSteps;
  13039. };
  13040. sweetAlert.setProgressSteps = function (progressSteps) {
  13041. params.progressSteps = progressSteps;
  13042. setParameters(params);
  13043. };
  13044. sweetAlert.showProgressSteps = function () {
  13045. show(getProgressSteps());
  13046. };
  13047. sweetAlert.hideProgressSteps = function () {
  13048. hide(getProgressSteps());
  13049. };
  13050. sweetAlert.enableButtons();
  13051. sweetAlert.hideLoading();
  13052. sweetAlert.resetValidationError();
  13053. // inputs
  13054. var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
  13055. var input = void 0;
  13056. for (var _i6 = 0; _i6 < inputTypes.length; _i6++) {
  13057. var inputClass = swalClasses[inputTypes[_i6]];
  13058. var inputContainer = getChildByClass(modal, inputClass);
  13059. input = getInput(inputTypes[_i6]);
  13060. // set attributes
  13061. if (input) {
  13062. for (var j in input.attributes) {
  13063. if (input.attributes.hasOwnProperty(j)) {
  13064. var attrName = input.attributes[j].name;
  13065. if (attrName !== 'type' && attrName !== 'value') {
  13066. input.removeAttribute(attrName);
  13067. }
  13068. }
  13069. }
  13070. for (var attr in params.inputAttributes) {
  13071. input.setAttribute(attr, params.inputAttributes[attr]);
  13072. }
  13073. }
  13074. // set class
  13075. inputContainer.className = inputClass;
  13076. if (params.inputClass) {
  13077. addClass(inputContainer, params.inputClass);
  13078. }
  13079. hide(inputContainer);
  13080. }
  13081. var populateInputOptions = void 0;
  13082. (function () {
  13083. switch (params.input) {
  13084. case 'text':
  13085. case 'email':
  13086. case 'password':
  13087. case 'number':
  13088. case 'tel':
  13089. input = getChildByClass(modal, swalClasses.input);
  13090. input.value = params.inputValue;
  13091. input.placeholder = params.inputPlaceholder;
  13092. input.type = params.input;
  13093. show(input);
  13094. break;
  13095. case 'file':
  13096. input = getChildByClass(modal, swalClasses.file);
  13097. input.placeholder = params.inputPlaceholder;
  13098. input.type = params.input;
  13099. show(input);
  13100. break;
  13101. case 'range':
  13102. var range = getChildByClass(modal, swalClasses.range);
  13103. var rangeInput = range.querySelector('input');
  13104. var rangeOutput = range.querySelector('output');
  13105. rangeInput.value = params.inputValue;
  13106. rangeInput.type = params.input;
  13107. rangeOutput.value = params.inputValue;
  13108. show(range);
  13109. break;
  13110. case 'select':
  13111. var select = getChildByClass(modal, swalClasses.select);
  13112. select.innerHTML = '';
  13113. if (params.inputPlaceholder) {
  13114. var placeholder = document.createElement('option');
  13115. placeholder.innerHTML = params.inputPlaceholder;
  13116. placeholder.value = '';
  13117. placeholder.disabled = true;
  13118. placeholder.selected = true;
  13119. select.appendChild(placeholder);
  13120. }
  13121. populateInputOptions = function populateInputOptions(inputOptions) {
  13122. for (var optionValue in inputOptions) {
  13123. var option = document.createElement('option');
  13124. option.value = optionValue;
  13125. option.innerHTML = inputOptions[optionValue];
  13126. if (params.inputValue === optionValue) {
  13127. option.selected = true;
  13128. }
  13129. select.appendChild(option);
  13130. }
  13131. show(select);
  13132. select.focus();
  13133. };
  13134. break;
  13135. case 'radio':
  13136. var radio = getChildByClass(modal, swalClasses.radio);
  13137. radio.innerHTML = '';
  13138. populateInputOptions = function populateInputOptions(inputOptions) {
  13139. for (var radioValue in inputOptions) {
  13140. var radioInput = document.createElement('input');
  13141. var radioLabel = document.createElement('label');
  13142. var radioLabelSpan = document.createElement('span');
  13143. radioInput.type = 'radio';
  13144. radioInput.name = swalClasses.radio;
  13145. radioInput.value = radioValue;
  13146. if (params.inputValue === radioValue) {
  13147. radioInput.checked = true;
  13148. }
  13149. radioLabelSpan.innerHTML = inputOptions[radioValue];
  13150. radioLabel.appendChild(radioInput);
  13151. radioLabel.appendChild(radioLabelSpan);
  13152. radioLabel.for = radioInput.id;
  13153. radio.appendChild(radioLabel);
  13154. }
  13155. show(radio);
  13156. var radios = radio.querySelectorAll('input');
  13157. if (radios.length) {
  13158. radios[0].focus();
  13159. }
  13160. };
  13161. break;
  13162. case 'checkbox':
  13163. var checkbox = getChildByClass(modal, swalClasses.checkbox);
  13164. var checkboxInput = getInput('checkbox');
  13165. checkboxInput.type = 'checkbox';
  13166. checkboxInput.value = 1;
  13167. checkboxInput.id = swalClasses.checkbox;
  13168. checkboxInput.checked = Boolean(params.inputValue);
  13169. var label = checkbox.getElementsByTagName('span');
  13170. if (label.length) {
  13171. checkbox.removeChild(label[0]);
  13172. }
  13173. label = document.createElement('span');
  13174. label.innerHTML = params.inputPlaceholder;
  13175. checkbox.appendChild(label);
  13176. show(checkbox);
  13177. break;
  13178. case 'textarea':
  13179. var textarea = getChildByClass(modal, swalClasses.textarea);
  13180. textarea.value = params.inputValue;
  13181. textarea.placeholder = params.inputPlaceholder;
  13182. show(textarea);
  13183. break;
  13184. case null:
  13185. break;
  13186. default:
  13187. console.error('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "select", "checkbox", "textarea" or "file", got "' + params.input + '"');
  13188. break;
  13189. }
  13190. })();
  13191. if (params.input === 'select' || params.input === 'radio') {
  13192. if (params.inputOptions instanceof Promise) {
  13193. sweetAlert.showLoading();
  13194. params.inputOptions.then(function (inputOptions) {
  13195. sweetAlert.hideLoading();
  13196. populateInputOptions(inputOptions);
  13197. });
  13198. } else if (_typeof(params.inputOptions) === 'object') {
  13199. populateInputOptions(params.inputOptions);
  13200. } else {
  13201. console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + _typeof(params.inputOptions));
  13202. }
  13203. }
  13204. openModal(params.animation, params.onOpen);
  13205. // Focus the first element (input or button)
  13206. if (params.allowEnterKey) {
  13207. setFocus(-1, 1);
  13208. } else {
  13209. if (document.activeElement) {
  13210. document.activeElement.blur();
  13211. }
  13212. }
  13213. // fix scroll
  13214. getContainer().scrollTop = 0;
  13215. // Observe changes inside the modal and adjust height
  13216. if (typeof MutationObserver !== 'undefined' && !swal2Observer) {
  13217. swal2Observer = new MutationObserver(sweetAlert.recalculateHeight);
  13218. swal2Observer.observe(modal, { childList: true, characterData: true, subtree: true });
  13219. }
  13220. });
  13221. };
  13222. /*
  13223. * Global function to determine if swal2 modal is shown
  13224. */
  13225. sweetAlert.isVisible = function () {
  13226. return !!getModal();
  13227. };
  13228. /*
  13229. * Global function for chaining sweetAlert modals
  13230. */
  13231. sweetAlert.queue = function (steps) {
  13232. queue = steps;
  13233. var resetQueue = function resetQueue() {
  13234. queue = [];
  13235. document.body.removeAttribute('data-swal2-queue-step');
  13236. };
  13237. var queueResult = [];
  13238. return new Promise(function (resolve, reject) {
  13239. (function step(i, callback) {
  13240. if (i < queue.length) {
  13241. document.body.setAttribute('data-swal2-queue-step', i);
  13242. sweetAlert(queue[i]).then(function (result) {
  13243. queueResult.push(result);
  13244. step(i + 1, callback);
  13245. }, function (dismiss) {
  13246. resetQueue();
  13247. reject(dismiss);
  13248. });
  13249. } else {
  13250. resetQueue();
  13251. resolve(queueResult);
  13252. }
  13253. })(0);
  13254. });
  13255. };
  13256. /*
  13257. * Global function for getting the index of current modal in queue
  13258. */
  13259. sweetAlert.getQueueStep = function () {
  13260. return document.body.getAttribute('data-swal2-queue-step');
  13261. };
  13262. /*
  13263. * Global function for inserting a modal to the queue
  13264. */
  13265. sweetAlert.insertQueueStep = function (step, index) {
  13266. if (index && index < queue.length) {
  13267. return queue.splice(index, 0, step);
  13268. }
  13269. return queue.push(step);
  13270. };
  13271. /*
  13272. * Global function for deleting a modal from the queue
  13273. */
  13274. sweetAlert.deleteQueueStep = function (index) {
  13275. if (typeof queue[index] !== 'undefined') {
  13276. queue.splice(index, 1);
  13277. }
  13278. };
  13279. /*
  13280. * Global function to close sweetAlert
  13281. */
  13282. sweetAlert.close = sweetAlert.closeModal = function (onComplete) {
  13283. var container = getContainer();
  13284. var modal = getModal();
  13285. if (!modal) {
  13286. return;
  13287. }
  13288. removeClass(modal, swalClasses.show);
  13289. addClass(modal, swalClasses.hide);
  13290. clearTimeout(modal.timeout);
  13291. resetPrevState();
  13292. var removeModalAndResetState = function removeModalAndResetState() {
  13293. container.parentNode.removeChild(container);
  13294. removeClass(document.documentElement, swalClasses.shown);
  13295. removeClass(document.body, swalClasses.shown);
  13296. undoScrollbar();
  13297. undoIOSfix();
  13298. };
  13299. // If animation is supported, animate
  13300. if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
  13301. modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
  13302. modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
  13303. if (hasClass(modal, swalClasses.hide)) {
  13304. removeModalAndResetState();
  13305. }
  13306. });
  13307. } else {
  13308. // Otherwise, remove immediately
  13309. removeModalAndResetState();
  13310. }
  13311. if (onComplete !== null && typeof onComplete === 'function') {
  13312. setTimeout(function () {
  13313. onComplete(modal);
  13314. });
  13315. }
  13316. };
  13317. /*
  13318. * Global function to click 'Confirm' button
  13319. */
  13320. sweetAlert.clickConfirm = function () {
  13321. return getConfirmButton().click();
  13322. };
  13323. /*
  13324. * Global function to click 'Cancel' button
  13325. */
  13326. sweetAlert.clickCancel = function () {
  13327. return getCancelButton().click();
  13328. };
  13329. /**
  13330. * Set default params for each popup
  13331. * @param {Object} userParams
  13332. */
  13333. sweetAlert.setDefaults = function (userParams) {
  13334. if (!userParams || (typeof userParams === 'undefined' ? 'undefined' : _typeof(userParams)) !== 'object') {
  13335. return console.error('SweetAlert2: the argument for setDefaults() is required and has to be a object');
  13336. }
  13337. for (var param in userParams) {
  13338. if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
  13339. console.warn('SweetAlert2: Unknown parameter "' + param + '"');
  13340. delete userParams[param];
  13341. }
  13342. }
  13343. _extends(modalParams, userParams);
  13344. };
  13345. /**
  13346. * Reset default params for each popup
  13347. */
  13348. sweetAlert.resetDefaults = function () {
  13349. modalParams = _extends({}, defaultParams);
  13350. };
  13351. sweetAlert.noop = function () {};
  13352. sweetAlert.version = '6.4.2';
  13353. sweetAlert.default = sweetAlert;
  13354. return sweetAlert;
  13355. })));
  13356. if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
  13357. /***/ }),
  13358. /* 4 */
  13359. /***/ (function(module, exports) {
  13360. /*
  13361. MIT License http://www.opensource.org/licenses/mit-license.php
  13362. Author Tobias Koppers @sokra
  13363. */
  13364. // css base code, injected by the css-loader
  13365. module.exports = function() {
  13366. var list = [];
  13367. // return the list of modules as css string
  13368. list.toString = function toString() {
  13369. var result = [];
  13370. for(var i = 0; i < this.length; i++) {
  13371. var item = this[i];
  13372. if(item[2]) {
  13373. result.push("@media " + item[2] + "{" + item[1] + "}");
  13374. } else {
  13375. result.push(item[1]);
  13376. }
  13377. }
  13378. return result.join("");
  13379. };
  13380. // import a list of modules into the list
  13381. list.i = function(modules, mediaQuery) {
  13382. if(typeof modules === "string")
  13383. modules = [[null, modules, ""]];
  13384. var alreadyImportedModules = {};
  13385. for(var i = 0; i < this.length; i++) {
  13386. var id = this[i][0];
  13387. if(typeof id === "number")
  13388. alreadyImportedModules[id] = true;
  13389. }
  13390. for(i = 0; i < modules.length; i++) {
  13391. var item = modules[i];
  13392. // skip already imported module
  13393. // this implementation is not 100% perfect for weird media query combinations
  13394. // when a module is imported multiple times with different media queries.
  13395. // I hope this will never occur (Hey this way we have smaller bundles)
  13396. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  13397. if(mediaQuery && !item[2]) {
  13398. item[2] = mediaQuery;
  13399. } else if(mediaQuery) {
  13400. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  13401. }
  13402. list.push(item);
  13403. }
  13404. }
  13405. };
  13406. return list;
  13407. };
  13408. /***/ }),
  13409. /* 5 */
  13410. /***/ (function(module, exports, __webpack_require__) {
  13411. //! moment.js locale configuration
  13412. //! locale : Afrikaans [af]
  13413. //! author : Werner Mollentze : https://github.com/wernerm
  13414. ;(function (global, factory) {
  13415. true ? factory(__webpack_require__(0)) :
  13416. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13417. factory(global.moment)
  13418. }(this, (function (moment) { 'use strict';
  13419. var af = moment.defineLocale('af', {
  13420. months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
  13421. monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  13422. weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
  13423. weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  13424. weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  13425. meridiemParse: /vm|nm/i,
  13426. isPM : function (input) {
  13427. return /^nm$/i.test(input);
  13428. },
  13429. meridiem : function (hours, minutes, isLower) {
  13430. if (hours < 12) {
  13431. return isLower ? 'vm' : 'VM';
  13432. } else {
  13433. return isLower ? 'nm' : 'NM';
  13434. }
  13435. },
  13436. longDateFormat : {
  13437. LT : 'HH:mm',
  13438. LTS : 'HH:mm:ss',
  13439. L : 'DD/MM/YYYY',
  13440. LL : 'D MMMM YYYY',
  13441. LLL : 'D MMMM YYYY HH:mm',
  13442. LLLL : 'dddd, D MMMM YYYY HH:mm'
  13443. },
  13444. calendar : {
  13445. sameDay : '[Vandag om] LT',
  13446. nextDay : '[Môre om] LT',
  13447. nextWeek : 'dddd [om] LT',
  13448. lastDay : '[Gister om] LT',
  13449. lastWeek : '[Laas] dddd [om] LT',
  13450. sameElse : 'L'
  13451. },
  13452. relativeTime : {
  13453. future : 'oor %s',
  13454. past : '%s gelede',
  13455. s : '\'n paar sekondes',
  13456. m : '\'n minuut',
  13457. mm : '%d minute',
  13458. h : '\'n uur',
  13459. hh : '%d ure',
  13460. d : '\'n dag',
  13461. dd : '%d dae',
  13462. M : '\'n maand',
  13463. MM : '%d maande',
  13464. y : '\'n jaar',
  13465. yy : '%d jaar'
  13466. },
  13467. ordinalParse: /\d{1,2}(ste|de)/,
  13468. ordinal : function (number) {
  13469. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
  13470. },
  13471. week : {
  13472. dow : 1, // Maandag is die eerste dag van die week.
  13473. doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  13474. }
  13475. });
  13476. return af;
  13477. })));
  13478. /***/ }),
  13479. /* 6 */
  13480. /***/ (function(module, exports, __webpack_require__) {
  13481. //! moment.js locale configuration
  13482. //! locale : Arabic (Algeria) [ar-dz]
  13483. //! author : Noureddine LOUAHEDJ : https://github.com/noureddineme
  13484. ;(function (global, factory) {
  13485. true ? factory(__webpack_require__(0)) :
  13486. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13487. factory(global.moment)
  13488. }(this, (function (moment) { 'use strict';
  13489. var arDz = moment.defineLocale('ar-dz', {
  13490. months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13491. monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13492. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13493. weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  13494. weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
  13495. weekdaysParseExact : true,
  13496. longDateFormat : {
  13497. LT : 'HH:mm',
  13498. LTS : 'HH:mm:ss',
  13499. L : 'DD/MM/YYYY',
  13500. LL : 'D MMMM YYYY',
  13501. LLL : 'D MMMM YYYY HH:mm',
  13502. LLLL : 'dddd D MMMM YYYY HH:mm'
  13503. },
  13504. calendar : {
  13505. sameDay: '[اليوم على الساعة] LT',
  13506. nextDay: '[غدا على الساعة] LT',
  13507. nextWeek: 'dddd [على الساعة] LT',
  13508. lastDay: '[أمس على الساعة] LT',
  13509. lastWeek: 'dddd [على الساعة] LT',
  13510. sameElse: 'L'
  13511. },
  13512. relativeTime : {
  13513. future : 'في %s',
  13514. past : 'منذ %s',
  13515. s : 'ثوان',
  13516. m : 'دقيقة',
  13517. mm : '%d دقائق',
  13518. h : 'ساعة',
  13519. hh : '%d ساعات',
  13520. d : 'يوم',
  13521. dd : '%d أيام',
  13522. M : 'شهر',
  13523. MM : '%d أشهر',
  13524. y : 'سنة',
  13525. yy : '%d سنوات'
  13526. },
  13527. week : {
  13528. dow : 0, // Sunday is the first day of the week.
  13529. doy : 4 // The week that contains Jan 1st is the first week of the year.
  13530. }
  13531. });
  13532. return arDz;
  13533. })));
  13534. /***/ }),
  13535. /* 7 */
  13536. /***/ (function(module, exports, __webpack_require__) {
  13537. //! moment.js locale configuration
  13538. //! locale : Arabic (Lybia) [ar-ly]
  13539. //! author : Ali Hmer: https://github.com/kikoanis
  13540. ;(function (global, factory) {
  13541. true ? factory(__webpack_require__(0)) :
  13542. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13543. factory(global.moment)
  13544. }(this, (function (moment) { 'use strict';
  13545. var symbolMap = {
  13546. '1': '1',
  13547. '2': '2',
  13548. '3': '3',
  13549. '4': '4',
  13550. '5': '5',
  13551. '6': '6',
  13552. '7': '7',
  13553. '8': '8',
  13554. '9': '9',
  13555. '0': '0'
  13556. };
  13557. var pluralForm = function (n) {
  13558. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  13559. };
  13560. var plurals = {
  13561. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  13562. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  13563. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  13564. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  13565. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  13566. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  13567. };
  13568. var pluralize = function (u) {
  13569. return function (number, withoutSuffix, string, isFuture) {
  13570. var f = pluralForm(number),
  13571. str = plurals[u][pluralForm(number)];
  13572. if (f === 2) {
  13573. str = str[withoutSuffix ? 0 : 1];
  13574. }
  13575. return str.replace(/%d/i, number);
  13576. };
  13577. };
  13578. var months = [
  13579. 'يناير',
  13580. 'فبراير',
  13581. 'مارس',
  13582. 'أبريل',
  13583. 'مايو',
  13584. 'يونيو',
  13585. 'يوليو',
  13586. 'أغسطس',
  13587. 'سبتمبر',
  13588. 'أكتوبر',
  13589. 'نوفمبر',
  13590. 'ديسمبر'
  13591. ];
  13592. var arLy = moment.defineLocale('ar-ly', {
  13593. months : months,
  13594. monthsShort : months,
  13595. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13596. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13597. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13598. weekdaysParseExact : true,
  13599. longDateFormat : {
  13600. LT : 'HH:mm',
  13601. LTS : 'HH:mm:ss',
  13602. L : 'D/\u200FM/\u200FYYYY',
  13603. LL : 'D MMMM YYYY',
  13604. LLL : 'D MMMM YYYY HH:mm',
  13605. LLLL : 'dddd D MMMM YYYY HH:mm'
  13606. },
  13607. meridiemParse: /ص|م/,
  13608. isPM : function (input) {
  13609. return 'م' === input;
  13610. },
  13611. meridiem : function (hour, minute, isLower) {
  13612. if (hour < 12) {
  13613. return 'ص';
  13614. } else {
  13615. return 'م';
  13616. }
  13617. },
  13618. calendar : {
  13619. sameDay: '[اليوم عند الساعة] LT',
  13620. nextDay: '[غدًا عند الساعة] LT',
  13621. nextWeek: 'dddd [عند الساعة] LT',
  13622. lastDay: '[أمس عند الساعة] LT',
  13623. lastWeek: 'dddd [عند الساعة] LT',
  13624. sameElse: 'L'
  13625. },
  13626. relativeTime : {
  13627. future : 'بعد %s',
  13628. past : 'منذ %s',
  13629. s : pluralize('s'),
  13630. m : pluralize('m'),
  13631. mm : pluralize('m'),
  13632. h : pluralize('h'),
  13633. hh : pluralize('h'),
  13634. d : pluralize('d'),
  13635. dd : pluralize('d'),
  13636. M : pluralize('M'),
  13637. MM : pluralize('M'),
  13638. y : pluralize('y'),
  13639. yy : pluralize('y')
  13640. },
  13641. preparse: function (string) {
  13642. return string.replace(/\u200f/g, '').replace(/،/g, ',');
  13643. },
  13644. postformat: function (string) {
  13645. return string.replace(/\d/g, function (match) {
  13646. return symbolMap[match];
  13647. }).replace(/,/g, '،');
  13648. },
  13649. week : {
  13650. dow : 6, // Saturday is the first day of the week.
  13651. doy : 12 // The week that contains Jan 1st is the first week of the year.
  13652. }
  13653. });
  13654. return arLy;
  13655. })));
  13656. /***/ }),
  13657. /* 8 */
  13658. /***/ (function(module, exports, __webpack_require__) {
  13659. //! moment.js locale configuration
  13660. //! locale : Arabic (Morocco) [ar-ma]
  13661. //! author : ElFadili Yassine : https://github.com/ElFadiliY
  13662. //! author : Abdel Said : https://github.com/abdelsaid
  13663. ;(function (global, factory) {
  13664. true ? factory(__webpack_require__(0)) :
  13665. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13666. factory(global.moment)
  13667. }(this, (function (moment) { 'use strict';
  13668. var arMa = moment.defineLocale('ar-ma', {
  13669. months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  13670. monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
  13671. weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13672. weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  13673. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13674. weekdaysParseExact : true,
  13675. longDateFormat : {
  13676. LT : 'HH:mm',
  13677. LTS : 'HH:mm:ss',
  13678. L : 'DD/MM/YYYY',
  13679. LL : 'D MMMM YYYY',
  13680. LLL : 'D MMMM YYYY HH:mm',
  13681. LLLL : 'dddd D MMMM YYYY HH:mm'
  13682. },
  13683. calendar : {
  13684. sameDay: '[اليوم على الساعة] LT',
  13685. nextDay: '[غدا على الساعة] LT',
  13686. nextWeek: 'dddd [على الساعة] LT',
  13687. lastDay: '[أمس على الساعة] LT',
  13688. lastWeek: 'dddd [على الساعة] LT',
  13689. sameElse: 'L'
  13690. },
  13691. relativeTime : {
  13692. future : 'في %s',
  13693. past : 'منذ %s',
  13694. s : 'ثوان',
  13695. m : 'دقيقة',
  13696. mm : '%d دقائق',
  13697. h : 'ساعة',
  13698. hh : '%d ساعات',
  13699. d : 'يوم',
  13700. dd : '%d أيام',
  13701. M : 'شهر',
  13702. MM : '%d أشهر',
  13703. y : 'سنة',
  13704. yy : '%d سنوات'
  13705. },
  13706. week : {
  13707. dow : 6, // Saturday is the first day of the week.
  13708. doy : 12 // The week that contains Jan 1st is the first week of the year.
  13709. }
  13710. });
  13711. return arMa;
  13712. })));
  13713. /***/ }),
  13714. /* 9 */
  13715. /***/ (function(module, exports, __webpack_require__) {
  13716. //! moment.js locale configuration
  13717. //! locale : Arabic (Saudi Arabia) [ar-sa]
  13718. //! author : Suhail Alkowaileet : https://github.com/xsoh
  13719. ;(function (global, factory) {
  13720. true ? factory(__webpack_require__(0)) :
  13721. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13722. factory(global.moment)
  13723. }(this, (function (moment) { 'use strict';
  13724. var symbolMap = {
  13725. '1': '١',
  13726. '2': '٢',
  13727. '3': '٣',
  13728. '4': '٤',
  13729. '5': '٥',
  13730. '6': '٦',
  13731. '7': '٧',
  13732. '8': '٨',
  13733. '9': '٩',
  13734. '0': '٠'
  13735. };
  13736. var numberMap = {
  13737. '١': '1',
  13738. '٢': '2',
  13739. '٣': '3',
  13740. '٤': '4',
  13741. '٥': '5',
  13742. '٦': '6',
  13743. '٧': '7',
  13744. '٨': '8',
  13745. '٩': '9',
  13746. '٠': '0'
  13747. };
  13748. var arSa = moment.defineLocale('ar-sa', {
  13749. months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13750. monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13751. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13752. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13753. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13754. weekdaysParseExact : true,
  13755. longDateFormat : {
  13756. LT : 'HH:mm',
  13757. LTS : 'HH:mm:ss',
  13758. L : 'DD/MM/YYYY',
  13759. LL : 'D MMMM YYYY',
  13760. LLL : 'D MMMM YYYY HH:mm',
  13761. LLLL : 'dddd D MMMM YYYY HH:mm'
  13762. },
  13763. meridiemParse: /ص|م/,
  13764. isPM : function (input) {
  13765. return 'م' === input;
  13766. },
  13767. meridiem : function (hour, minute, isLower) {
  13768. if (hour < 12) {
  13769. return 'ص';
  13770. } else {
  13771. return 'م';
  13772. }
  13773. },
  13774. calendar : {
  13775. sameDay: '[اليوم على الساعة] LT',
  13776. nextDay: '[غدا على الساعة] LT',
  13777. nextWeek: 'dddd [على الساعة] LT',
  13778. lastDay: '[أمس على الساعة] LT',
  13779. lastWeek: 'dddd [على الساعة] LT',
  13780. sameElse: 'L'
  13781. },
  13782. relativeTime : {
  13783. future : 'في %s',
  13784. past : 'منذ %s',
  13785. s : 'ثوان',
  13786. m : 'دقيقة',
  13787. mm : '%d دقائق',
  13788. h : 'ساعة',
  13789. hh : '%d ساعات',
  13790. d : 'يوم',
  13791. dd : '%d أيام',
  13792. M : 'شهر',
  13793. MM : '%d أشهر',
  13794. y : 'سنة',
  13795. yy : '%d سنوات'
  13796. },
  13797. preparse: function (string) {
  13798. return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  13799. return numberMap[match];
  13800. }).replace(/،/g, ',');
  13801. },
  13802. postformat: function (string) {
  13803. return string.replace(/\d/g, function (match) {
  13804. return symbolMap[match];
  13805. }).replace(/,/g, '،');
  13806. },
  13807. week : {
  13808. dow : 0, // Sunday is the first day of the week.
  13809. doy : 6 // The week that contains Jan 1st is the first week of the year.
  13810. }
  13811. });
  13812. return arSa;
  13813. })));
  13814. /***/ }),
  13815. /* 10 */
  13816. /***/ (function(module, exports, __webpack_require__) {
  13817. //! moment.js locale configuration
  13818. //! locale : Arabic (Tunisia) [ar-tn]
  13819. //! author : Nader Toukabri : https://github.com/naderio
  13820. ;(function (global, factory) {
  13821. true ? factory(__webpack_require__(0)) :
  13822. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13823. factory(global.moment)
  13824. }(this, (function (moment) { 'use strict';
  13825. var arTn = moment.defineLocale('ar-tn', {
  13826. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13827. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
  13828. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13829. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13830. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13831. weekdaysParseExact : true,
  13832. longDateFormat: {
  13833. LT: 'HH:mm',
  13834. LTS: 'HH:mm:ss',
  13835. L: 'DD/MM/YYYY',
  13836. LL: 'D MMMM YYYY',
  13837. LLL: 'D MMMM YYYY HH:mm',
  13838. LLLL: 'dddd D MMMM YYYY HH:mm'
  13839. },
  13840. calendar: {
  13841. sameDay: '[اليوم على الساعة] LT',
  13842. nextDay: '[غدا على الساعة] LT',
  13843. nextWeek: 'dddd [على الساعة] LT',
  13844. lastDay: '[أمس على الساعة] LT',
  13845. lastWeek: 'dddd [على الساعة] LT',
  13846. sameElse: 'L'
  13847. },
  13848. relativeTime: {
  13849. future: 'في %s',
  13850. past: 'منذ %s',
  13851. s: 'ثوان',
  13852. m: 'دقيقة',
  13853. mm: '%d دقائق',
  13854. h: 'ساعة',
  13855. hh: '%d ساعات',
  13856. d: 'يوم',
  13857. dd: '%d أيام',
  13858. M: 'شهر',
  13859. MM: '%d أشهر',
  13860. y: 'سنة',
  13861. yy: '%d سنوات'
  13862. },
  13863. week: {
  13864. dow: 1, // Monday is the first day of the week.
  13865. doy: 4 // The week that contains Jan 4th is the first week of the year.
  13866. }
  13867. });
  13868. return arTn;
  13869. })));
  13870. /***/ }),
  13871. /* 11 */
  13872. /***/ (function(module, exports, __webpack_require__) {
  13873. //! moment.js locale configuration
  13874. //! locale : Arabic [ar]
  13875. //! author : Abdel Said: https://github.com/abdelsaid
  13876. //! author : Ahmed Elkhatib
  13877. //! author : forabi https://github.com/forabi
  13878. ;(function (global, factory) {
  13879. true ? factory(__webpack_require__(0)) :
  13880. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  13881. factory(global.moment)
  13882. }(this, (function (moment) { 'use strict';
  13883. var symbolMap = {
  13884. '1': '١',
  13885. '2': '٢',
  13886. '3': '٣',
  13887. '4': '٤',
  13888. '5': '٥',
  13889. '6': '٦',
  13890. '7': '٧',
  13891. '8': '٨',
  13892. '9': '٩',
  13893. '0': '٠'
  13894. };
  13895. var numberMap = {
  13896. '١': '1',
  13897. '٢': '2',
  13898. '٣': '3',
  13899. '٤': '4',
  13900. '٥': '5',
  13901. '٦': '6',
  13902. '٧': '7',
  13903. '٨': '8',
  13904. '٩': '9',
  13905. '٠': '0'
  13906. };
  13907. var pluralForm = function (n) {
  13908. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  13909. };
  13910. var plurals = {
  13911. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  13912. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  13913. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  13914. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  13915. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  13916. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  13917. };
  13918. var pluralize = function (u) {
  13919. return function (number, withoutSuffix, string, isFuture) {
  13920. var f = pluralForm(number),
  13921. str = plurals[u][pluralForm(number)];
  13922. if (f === 2) {
  13923. str = str[withoutSuffix ? 0 : 1];
  13924. }
  13925. return str.replace(/%d/i, number);
  13926. };
  13927. };
  13928. var months = [
  13929. 'كانون الثاني يناير',
  13930. 'شباط فبراير',
  13931. 'آذار مارس',
  13932. 'نيسان أبريل',
  13933. 'أيار مايو',
  13934. 'حزيران يونيو',
  13935. 'تموز يوليو',
  13936. 'آب أغسطس',
  13937. 'أيلول سبتمبر',
  13938. 'تشرين الأول أكتوبر',
  13939. 'تشرين الثاني نوفمبر',
  13940. 'كانون الأول ديسمبر'
  13941. ];
  13942. var ar = moment.defineLocale('ar', {
  13943. months : months,
  13944. monthsShort : months,
  13945. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  13946. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  13947. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  13948. weekdaysParseExact : true,
  13949. longDateFormat : {
  13950. LT : 'HH:mm',
  13951. LTS : 'HH:mm:ss',
  13952. L : 'D/\u200FM/\u200FYYYY',
  13953. LL : 'D MMMM YYYY',
  13954. LLL : 'D MMMM YYYY HH:mm',
  13955. LLLL : 'dddd D MMMM YYYY HH:mm'
  13956. },
  13957. meridiemParse: /ص|م/,
  13958. isPM : function (input) {
  13959. return 'م' === input;
  13960. },
  13961. meridiem : function (hour, minute, isLower) {
  13962. if (hour < 12) {
  13963. return 'ص';
  13964. } else {
  13965. return 'م';
  13966. }
  13967. },
  13968. calendar : {
  13969. sameDay: '[اليوم عند الساعة] LT',
  13970. nextDay: '[غدًا عند الساعة] LT',
  13971. nextWeek: 'dddd [عند الساعة] LT',
  13972. lastDay: '[أمس عند الساعة] LT',
  13973. lastWeek: 'dddd [عند الساعة] LT',
  13974. sameElse: 'L'
  13975. },
  13976. relativeTime : {
  13977. future : 'بعد %s',
  13978. past : 'منذ %s',
  13979. s : pluralize('s'),
  13980. m : pluralize('m'),
  13981. mm : pluralize('m'),
  13982. h : pluralize('h'),
  13983. hh : pluralize('h'),
  13984. d : pluralize('d'),
  13985. dd : pluralize('d'),
  13986. M : pluralize('M'),
  13987. MM : pluralize('M'),
  13988. y : pluralize('y'),
  13989. yy : pluralize('y')
  13990. },
  13991. preparse: function (string) {
  13992. return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  13993. return numberMap[match];
  13994. }).replace(/،/g, ',');
  13995. },
  13996. postformat: function (string) {
  13997. return string.replace(/\d/g, function (match) {
  13998. return symbolMap[match];
  13999. }).replace(/,/g, '،');
  14000. },
  14001. week : {
  14002. dow : 6, // Saturday is the first day of the week.
  14003. doy : 12 // The week that contains Jan 1st is the first week of the year.
  14004. }
  14005. });
  14006. return ar;
  14007. })));
  14008. /***/ }),
  14009. /* 12 */
  14010. /***/ (function(module, exports, __webpack_require__) {
  14011. //! moment.js locale configuration
  14012. //! locale : Azerbaijani [az]
  14013. //! author : topchiyev : https://github.com/topchiyev
  14014. ;(function (global, factory) {
  14015. true ? factory(__webpack_require__(0)) :
  14016. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14017. factory(global.moment)
  14018. }(this, (function (moment) { 'use strict';
  14019. var suffixes = {
  14020. 1: '-inci',
  14021. 5: '-inci',
  14022. 8: '-inci',
  14023. 70: '-inci',
  14024. 80: '-inci',
  14025. 2: '-nci',
  14026. 7: '-nci',
  14027. 20: '-nci',
  14028. 50: '-nci',
  14029. 3: '-üncü',
  14030. 4: '-üncü',
  14031. 100: '-üncü',
  14032. 6: '-ncı',
  14033. 9: '-uncu',
  14034. 10: '-uncu',
  14035. 30: '-uncu',
  14036. 60: '-ıncı',
  14037. 90: '-ıncı'
  14038. };
  14039. var az = moment.defineLocale('az', {
  14040. months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
  14041. monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  14042. weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
  14043. weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  14044. weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  14045. weekdaysParseExact : true,
  14046. longDateFormat : {
  14047. LT : 'HH:mm',
  14048. LTS : 'HH:mm:ss',
  14049. L : 'DD.MM.YYYY',
  14050. LL : 'D MMMM YYYY',
  14051. LLL : 'D MMMM YYYY HH:mm',
  14052. LLLL : 'dddd, D MMMM YYYY HH:mm'
  14053. },
  14054. calendar : {
  14055. sameDay : '[bugün saat] LT',
  14056. nextDay : '[sabah saat] LT',
  14057. nextWeek : '[gələn həftə] dddd [saat] LT',
  14058. lastDay : '[dünən] LT',
  14059. lastWeek : '[keçən həftə] dddd [saat] LT',
  14060. sameElse : 'L'
  14061. },
  14062. relativeTime : {
  14063. future : '%s sonra',
  14064. past : '%s əvvəl',
  14065. s : 'birneçə saniyyə',
  14066. m : 'bir dəqiqə',
  14067. mm : '%d dəqiqə',
  14068. h : 'bir saat',
  14069. hh : '%d saat',
  14070. d : 'bir gün',
  14071. dd : '%d gün',
  14072. M : 'bir ay',
  14073. MM : '%d ay',
  14074. y : 'bir il',
  14075. yy : '%d il'
  14076. },
  14077. meridiemParse: /gecə|səhər|gündüz|axşam/,
  14078. isPM : function (input) {
  14079. return /^(gündüz|axşam)$/.test(input);
  14080. },
  14081. meridiem : function (hour, minute, isLower) {
  14082. if (hour < 4) {
  14083. return 'gecə';
  14084. } else if (hour < 12) {
  14085. return 'səhər';
  14086. } else if (hour < 17) {
  14087. return 'gündüz';
  14088. } else {
  14089. return 'axşam';
  14090. }
  14091. },
  14092. ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  14093. ordinal : function (number) {
  14094. if (number === 0) { // special case for zero
  14095. return number + '-ıncı';
  14096. }
  14097. var a = number % 10,
  14098. b = number % 100 - a,
  14099. c = number >= 100 ? 100 : null;
  14100. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  14101. },
  14102. week : {
  14103. dow : 1, // Monday is the first day of the week.
  14104. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14105. }
  14106. });
  14107. return az;
  14108. })));
  14109. /***/ }),
  14110. /* 13 */
  14111. /***/ (function(module, exports, __webpack_require__) {
  14112. //! moment.js locale configuration
  14113. //! locale : Belarusian [be]
  14114. //! author : Dmitry Demidov : https://github.com/demidov91
  14115. //! author: Praleska: http://praleska.pro/
  14116. //! Author : Menelion Elensúle : https://github.com/Oire
  14117. ;(function (global, factory) {
  14118. true ? factory(__webpack_require__(0)) :
  14119. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14120. factory(global.moment)
  14121. }(this, (function (moment) { 'use strict';
  14122. function plural(word, num) {
  14123. var forms = word.split('_');
  14124. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  14125. }
  14126. function relativeTimeWithPlural(number, withoutSuffix, key) {
  14127. var format = {
  14128. 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  14129. 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  14130. 'dd': 'дзень_дні_дзён',
  14131. 'MM': 'месяц_месяцы_месяцаў',
  14132. 'yy': 'год_гады_гадоў'
  14133. };
  14134. if (key === 'm') {
  14135. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  14136. }
  14137. else if (key === 'h') {
  14138. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  14139. }
  14140. else {
  14141. return number + ' ' + plural(format[key], +number);
  14142. }
  14143. }
  14144. var be = moment.defineLocale('be', {
  14145. months : {
  14146. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
  14147. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
  14148. },
  14149. monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
  14150. weekdays : {
  14151. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
  14152. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
  14153. isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
  14154. },
  14155. weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  14156. weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  14157. longDateFormat : {
  14158. LT : 'HH:mm',
  14159. LTS : 'HH:mm:ss',
  14160. L : 'DD.MM.YYYY',
  14161. LL : 'D MMMM YYYY г.',
  14162. LLL : 'D MMMM YYYY г., HH:mm',
  14163. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  14164. },
  14165. calendar : {
  14166. sameDay: '[Сёння ў] LT',
  14167. nextDay: '[Заўтра ў] LT',
  14168. lastDay: '[Учора ў] LT',
  14169. nextWeek: function () {
  14170. return '[У] dddd [ў] LT';
  14171. },
  14172. lastWeek: function () {
  14173. switch (this.day()) {
  14174. case 0:
  14175. case 3:
  14176. case 5:
  14177. case 6:
  14178. return '[У мінулую] dddd [ў] LT';
  14179. case 1:
  14180. case 2:
  14181. case 4:
  14182. return '[У мінулы] dddd [ў] LT';
  14183. }
  14184. },
  14185. sameElse: 'L'
  14186. },
  14187. relativeTime : {
  14188. future : 'праз %s',
  14189. past : '%s таму',
  14190. s : 'некалькі секунд',
  14191. m : relativeTimeWithPlural,
  14192. mm : relativeTimeWithPlural,
  14193. h : relativeTimeWithPlural,
  14194. hh : relativeTimeWithPlural,
  14195. d : 'дзень',
  14196. dd : relativeTimeWithPlural,
  14197. M : 'месяц',
  14198. MM : relativeTimeWithPlural,
  14199. y : 'год',
  14200. yy : relativeTimeWithPlural
  14201. },
  14202. meridiemParse: /ночы|раніцы|дня|вечара/,
  14203. isPM : function (input) {
  14204. return /^(дня|вечара)$/.test(input);
  14205. },
  14206. meridiem : function (hour, minute, isLower) {
  14207. if (hour < 4) {
  14208. return 'ночы';
  14209. } else if (hour < 12) {
  14210. return 'раніцы';
  14211. } else if (hour < 17) {
  14212. return 'дня';
  14213. } else {
  14214. return 'вечара';
  14215. }
  14216. },
  14217. ordinalParse: /\d{1,2}-(і|ы|га)/,
  14218. ordinal: function (number, period) {
  14219. switch (period) {
  14220. case 'M':
  14221. case 'd':
  14222. case 'DDD':
  14223. case 'w':
  14224. case 'W':
  14225. return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
  14226. case 'D':
  14227. return number + '-га';
  14228. default:
  14229. return number;
  14230. }
  14231. },
  14232. week : {
  14233. dow : 1, // Monday is the first day of the week.
  14234. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14235. }
  14236. });
  14237. return be;
  14238. })));
  14239. /***/ }),
  14240. /* 14 */
  14241. /***/ (function(module, exports, __webpack_require__) {
  14242. //! moment.js locale configuration
  14243. //! locale : Bulgarian [bg]
  14244. //! author : Krasen Borisov : https://github.com/kraz
  14245. ;(function (global, factory) {
  14246. true ? factory(__webpack_require__(0)) :
  14247. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14248. factory(global.moment)
  14249. }(this, (function (moment) { 'use strict';
  14250. var bg = moment.defineLocale('bg', {
  14251. months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
  14252. monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  14253. weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
  14254. weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  14255. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  14256. longDateFormat : {
  14257. LT : 'H:mm',
  14258. LTS : 'H:mm:ss',
  14259. L : 'D.MM.YYYY',
  14260. LL : 'D MMMM YYYY',
  14261. LLL : 'D MMMM YYYY H:mm',
  14262. LLLL : 'dddd, D MMMM YYYY H:mm'
  14263. },
  14264. calendar : {
  14265. sameDay : '[Днес в] LT',
  14266. nextDay : '[Утре в] LT',
  14267. nextWeek : 'dddd [в] LT',
  14268. lastDay : '[Вчера в] LT',
  14269. lastWeek : function () {
  14270. switch (this.day()) {
  14271. case 0:
  14272. case 3:
  14273. case 6:
  14274. return '[В изминалата] dddd [в] LT';
  14275. case 1:
  14276. case 2:
  14277. case 4:
  14278. case 5:
  14279. return '[В изминалия] dddd [в] LT';
  14280. }
  14281. },
  14282. sameElse : 'L'
  14283. },
  14284. relativeTime : {
  14285. future : 'след %s',
  14286. past : 'преди %s',
  14287. s : 'няколко секунди',
  14288. m : 'минута',
  14289. mm : '%d минути',
  14290. h : 'час',
  14291. hh : '%d часа',
  14292. d : 'ден',
  14293. dd : '%d дни',
  14294. M : 'месец',
  14295. MM : '%d месеца',
  14296. y : 'година',
  14297. yy : '%d години'
  14298. },
  14299. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  14300. ordinal : function (number) {
  14301. var lastDigit = number % 10,
  14302. last2Digits = number % 100;
  14303. if (number === 0) {
  14304. return number + '-ев';
  14305. } else if (last2Digits === 0) {
  14306. return number + '-ен';
  14307. } else if (last2Digits > 10 && last2Digits < 20) {
  14308. return number + '-ти';
  14309. } else if (lastDigit === 1) {
  14310. return number + '-ви';
  14311. } else if (lastDigit === 2) {
  14312. return number + '-ри';
  14313. } else if (lastDigit === 7 || lastDigit === 8) {
  14314. return number + '-ми';
  14315. } else {
  14316. return number + '-ти';
  14317. }
  14318. },
  14319. week : {
  14320. dow : 1, // Monday is the first day of the week.
  14321. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14322. }
  14323. });
  14324. return bg;
  14325. })));
  14326. /***/ }),
  14327. /* 15 */
  14328. /***/ (function(module, exports, __webpack_require__) {
  14329. //! moment.js locale configuration
  14330. //! locale : Bengali [bn]
  14331. //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
  14332. ;(function (global, factory) {
  14333. true ? factory(__webpack_require__(0)) :
  14334. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14335. factory(global.moment)
  14336. }(this, (function (moment) { 'use strict';
  14337. var symbolMap = {
  14338. '1': '১',
  14339. '2': '২',
  14340. '3': '৩',
  14341. '4': '৪',
  14342. '5': '৫',
  14343. '6': '৬',
  14344. '7': '৭',
  14345. '8': '৮',
  14346. '9': '৯',
  14347. '0': '০'
  14348. };
  14349. var numberMap = {
  14350. '১': '1',
  14351. '২': '2',
  14352. '৩': '3',
  14353. '৪': '4',
  14354. '৫': '5',
  14355. '৬': '6',
  14356. '৭': '7',
  14357. '৮': '8',
  14358. '৯': '9',
  14359. '০': '0'
  14360. };
  14361. var bn = moment.defineLocale('bn', {
  14362. months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
  14363. monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
  14364. weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
  14365. weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  14366. weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
  14367. longDateFormat : {
  14368. LT : 'A h:mm সময়',
  14369. LTS : 'A h:mm:ss সময়',
  14370. L : 'DD/MM/YYYY',
  14371. LL : 'D MMMM YYYY',
  14372. LLL : 'D MMMM YYYY, A h:mm সময়',
  14373. LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
  14374. },
  14375. calendar : {
  14376. sameDay : '[আজ] LT',
  14377. nextDay : '[আগামীকাল] LT',
  14378. nextWeek : 'dddd, LT',
  14379. lastDay : '[গতকাল] LT',
  14380. lastWeek : '[গত] dddd, LT',
  14381. sameElse : 'L'
  14382. },
  14383. relativeTime : {
  14384. future : '%s পরে',
  14385. past : '%s আগে',
  14386. s : 'কয়েক সেকেন্ড',
  14387. m : 'এক মিনিট',
  14388. mm : '%d মিনিট',
  14389. h : 'এক ঘন্টা',
  14390. hh : '%d ঘন্টা',
  14391. d : 'এক দিন',
  14392. dd : '%d দিন',
  14393. M : 'এক মাস',
  14394. MM : '%d মাস',
  14395. y : 'এক বছর',
  14396. yy : '%d বছর'
  14397. },
  14398. preparse: function (string) {
  14399. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  14400. return numberMap[match];
  14401. });
  14402. },
  14403. postformat: function (string) {
  14404. return string.replace(/\d/g, function (match) {
  14405. return symbolMap[match];
  14406. });
  14407. },
  14408. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  14409. meridiemHour : function (hour, meridiem) {
  14410. if (hour === 12) {
  14411. hour = 0;
  14412. }
  14413. if ((meridiem === 'রাত' && hour >= 4) ||
  14414. (meridiem === 'দুপুর' && hour < 5) ||
  14415. meridiem === 'বিকাল') {
  14416. return hour + 12;
  14417. } else {
  14418. return hour;
  14419. }
  14420. },
  14421. meridiem : function (hour, minute, isLower) {
  14422. if (hour < 4) {
  14423. return 'রাত';
  14424. } else if (hour < 10) {
  14425. return 'সকাল';
  14426. } else if (hour < 17) {
  14427. return 'দুপুর';
  14428. } else if (hour < 20) {
  14429. return 'বিকাল';
  14430. } else {
  14431. return 'রাত';
  14432. }
  14433. },
  14434. week : {
  14435. dow : 0, // Sunday is the first day of the week.
  14436. doy : 6 // The week that contains Jan 1st is the first week of the year.
  14437. }
  14438. });
  14439. return bn;
  14440. })));
  14441. /***/ }),
  14442. /* 16 */
  14443. /***/ (function(module, exports, __webpack_require__) {
  14444. //! moment.js locale configuration
  14445. //! locale : Tibetan [bo]
  14446. //! author : Thupten N. Chakrishar : https://github.com/vajradog
  14447. ;(function (global, factory) {
  14448. true ? factory(__webpack_require__(0)) :
  14449. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14450. factory(global.moment)
  14451. }(this, (function (moment) { 'use strict';
  14452. var symbolMap = {
  14453. '1': '༡',
  14454. '2': '༢',
  14455. '3': '༣',
  14456. '4': '༤',
  14457. '5': '༥',
  14458. '6': '༦',
  14459. '7': '༧',
  14460. '8': '༨',
  14461. '9': '༩',
  14462. '0': '༠'
  14463. };
  14464. var numberMap = {
  14465. '༡': '1',
  14466. '༢': '2',
  14467. '༣': '3',
  14468. '༤': '4',
  14469. '༥': '5',
  14470. '༦': '6',
  14471. '༧': '7',
  14472. '༨': '8',
  14473. '༩': '9',
  14474. '༠': '0'
  14475. };
  14476. var bo = moment.defineLocale('bo', {
  14477. months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  14478. monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
  14479. weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
  14480. weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  14481. weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
  14482. longDateFormat : {
  14483. LT : 'A h:mm',
  14484. LTS : 'A h:mm:ss',
  14485. L : 'DD/MM/YYYY',
  14486. LL : 'D MMMM YYYY',
  14487. LLL : 'D MMMM YYYY, A h:mm',
  14488. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  14489. },
  14490. calendar : {
  14491. sameDay : '[དི་རིང] LT',
  14492. nextDay : '[སང་ཉིན] LT',
  14493. nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
  14494. lastDay : '[ཁ་སང] LT',
  14495. lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  14496. sameElse : 'L'
  14497. },
  14498. relativeTime : {
  14499. future : '%s ལ་',
  14500. past : '%s སྔན་ལ',
  14501. s : 'ལམ་སང',
  14502. m : 'སྐར་མ་གཅིག',
  14503. mm : '%d སྐར་མ',
  14504. h : 'ཆུ་ཚོད་གཅིག',
  14505. hh : '%d ཆུ་ཚོད',
  14506. d : 'ཉིན་གཅིག',
  14507. dd : '%d ཉིན་',
  14508. M : 'ཟླ་བ་གཅིག',
  14509. MM : '%d ཟླ་བ',
  14510. y : 'ལོ་གཅིག',
  14511. yy : '%d ལོ'
  14512. },
  14513. preparse: function (string) {
  14514. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  14515. return numberMap[match];
  14516. });
  14517. },
  14518. postformat: function (string) {
  14519. return string.replace(/\d/g, function (match) {
  14520. return symbolMap[match];
  14521. });
  14522. },
  14523. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  14524. meridiemHour : function (hour, meridiem) {
  14525. if (hour === 12) {
  14526. hour = 0;
  14527. }
  14528. if ((meridiem === 'མཚན་མོ' && hour >= 4) ||
  14529. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  14530. meridiem === 'དགོང་དག') {
  14531. return hour + 12;
  14532. } else {
  14533. return hour;
  14534. }
  14535. },
  14536. meridiem : function (hour, minute, isLower) {
  14537. if (hour < 4) {
  14538. return 'མཚན་མོ';
  14539. } else if (hour < 10) {
  14540. return 'ཞོགས་ཀས';
  14541. } else if (hour < 17) {
  14542. return 'ཉིན་གུང';
  14543. } else if (hour < 20) {
  14544. return 'དགོང་དག';
  14545. } else {
  14546. return 'མཚན་མོ';
  14547. }
  14548. },
  14549. week : {
  14550. dow : 0, // Sunday is the first day of the week.
  14551. doy : 6 // The week that contains Jan 1st is the first week of the year.
  14552. }
  14553. });
  14554. return bo;
  14555. })));
  14556. /***/ }),
  14557. /* 17 */
  14558. /***/ (function(module, exports, __webpack_require__) {
  14559. //! moment.js locale configuration
  14560. //! locale : Breton [br]
  14561. //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
  14562. ;(function (global, factory) {
  14563. true ? factory(__webpack_require__(0)) :
  14564. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14565. factory(global.moment)
  14566. }(this, (function (moment) { 'use strict';
  14567. function relativeTimeWithMutation(number, withoutSuffix, key) {
  14568. var format = {
  14569. 'mm': 'munutenn',
  14570. 'MM': 'miz',
  14571. 'dd': 'devezh'
  14572. };
  14573. return number + ' ' + mutation(format[key], number);
  14574. }
  14575. function specialMutationForYears(number) {
  14576. switch (lastNumber(number)) {
  14577. case 1:
  14578. case 3:
  14579. case 4:
  14580. case 5:
  14581. case 9:
  14582. return number + ' bloaz';
  14583. default:
  14584. return number + ' vloaz';
  14585. }
  14586. }
  14587. function lastNumber(number) {
  14588. if (number > 9) {
  14589. return lastNumber(number % 10);
  14590. }
  14591. return number;
  14592. }
  14593. function mutation(text, number) {
  14594. if (number === 2) {
  14595. return softMutation(text);
  14596. }
  14597. return text;
  14598. }
  14599. function softMutation(text) {
  14600. var mutationTable = {
  14601. 'm': 'v',
  14602. 'b': 'v',
  14603. 'd': 'z'
  14604. };
  14605. if (mutationTable[text.charAt(0)] === undefined) {
  14606. return text;
  14607. }
  14608. return mutationTable[text.charAt(0)] + text.substring(1);
  14609. }
  14610. var br = moment.defineLocale('br', {
  14611. months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
  14612. monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  14613. weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
  14614. weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  14615. weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  14616. weekdaysParseExact : true,
  14617. longDateFormat : {
  14618. LT : 'h[e]mm A',
  14619. LTS : 'h[e]mm:ss A',
  14620. L : 'DD/MM/YYYY',
  14621. LL : 'D [a viz] MMMM YYYY',
  14622. LLL : 'D [a viz] MMMM YYYY h[e]mm A',
  14623. LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
  14624. },
  14625. calendar : {
  14626. sameDay : '[Hiziv da] LT',
  14627. nextDay : '[Warc\'hoazh da] LT',
  14628. nextWeek : 'dddd [da] LT',
  14629. lastDay : '[Dec\'h da] LT',
  14630. lastWeek : 'dddd [paset da] LT',
  14631. sameElse : 'L'
  14632. },
  14633. relativeTime : {
  14634. future : 'a-benn %s',
  14635. past : '%s \'zo',
  14636. s : 'un nebeud segondennoù',
  14637. m : 'ur vunutenn',
  14638. mm : relativeTimeWithMutation,
  14639. h : 'un eur',
  14640. hh : '%d eur',
  14641. d : 'un devezh',
  14642. dd : relativeTimeWithMutation,
  14643. M : 'ur miz',
  14644. MM : relativeTimeWithMutation,
  14645. y : 'ur bloaz',
  14646. yy : specialMutationForYears
  14647. },
  14648. ordinalParse: /\d{1,2}(añ|vet)/,
  14649. ordinal : function (number) {
  14650. var output = (number === 1) ? 'añ' : 'vet';
  14651. return number + output;
  14652. },
  14653. week : {
  14654. dow : 1, // Monday is the first day of the week.
  14655. doy : 4 // The week that contains Jan 4th is the first week of the year.
  14656. }
  14657. });
  14658. return br;
  14659. })));
  14660. /***/ }),
  14661. /* 18 */
  14662. /***/ (function(module, exports, __webpack_require__) {
  14663. //! moment.js locale configuration
  14664. //! locale : Bosnian [bs]
  14665. //! author : Nedim Cholich : https://github.com/frontyard
  14666. //! based on (hr) translation by Bojan Marković
  14667. ;(function (global, factory) {
  14668. true ? factory(__webpack_require__(0)) :
  14669. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14670. factory(global.moment)
  14671. }(this, (function (moment) { 'use strict';
  14672. function translate(number, withoutSuffix, key) {
  14673. var result = number + ' ';
  14674. switch (key) {
  14675. case 'm':
  14676. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  14677. case 'mm':
  14678. if (number === 1) {
  14679. result += 'minuta';
  14680. } else if (number === 2 || number === 3 || number === 4) {
  14681. result += 'minute';
  14682. } else {
  14683. result += 'minuta';
  14684. }
  14685. return result;
  14686. case 'h':
  14687. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  14688. case 'hh':
  14689. if (number === 1) {
  14690. result += 'sat';
  14691. } else if (number === 2 || number === 3 || number === 4) {
  14692. result += 'sata';
  14693. } else {
  14694. result += 'sati';
  14695. }
  14696. return result;
  14697. case 'dd':
  14698. if (number === 1) {
  14699. result += 'dan';
  14700. } else {
  14701. result += 'dana';
  14702. }
  14703. return result;
  14704. case 'MM':
  14705. if (number === 1) {
  14706. result += 'mjesec';
  14707. } else if (number === 2 || number === 3 || number === 4) {
  14708. result += 'mjeseca';
  14709. } else {
  14710. result += 'mjeseci';
  14711. }
  14712. return result;
  14713. case 'yy':
  14714. if (number === 1) {
  14715. result += 'godina';
  14716. } else if (number === 2 || number === 3 || number === 4) {
  14717. result += 'godine';
  14718. } else {
  14719. result += 'godina';
  14720. }
  14721. return result;
  14722. }
  14723. }
  14724. var bs = moment.defineLocale('bs', {
  14725. months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
  14726. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
  14727. monthsParseExact: true,
  14728. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  14729. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  14730. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  14731. weekdaysParseExact : true,
  14732. longDateFormat : {
  14733. LT : 'H:mm',
  14734. LTS : 'H:mm:ss',
  14735. L : 'DD.MM.YYYY',
  14736. LL : 'D. MMMM YYYY',
  14737. LLL : 'D. MMMM YYYY H:mm',
  14738. LLLL : 'dddd, D. MMMM YYYY H:mm'
  14739. },
  14740. calendar : {
  14741. sameDay : '[danas u] LT',
  14742. nextDay : '[sutra u] LT',
  14743. nextWeek : function () {
  14744. switch (this.day()) {
  14745. case 0:
  14746. return '[u] [nedjelju] [u] LT';
  14747. case 3:
  14748. return '[u] [srijedu] [u] LT';
  14749. case 6:
  14750. return '[u] [subotu] [u] LT';
  14751. case 1:
  14752. case 2:
  14753. case 4:
  14754. case 5:
  14755. return '[u] dddd [u] LT';
  14756. }
  14757. },
  14758. lastDay : '[jučer u] LT',
  14759. lastWeek : function () {
  14760. switch (this.day()) {
  14761. case 0:
  14762. case 3:
  14763. return '[prošlu] dddd [u] LT';
  14764. case 6:
  14765. return '[prošle] [subote] [u] LT';
  14766. case 1:
  14767. case 2:
  14768. case 4:
  14769. case 5:
  14770. return '[prošli] dddd [u] LT';
  14771. }
  14772. },
  14773. sameElse : 'L'
  14774. },
  14775. relativeTime : {
  14776. future : 'za %s',
  14777. past : 'prije %s',
  14778. s : 'par sekundi',
  14779. m : translate,
  14780. mm : translate,
  14781. h : translate,
  14782. hh : translate,
  14783. d : 'dan',
  14784. dd : translate,
  14785. M : 'mjesec',
  14786. MM : translate,
  14787. y : 'godinu',
  14788. yy : translate
  14789. },
  14790. ordinalParse: /\d{1,2}\./,
  14791. ordinal : '%d.',
  14792. week : {
  14793. dow : 1, // Monday is the first day of the week.
  14794. doy : 7 // The week that contains Jan 1st is the first week of the year.
  14795. }
  14796. });
  14797. return bs;
  14798. })));
  14799. /***/ }),
  14800. /* 19 */
  14801. /***/ (function(module, exports, __webpack_require__) {
  14802. //! moment.js locale configuration
  14803. //! locale : Catalan [ca]
  14804. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  14805. ;(function (global, factory) {
  14806. true ? factory(__webpack_require__(0)) :
  14807. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14808. factory(global.moment)
  14809. }(this, (function (moment) { 'use strict';
  14810. var ca = moment.defineLocale('ca', {
  14811. months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
  14812. monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'),
  14813. monthsParseExact : true,
  14814. weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
  14815. weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  14816. weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'),
  14817. weekdaysParseExact : true,
  14818. longDateFormat : {
  14819. LT : 'H:mm',
  14820. LTS : 'H:mm:ss',
  14821. L : 'DD/MM/YYYY',
  14822. LL : 'D MMMM YYYY',
  14823. LLL : 'D MMMM YYYY H:mm',
  14824. LLLL : 'dddd D MMMM YYYY H:mm'
  14825. },
  14826. calendar : {
  14827. sameDay : function () {
  14828. return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14829. },
  14830. nextDay : function () {
  14831. return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14832. },
  14833. nextWeek : function () {
  14834. return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14835. },
  14836. lastDay : function () {
  14837. return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14838. },
  14839. lastWeek : function () {
  14840. return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  14841. },
  14842. sameElse : 'L'
  14843. },
  14844. relativeTime : {
  14845. future : 'd\'aquí %s',
  14846. past : 'fa %s',
  14847. s : 'uns segons',
  14848. m : 'un minut',
  14849. mm : '%d minuts',
  14850. h : 'una hora',
  14851. hh : '%d hores',
  14852. d : 'un dia',
  14853. dd : '%d dies',
  14854. M : 'un mes',
  14855. MM : '%d mesos',
  14856. y : 'un any',
  14857. yy : '%d anys'
  14858. },
  14859. ordinalParse: /\d{1,2}(r|n|t|è|a)/,
  14860. ordinal : function (number, period) {
  14861. var output = (number === 1) ? 'r' :
  14862. (number === 2) ? 'n' :
  14863. (number === 3) ? 'r' :
  14864. (number === 4) ? 't' : 'è';
  14865. if (period === 'w' || period === 'W') {
  14866. output = 'a';
  14867. }
  14868. return number + output;
  14869. },
  14870. week : {
  14871. dow : 1, // Monday is the first day of the week.
  14872. doy : 4 // The week that contains Jan 4th is the first week of the year.
  14873. }
  14874. });
  14875. return ca;
  14876. })));
  14877. /***/ }),
  14878. /* 20 */
  14879. /***/ (function(module, exports, __webpack_require__) {
  14880. //! moment.js locale configuration
  14881. //! locale : Czech [cs]
  14882. //! author : petrbela : https://github.com/petrbela
  14883. ;(function (global, factory) {
  14884. true ? factory(__webpack_require__(0)) :
  14885. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  14886. factory(global.moment)
  14887. }(this, (function (moment) { 'use strict';
  14888. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
  14889. var monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
  14890. function plural(n) {
  14891. return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
  14892. }
  14893. function translate(number, withoutSuffix, key, isFuture) {
  14894. var result = number + ' ';
  14895. switch (key) {
  14896. case 's': // a few seconds / in a few seconds / a few seconds ago
  14897. return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
  14898. case 'm': // a minute / in a minute / a minute ago
  14899. return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
  14900. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  14901. if (withoutSuffix || isFuture) {
  14902. return result + (plural(number) ? 'minuty' : 'minut');
  14903. } else {
  14904. return result + 'minutami';
  14905. }
  14906. break;
  14907. case 'h': // an hour / in an hour / an hour ago
  14908. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  14909. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  14910. if (withoutSuffix || isFuture) {
  14911. return result + (plural(number) ? 'hodiny' : 'hodin');
  14912. } else {
  14913. return result + 'hodinami';
  14914. }
  14915. break;
  14916. case 'd': // a day / in a day / a day ago
  14917. return (withoutSuffix || isFuture) ? 'den' : 'dnem';
  14918. case 'dd': // 9 days / in 9 days / 9 days ago
  14919. if (withoutSuffix || isFuture) {
  14920. return result + (plural(number) ? 'dny' : 'dní');
  14921. } else {
  14922. return result + 'dny';
  14923. }
  14924. break;
  14925. case 'M': // a month / in a month / a month ago
  14926. return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
  14927. case 'MM': // 9 months / in 9 months / 9 months ago
  14928. if (withoutSuffix || isFuture) {
  14929. return result + (plural(number) ? 'měsíce' : 'měsíců');
  14930. } else {
  14931. return result + 'měsíci';
  14932. }
  14933. break;
  14934. case 'y': // a year / in a year / a year ago
  14935. return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
  14936. case 'yy': // 9 years / in 9 years / 9 years ago
  14937. if (withoutSuffix || isFuture) {
  14938. return result + (plural(number) ? 'roky' : 'let');
  14939. } else {
  14940. return result + 'lety';
  14941. }
  14942. break;
  14943. }
  14944. }
  14945. var cs = moment.defineLocale('cs', {
  14946. months : months,
  14947. monthsShort : monthsShort,
  14948. monthsParse : (function (months, monthsShort) {
  14949. var i, _monthsParse = [];
  14950. for (i = 0; i < 12; i++) {
  14951. // use custom parser to solve problem with July (červenec)
  14952. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  14953. }
  14954. return _monthsParse;
  14955. }(months, monthsShort)),
  14956. shortMonthsParse : (function (monthsShort) {
  14957. var i, _shortMonthsParse = [];
  14958. for (i = 0; i < 12; i++) {
  14959. _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
  14960. }
  14961. return _shortMonthsParse;
  14962. }(monthsShort)),
  14963. longMonthsParse : (function (months) {
  14964. var i, _longMonthsParse = [];
  14965. for (i = 0; i < 12; i++) {
  14966. _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
  14967. }
  14968. return _longMonthsParse;
  14969. }(months)),
  14970. weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  14971. weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
  14972. weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
  14973. longDateFormat : {
  14974. LT: 'H:mm',
  14975. LTS : 'H:mm:ss',
  14976. L : 'DD.MM.YYYY',
  14977. LL : 'D. MMMM YYYY',
  14978. LLL : 'D. MMMM YYYY H:mm',
  14979. LLLL : 'dddd D. MMMM YYYY H:mm',
  14980. l : 'D. M. YYYY'
  14981. },
  14982. calendar : {
  14983. sameDay: '[dnes v] LT',
  14984. nextDay: '[zítra v] LT',
  14985. nextWeek: function () {
  14986. switch (this.day()) {
  14987. case 0:
  14988. return '[v neděli v] LT';
  14989. case 1:
  14990. case 2:
  14991. return '[v] dddd [v] LT';
  14992. case 3:
  14993. return '[ve středu v] LT';
  14994. case 4:
  14995. return '[ve čtvrtek v] LT';
  14996. case 5:
  14997. return '[v pátek v] LT';
  14998. case 6:
  14999. return '[v sobotu v] LT';
  15000. }
  15001. },
  15002. lastDay: '[včera v] LT',
  15003. lastWeek: function () {
  15004. switch (this.day()) {
  15005. case 0:
  15006. return '[minulou neděli v] LT';
  15007. case 1:
  15008. case 2:
  15009. return '[minulé] dddd [v] LT';
  15010. case 3:
  15011. return '[minulou středu v] LT';
  15012. case 4:
  15013. case 5:
  15014. return '[minulý] dddd [v] LT';
  15015. case 6:
  15016. return '[minulou sobotu v] LT';
  15017. }
  15018. },
  15019. sameElse: 'L'
  15020. },
  15021. relativeTime : {
  15022. future : 'za %s',
  15023. past : 'před %s',
  15024. s : translate,
  15025. m : translate,
  15026. mm : translate,
  15027. h : translate,
  15028. hh : translate,
  15029. d : translate,
  15030. dd : translate,
  15031. M : translate,
  15032. MM : translate,
  15033. y : translate,
  15034. yy : translate
  15035. },
  15036. ordinalParse : /\d{1,2}\./,
  15037. ordinal : '%d.',
  15038. week : {
  15039. dow : 1, // Monday is the first day of the week.
  15040. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15041. }
  15042. });
  15043. return cs;
  15044. })));
  15045. /***/ }),
  15046. /* 21 */
  15047. /***/ (function(module, exports, __webpack_require__) {
  15048. //! moment.js locale configuration
  15049. //! locale : Chuvash [cv]
  15050. //! author : Anatoly Mironov : https://github.com/mirontoli
  15051. ;(function (global, factory) {
  15052. true ? factory(__webpack_require__(0)) :
  15053. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15054. factory(global.moment)
  15055. }(this, (function (moment) { 'use strict';
  15056. var cv = moment.defineLocale('cv', {
  15057. months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
  15058. monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  15059. weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
  15060. weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  15061. weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  15062. longDateFormat : {
  15063. LT : 'HH:mm',
  15064. LTS : 'HH:mm:ss',
  15065. L : 'DD-MM-YYYY',
  15066. LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  15067. LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  15068. LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
  15069. },
  15070. calendar : {
  15071. sameDay: '[Паян] LT [сехетре]',
  15072. nextDay: '[Ыран] LT [сехетре]',
  15073. lastDay: '[Ӗнер] LT [сехетре]',
  15074. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  15075. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  15076. sameElse: 'L'
  15077. },
  15078. relativeTime : {
  15079. future : function (output) {
  15080. var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
  15081. return output + affix;
  15082. },
  15083. past : '%s каялла',
  15084. s : 'пӗр-ик ҫеккунт',
  15085. m : 'пӗр минут',
  15086. mm : '%d минут',
  15087. h : 'пӗр сехет',
  15088. hh : '%d сехет',
  15089. d : 'пӗр кун',
  15090. dd : '%d кун',
  15091. M : 'пӗр уйӑх',
  15092. MM : '%d уйӑх',
  15093. y : 'пӗр ҫул',
  15094. yy : '%d ҫул'
  15095. },
  15096. ordinalParse: /\d{1,2}-мӗш/,
  15097. ordinal : '%d-мӗш',
  15098. week : {
  15099. dow : 1, // Monday is the first day of the week.
  15100. doy : 7 // The week that contains Jan 1st is the first week of the year.
  15101. }
  15102. });
  15103. return cv;
  15104. })));
  15105. /***/ }),
  15106. /* 22 */
  15107. /***/ (function(module, exports, __webpack_require__) {
  15108. //! moment.js locale configuration
  15109. //! locale : Welsh [cy]
  15110. //! author : Robert Allen : https://github.com/robgallen
  15111. //! author : https://github.com/ryangreaves
  15112. ;(function (global, factory) {
  15113. true ? factory(__webpack_require__(0)) :
  15114. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15115. factory(global.moment)
  15116. }(this, (function (moment) { 'use strict';
  15117. var cy = moment.defineLocale('cy', {
  15118. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
  15119. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
  15120. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
  15121. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  15122. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  15123. weekdaysParseExact : true,
  15124. // time formats are the same as en-gb
  15125. longDateFormat: {
  15126. LT: 'HH:mm',
  15127. LTS : 'HH:mm:ss',
  15128. L: 'DD/MM/YYYY',
  15129. LL: 'D MMMM YYYY',
  15130. LLL: 'D MMMM YYYY HH:mm',
  15131. LLLL: 'dddd, D MMMM YYYY HH:mm'
  15132. },
  15133. calendar: {
  15134. sameDay: '[Heddiw am] LT',
  15135. nextDay: '[Yfory am] LT',
  15136. nextWeek: 'dddd [am] LT',
  15137. lastDay: '[Ddoe am] LT',
  15138. lastWeek: 'dddd [diwethaf am] LT',
  15139. sameElse: 'L'
  15140. },
  15141. relativeTime: {
  15142. future: 'mewn %s',
  15143. past: '%s yn ôl',
  15144. s: 'ychydig eiliadau',
  15145. m: 'munud',
  15146. mm: '%d munud',
  15147. h: 'awr',
  15148. hh: '%d awr',
  15149. d: 'diwrnod',
  15150. dd: '%d diwrnod',
  15151. M: 'mis',
  15152. MM: '%d mis',
  15153. y: 'blwyddyn',
  15154. yy: '%d flynedd'
  15155. },
  15156. ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  15157. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  15158. ordinal: function (number) {
  15159. var b = number,
  15160. output = '',
  15161. lookup = [
  15162. '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
  15163. 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
  15164. ];
  15165. if (b > 20) {
  15166. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  15167. output = 'fed'; // not 30ain, 70ain or 90ain
  15168. } else {
  15169. output = 'ain';
  15170. }
  15171. } else if (b > 0) {
  15172. output = lookup[b];
  15173. }
  15174. return number + output;
  15175. },
  15176. week : {
  15177. dow : 1, // Monday is the first day of the week.
  15178. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15179. }
  15180. });
  15181. return cy;
  15182. })));
  15183. /***/ }),
  15184. /* 23 */
  15185. /***/ (function(module, exports, __webpack_require__) {
  15186. //! moment.js locale configuration
  15187. //! locale : Danish [da]
  15188. //! author : Ulrik Nielsen : https://github.com/mrbase
  15189. ;(function (global, factory) {
  15190. true ? factory(__webpack_require__(0)) :
  15191. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15192. factory(global.moment)
  15193. }(this, (function (moment) { 'use strict';
  15194. var da = moment.defineLocale('da', {
  15195. months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
  15196. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  15197. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  15198. weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  15199. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  15200. longDateFormat : {
  15201. LT : 'HH:mm',
  15202. LTS : 'HH:mm:ss',
  15203. L : 'DD/MM/YYYY',
  15204. LL : 'D. MMMM YYYY',
  15205. LLL : 'D. MMMM YYYY HH:mm',
  15206. LLLL : 'dddd [d.] D. MMMM YYYY HH:mm'
  15207. },
  15208. calendar : {
  15209. sameDay : '[I dag kl.] LT',
  15210. nextDay : '[I morgen kl.] LT',
  15211. nextWeek : 'dddd [kl.] LT',
  15212. lastDay : '[I går kl.] LT',
  15213. lastWeek : '[sidste] dddd [kl] LT',
  15214. sameElse : 'L'
  15215. },
  15216. relativeTime : {
  15217. future : 'om %s',
  15218. past : '%s siden',
  15219. s : 'få sekunder',
  15220. m : 'et minut',
  15221. mm : '%d minutter',
  15222. h : 'en time',
  15223. hh : '%d timer',
  15224. d : 'en dag',
  15225. dd : '%d dage',
  15226. M : 'en måned',
  15227. MM : '%d måneder',
  15228. y : 'et år',
  15229. yy : '%d år'
  15230. },
  15231. ordinalParse: /\d{1,2}\./,
  15232. ordinal : '%d.',
  15233. week : {
  15234. dow : 1, // Monday is the first day of the week.
  15235. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15236. }
  15237. });
  15238. return da;
  15239. })));
  15240. /***/ }),
  15241. /* 24 */
  15242. /***/ (function(module, exports, __webpack_require__) {
  15243. //! moment.js locale configuration
  15244. //! locale : German (Austria) [de-at]
  15245. //! author : lluchs : https://github.com/lluchs
  15246. //! author: Menelion Elensúle: https://github.com/Oire
  15247. //! author : Martin Groller : https://github.com/MadMG
  15248. //! author : Mikolaj Dadela : https://github.com/mik01aj
  15249. ;(function (global, factory) {
  15250. true ? factory(__webpack_require__(0)) :
  15251. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15252. factory(global.moment)
  15253. }(this, (function (moment) { 'use strict';
  15254. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  15255. var format = {
  15256. 'm': ['eine Minute', 'einer Minute'],
  15257. 'h': ['eine Stunde', 'einer Stunde'],
  15258. 'd': ['ein Tag', 'einem Tag'],
  15259. 'dd': [number + ' Tage', number + ' Tagen'],
  15260. 'M': ['ein Monat', 'einem Monat'],
  15261. 'MM': [number + ' Monate', number + ' Monaten'],
  15262. 'y': ['ein Jahr', 'einem Jahr'],
  15263. 'yy': [number + ' Jahre', number + ' Jahren']
  15264. };
  15265. return withoutSuffix ? format[key][0] : format[key][1];
  15266. }
  15267. var deAt = moment.defineLocale('de-at', {
  15268. months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  15269. monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  15270. monthsParseExact : true,
  15271. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  15272. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  15273. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  15274. weekdaysParseExact : true,
  15275. longDateFormat : {
  15276. LT: 'HH:mm',
  15277. LTS: 'HH:mm:ss',
  15278. L : 'DD.MM.YYYY',
  15279. LL : 'D. MMMM YYYY',
  15280. LLL : 'D. MMMM YYYY HH:mm',
  15281. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  15282. },
  15283. calendar : {
  15284. sameDay: '[heute um] LT [Uhr]',
  15285. sameElse: 'L',
  15286. nextDay: '[morgen um] LT [Uhr]',
  15287. nextWeek: 'dddd [um] LT [Uhr]',
  15288. lastDay: '[gestern um] LT [Uhr]',
  15289. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  15290. },
  15291. relativeTime : {
  15292. future : 'in %s',
  15293. past : 'vor %s',
  15294. s : 'ein paar Sekunden',
  15295. m : processRelativeTime,
  15296. mm : '%d Minuten',
  15297. h : processRelativeTime,
  15298. hh : '%d Stunden',
  15299. d : processRelativeTime,
  15300. dd : processRelativeTime,
  15301. M : processRelativeTime,
  15302. MM : processRelativeTime,
  15303. y : processRelativeTime,
  15304. yy : processRelativeTime
  15305. },
  15306. ordinalParse: /\d{1,2}\./,
  15307. ordinal : '%d.',
  15308. week : {
  15309. dow : 1, // Monday is the first day of the week.
  15310. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15311. }
  15312. });
  15313. return deAt;
  15314. })));
  15315. /***/ }),
  15316. /* 25 */
  15317. /***/ (function(module, exports, __webpack_require__) {
  15318. //! moment.js locale configuration
  15319. //! locale : German [de]
  15320. //! author : lluchs : https://github.com/lluchs
  15321. //! author: Menelion Elensúle: https://github.com/Oire
  15322. //! author : Mikolaj Dadela : https://github.com/mik01aj
  15323. ;(function (global, factory) {
  15324. true ? factory(__webpack_require__(0)) :
  15325. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15326. factory(global.moment)
  15327. }(this, (function (moment) { 'use strict';
  15328. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  15329. var format = {
  15330. 'm': ['eine Minute', 'einer Minute'],
  15331. 'h': ['eine Stunde', 'einer Stunde'],
  15332. 'd': ['ein Tag', 'einem Tag'],
  15333. 'dd': [number + ' Tage', number + ' Tagen'],
  15334. 'M': ['ein Monat', 'einem Monat'],
  15335. 'MM': [number + ' Monate', number + ' Monaten'],
  15336. 'y': ['ein Jahr', 'einem Jahr'],
  15337. 'yy': [number + ' Jahre', number + ' Jahren']
  15338. };
  15339. return withoutSuffix ? format[key][0] : format[key][1];
  15340. }
  15341. var de = moment.defineLocale('de', {
  15342. months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  15343. monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  15344. monthsParseExact : true,
  15345. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  15346. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  15347. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  15348. weekdaysParseExact : true,
  15349. longDateFormat : {
  15350. LT: 'HH:mm',
  15351. LTS: 'HH:mm:ss',
  15352. L : 'DD.MM.YYYY',
  15353. LL : 'D. MMMM YYYY',
  15354. LLL : 'D. MMMM YYYY HH:mm',
  15355. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  15356. },
  15357. calendar : {
  15358. sameDay: '[heute um] LT [Uhr]',
  15359. sameElse: 'L',
  15360. nextDay: '[morgen um] LT [Uhr]',
  15361. nextWeek: 'dddd [um] LT [Uhr]',
  15362. lastDay: '[gestern um] LT [Uhr]',
  15363. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  15364. },
  15365. relativeTime : {
  15366. future : 'in %s',
  15367. past : 'vor %s',
  15368. s : 'ein paar Sekunden',
  15369. m : processRelativeTime,
  15370. mm : '%d Minuten',
  15371. h : processRelativeTime,
  15372. hh : '%d Stunden',
  15373. d : processRelativeTime,
  15374. dd : processRelativeTime,
  15375. M : processRelativeTime,
  15376. MM : processRelativeTime,
  15377. y : processRelativeTime,
  15378. yy : processRelativeTime
  15379. },
  15380. ordinalParse: /\d{1,2}\./,
  15381. ordinal : '%d.',
  15382. week : {
  15383. dow : 1, // Monday is the first day of the week.
  15384. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15385. }
  15386. });
  15387. return de;
  15388. })));
  15389. /***/ }),
  15390. /* 26 */
  15391. /***/ (function(module, exports, __webpack_require__) {
  15392. //! moment.js locale configuration
  15393. //! locale : Maldivian [dv]
  15394. //! author : Jawish Hameed : https://github.com/jawish
  15395. ;(function (global, factory) {
  15396. true ? factory(__webpack_require__(0)) :
  15397. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15398. factory(global.moment)
  15399. }(this, (function (moment) { 'use strict';
  15400. var months = [
  15401. 'ޖެނުއަރީ',
  15402. 'ފެބްރުއަރީ',
  15403. 'މާރިޗު',
  15404. 'އޭޕްރީލު',
  15405. 'މޭ',
  15406. 'ޖޫން',
  15407. 'ޖުލައި',
  15408. 'އޯގަސްޓު',
  15409. 'ސެޕްޓެމްބަރު',
  15410. 'އޮކްޓޯބަރު',
  15411. 'ނޮވެމްބަރު',
  15412. 'ޑިސެމްބަރު'
  15413. ];
  15414. var weekdays = [
  15415. 'އާދިއްތަ',
  15416. 'ހޯމަ',
  15417. 'އަންގާރަ',
  15418. 'ބުދަ',
  15419. 'ބުރާސްފަތި',
  15420. 'ހުކުރު',
  15421. 'ހޮނިހިރު'
  15422. ];
  15423. var dv = moment.defineLocale('dv', {
  15424. months : months,
  15425. monthsShort : months,
  15426. weekdays : weekdays,
  15427. weekdaysShort : weekdays,
  15428. weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  15429. longDateFormat : {
  15430. LT : 'HH:mm',
  15431. LTS : 'HH:mm:ss',
  15432. L : 'D/M/YYYY',
  15433. LL : 'D MMMM YYYY',
  15434. LLL : 'D MMMM YYYY HH:mm',
  15435. LLLL : 'dddd D MMMM YYYY HH:mm'
  15436. },
  15437. meridiemParse: /މކ|މފ/,
  15438. isPM : function (input) {
  15439. return 'މފ' === input;
  15440. },
  15441. meridiem : function (hour, minute, isLower) {
  15442. if (hour < 12) {
  15443. return 'މކ';
  15444. } else {
  15445. return 'މފ';
  15446. }
  15447. },
  15448. calendar : {
  15449. sameDay : '[މިއަދު] LT',
  15450. nextDay : '[މާދަމާ] LT',
  15451. nextWeek : 'dddd LT',
  15452. lastDay : '[އިއްޔެ] LT',
  15453. lastWeek : '[ފާއިތުވި] dddd LT',
  15454. sameElse : 'L'
  15455. },
  15456. relativeTime : {
  15457. future : 'ތެރޭގައި %s',
  15458. past : 'ކުރިން %s',
  15459. s : 'ސިކުންތުކޮޅެއް',
  15460. m : 'މިނިޓެއް',
  15461. mm : 'މިނިޓު %d',
  15462. h : 'ގަޑިއިރެއް',
  15463. hh : 'ގަޑިއިރު %d',
  15464. d : 'ދުވަހެއް',
  15465. dd : 'ދުވަސް %d',
  15466. M : 'މަހެއް',
  15467. MM : 'މަސް %d',
  15468. y : 'އަހަރެއް',
  15469. yy : 'އަހަރު %d'
  15470. },
  15471. preparse: function (string) {
  15472. return string.replace(/،/g, ',');
  15473. },
  15474. postformat: function (string) {
  15475. return string.replace(/,/g, '،');
  15476. },
  15477. week : {
  15478. dow : 7, // Sunday is the first day of the week.
  15479. doy : 12 // The week that contains Jan 1st is the first week of the year.
  15480. }
  15481. });
  15482. return dv;
  15483. })));
  15484. /***/ }),
  15485. /* 27 */
  15486. /***/ (function(module, exports, __webpack_require__) {
  15487. //! moment.js locale configuration
  15488. //! locale : Greek [el]
  15489. //! author : Aggelos Karalias : https://github.com/mehiel
  15490. ;(function (global, factory) {
  15491. true ? factory(__webpack_require__(0)) :
  15492. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15493. factory(global.moment)
  15494. }(this, (function (moment) { 'use strict';
  15495. function isFunction(input) {
  15496. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  15497. }
  15498. var el = moment.defineLocale('el', {
  15499. monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
  15500. monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
  15501. months : function (momentToFormat, format) {
  15502. if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
  15503. return this._monthsGenitiveEl[momentToFormat.month()];
  15504. } else {
  15505. return this._monthsNominativeEl[momentToFormat.month()];
  15506. }
  15507. },
  15508. monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  15509. weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
  15510. weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  15511. weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  15512. meridiem : function (hours, minutes, isLower) {
  15513. if (hours > 11) {
  15514. return isLower ? 'μμ' : 'ΜΜ';
  15515. } else {
  15516. return isLower ? 'πμ' : 'ΠΜ';
  15517. }
  15518. },
  15519. isPM : function (input) {
  15520. return ((input + '').toLowerCase()[0] === 'μ');
  15521. },
  15522. meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
  15523. longDateFormat : {
  15524. LT : 'h:mm A',
  15525. LTS : 'h:mm:ss A',
  15526. L : 'DD/MM/YYYY',
  15527. LL : 'D MMMM YYYY',
  15528. LLL : 'D MMMM YYYY h:mm A',
  15529. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15530. },
  15531. calendarEl : {
  15532. sameDay : '[Σήμερα {}] LT',
  15533. nextDay : '[Αύριο {}] LT',
  15534. nextWeek : 'dddd [{}] LT',
  15535. lastDay : '[Χθες {}] LT',
  15536. lastWeek : function () {
  15537. switch (this.day()) {
  15538. case 6:
  15539. return '[το προηγούμενο] dddd [{}] LT';
  15540. default:
  15541. return '[την προηγούμενη] dddd [{}] LT';
  15542. }
  15543. },
  15544. sameElse : 'L'
  15545. },
  15546. calendar : function (key, mom) {
  15547. var output = this._calendarEl[key],
  15548. hours = mom && mom.hours();
  15549. if (isFunction(output)) {
  15550. output = output.apply(mom);
  15551. }
  15552. return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
  15553. },
  15554. relativeTime : {
  15555. future : 'σε %s',
  15556. past : '%s πριν',
  15557. s : 'λίγα δευτερόλεπτα',
  15558. m : 'ένα λεπτό',
  15559. mm : '%d λεπτά',
  15560. h : 'μία ώρα',
  15561. hh : '%d ώρες',
  15562. d : 'μία μέρα',
  15563. dd : '%d μέρες',
  15564. M : 'ένας μήνας',
  15565. MM : '%d μήνες',
  15566. y : 'ένας χρόνος',
  15567. yy : '%d χρόνια'
  15568. },
  15569. ordinalParse: /\d{1,2}η/,
  15570. ordinal: '%dη',
  15571. week : {
  15572. dow : 1, // Monday is the first day of the week.
  15573. doy : 4 // The week that contains Jan 4st is the first week of the year.
  15574. }
  15575. });
  15576. return el;
  15577. })));
  15578. /***/ }),
  15579. /* 28 */
  15580. /***/ (function(module, exports, __webpack_require__) {
  15581. //! moment.js locale configuration
  15582. //! locale : English (Australia) [en-au]
  15583. //! author : Jared Morse : https://github.com/jarcoal
  15584. ;(function (global, factory) {
  15585. true ? factory(__webpack_require__(0)) :
  15586. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15587. factory(global.moment)
  15588. }(this, (function (moment) { 'use strict';
  15589. var enAu = moment.defineLocale('en-au', {
  15590. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15591. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15592. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15593. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15594. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15595. longDateFormat : {
  15596. LT : 'h:mm A',
  15597. LTS : 'h:mm:ss A',
  15598. L : 'DD/MM/YYYY',
  15599. LL : 'D MMMM YYYY',
  15600. LLL : 'D MMMM YYYY h:mm A',
  15601. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15602. },
  15603. calendar : {
  15604. sameDay : '[Today at] LT',
  15605. nextDay : '[Tomorrow at] LT',
  15606. nextWeek : 'dddd [at] LT',
  15607. lastDay : '[Yesterday at] LT',
  15608. lastWeek : '[Last] dddd [at] LT',
  15609. sameElse : 'L'
  15610. },
  15611. relativeTime : {
  15612. future : 'in %s',
  15613. past : '%s ago',
  15614. s : 'a few seconds',
  15615. m : 'a minute',
  15616. mm : '%d minutes',
  15617. h : 'an hour',
  15618. hh : '%d hours',
  15619. d : 'a day',
  15620. dd : '%d days',
  15621. M : 'a month',
  15622. MM : '%d months',
  15623. y : 'a year',
  15624. yy : '%d years'
  15625. },
  15626. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15627. ordinal : function (number) {
  15628. var b = number % 10,
  15629. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15630. (b === 1) ? 'st' :
  15631. (b === 2) ? 'nd' :
  15632. (b === 3) ? 'rd' : 'th';
  15633. return number + output;
  15634. },
  15635. week : {
  15636. dow : 1, // Monday is the first day of the week.
  15637. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15638. }
  15639. });
  15640. return enAu;
  15641. })));
  15642. /***/ }),
  15643. /* 29 */
  15644. /***/ (function(module, exports, __webpack_require__) {
  15645. //! moment.js locale configuration
  15646. //! locale : English (Canada) [en-ca]
  15647. //! author : Jonathan Abourbih : https://github.com/jonbca
  15648. ;(function (global, factory) {
  15649. true ? factory(__webpack_require__(0)) :
  15650. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15651. factory(global.moment)
  15652. }(this, (function (moment) { 'use strict';
  15653. var enCa = moment.defineLocale('en-ca', {
  15654. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15655. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15656. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15657. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15658. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15659. longDateFormat : {
  15660. LT : 'h:mm A',
  15661. LTS : 'h:mm:ss A',
  15662. L : 'YYYY-MM-DD',
  15663. LL : 'MMMM D, YYYY',
  15664. LLL : 'MMMM D, YYYY h:mm A',
  15665. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  15666. },
  15667. calendar : {
  15668. sameDay : '[Today at] LT',
  15669. nextDay : '[Tomorrow at] LT',
  15670. nextWeek : 'dddd [at] LT',
  15671. lastDay : '[Yesterday at] LT',
  15672. lastWeek : '[Last] dddd [at] LT',
  15673. sameElse : 'L'
  15674. },
  15675. relativeTime : {
  15676. future : 'in %s',
  15677. past : '%s ago',
  15678. s : 'a few seconds',
  15679. m : 'a minute',
  15680. mm : '%d minutes',
  15681. h : 'an hour',
  15682. hh : '%d hours',
  15683. d : 'a day',
  15684. dd : '%d days',
  15685. M : 'a month',
  15686. MM : '%d months',
  15687. y : 'a year',
  15688. yy : '%d years'
  15689. },
  15690. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15691. ordinal : function (number) {
  15692. var b = number % 10,
  15693. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15694. (b === 1) ? 'st' :
  15695. (b === 2) ? 'nd' :
  15696. (b === 3) ? 'rd' : 'th';
  15697. return number + output;
  15698. }
  15699. });
  15700. return enCa;
  15701. })));
  15702. /***/ }),
  15703. /* 30 */
  15704. /***/ (function(module, exports, __webpack_require__) {
  15705. //! moment.js locale configuration
  15706. //! locale : English (United Kingdom) [en-gb]
  15707. //! author : Chris Gedrim : https://github.com/chrisgedrim
  15708. ;(function (global, factory) {
  15709. true ? factory(__webpack_require__(0)) :
  15710. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15711. factory(global.moment)
  15712. }(this, (function (moment) { 'use strict';
  15713. var enGb = moment.defineLocale('en-gb', {
  15714. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15715. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15716. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15717. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15718. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15719. longDateFormat : {
  15720. LT : 'HH:mm',
  15721. LTS : 'HH:mm:ss',
  15722. L : 'DD/MM/YYYY',
  15723. LL : 'D MMMM YYYY',
  15724. LLL : 'D MMMM YYYY HH:mm',
  15725. LLLL : 'dddd, D MMMM YYYY HH:mm'
  15726. },
  15727. calendar : {
  15728. sameDay : '[Today at] LT',
  15729. nextDay : '[Tomorrow at] LT',
  15730. nextWeek : 'dddd [at] LT',
  15731. lastDay : '[Yesterday at] LT',
  15732. lastWeek : '[Last] dddd [at] LT',
  15733. sameElse : 'L'
  15734. },
  15735. relativeTime : {
  15736. future : 'in %s',
  15737. past : '%s ago',
  15738. s : 'a few seconds',
  15739. m : 'a minute',
  15740. mm : '%d minutes',
  15741. h : 'an hour',
  15742. hh : '%d hours',
  15743. d : 'a day',
  15744. dd : '%d days',
  15745. M : 'a month',
  15746. MM : '%d months',
  15747. y : 'a year',
  15748. yy : '%d years'
  15749. },
  15750. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15751. ordinal : function (number) {
  15752. var b = number % 10,
  15753. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15754. (b === 1) ? 'st' :
  15755. (b === 2) ? 'nd' :
  15756. (b === 3) ? 'rd' : 'th';
  15757. return number + output;
  15758. },
  15759. week : {
  15760. dow : 1, // Monday is the first day of the week.
  15761. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15762. }
  15763. });
  15764. return enGb;
  15765. })));
  15766. /***/ }),
  15767. /* 31 */
  15768. /***/ (function(module, exports, __webpack_require__) {
  15769. //! moment.js locale configuration
  15770. //! locale : English (Ireland) [en-ie]
  15771. //! author : Chris Cartlidge : https://github.com/chriscartlidge
  15772. ;(function (global, factory) {
  15773. true ? factory(__webpack_require__(0)) :
  15774. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15775. factory(global.moment)
  15776. }(this, (function (moment) { 'use strict';
  15777. var enIe = moment.defineLocale('en-ie', {
  15778. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15779. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15780. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15781. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15782. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15783. longDateFormat : {
  15784. LT : 'HH:mm',
  15785. LTS : 'HH:mm:ss',
  15786. L : 'DD-MM-YYYY',
  15787. LL : 'D MMMM YYYY',
  15788. LLL : 'D MMMM YYYY HH:mm',
  15789. LLLL : 'dddd D MMMM YYYY HH:mm'
  15790. },
  15791. calendar : {
  15792. sameDay : '[Today at] LT',
  15793. nextDay : '[Tomorrow at] LT',
  15794. nextWeek : 'dddd [at] LT',
  15795. lastDay : '[Yesterday at] LT',
  15796. lastWeek : '[Last] dddd [at] LT',
  15797. sameElse : 'L'
  15798. },
  15799. relativeTime : {
  15800. future : 'in %s',
  15801. past : '%s ago',
  15802. s : 'a few seconds',
  15803. m : 'a minute',
  15804. mm : '%d minutes',
  15805. h : 'an hour',
  15806. hh : '%d hours',
  15807. d : 'a day',
  15808. dd : '%d days',
  15809. M : 'a month',
  15810. MM : '%d months',
  15811. y : 'a year',
  15812. yy : '%d years'
  15813. },
  15814. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15815. ordinal : function (number) {
  15816. var b = number % 10,
  15817. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15818. (b === 1) ? 'st' :
  15819. (b === 2) ? 'nd' :
  15820. (b === 3) ? 'rd' : 'th';
  15821. return number + output;
  15822. },
  15823. week : {
  15824. dow : 1, // Monday is the first day of the week.
  15825. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15826. }
  15827. });
  15828. return enIe;
  15829. })));
  15830. /***/ }),
  15831. /* 32 */
  15832. /***/ (function(module, exports, __webpack_require__) {
  15833. //! moment.js locale configuration
  15834. //! locale : English (New Zealand) [en-nz]
  15835. //! author : Luke McGregor : https://github.com/lukemcgregor
  15836. ;(function (global, factory) {
  15837. true ? factory(__webpack_require__(0)) :
  15838. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15839. factory(global.moment)
  15840. }(this, (function (moment) { 'use strict';
  15841. var enNz = moment.defineLocale('en-nz', {
  15842. months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  15843. monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  15844. weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  15845. weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  15846. weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  15847. longDateFormat : {
  15848. LT : 'h:mm A',
  15849. LTS : 'h:mm:ss A',
  15850. L : 'DD/MM/YYYY',
  15851. LL : 'D MMMM YYYY',
  15852. LLL : 'D MMMM YYYY h:mm A',
  15853. LLLL : 'dddd, D MMMM YYYY h:mm A'
  15854. },
  15855. calendar : {
  15856. sameDay : '[Today at] LT',
  15857. nextDay : '[Tomorrow at] LT',
  15858. nextWeek : 'dddd [at] LT',
  15859. lastDay : '[Yesterday at] LT',
  15860. lastWeek : '[Last] dddd [at] LT',
  15861. sameElse : 'L'
  15862. },
  15863. relativeTime : {
  15864. future : 'in %s',
  15865. past : '%s ago',
  15866. s : 'a few seconds',
  15867. m : 'a minute',
  15868. mm : '%d minutes',
  15869. h : 'an hour',
  15870. hh : '%d hours',
  15871. d : 'a day',
  15872. dd : '%d days',
  15873. M : 'a month',
  15874. MM : '%d months',
  15875. y : 'a year',
  15876. yy : '%d years'
  15877. },
  15878. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  15879. ordinal : function (number) {
  15880. var b = number % 10,
  15881. output = (~~(number % 100 / 10) === 1) ? 'th' :
  15882. (b === 1) ? 'st' :
  15883. (b === 2) ? 'nd' :
  15884. (b === 3) ? 'rd' : 'th';
  15885. return number + output;
  15886. },
  15887. week : {
  15888. dow : 1, // Monday is the first day of the week.
  15889. doy : 4 // The week that contains Jan 4th is the first week of the year.
  15890. }
  15891. });
  15892. return enNz;
  15893. })));
  15894. /***/ }),
  15895. /* 33 */
  15896. /***/ (function(module, exports, __webpack_require__) {
  15897. //! moment.js locale configuration
  15898. //! locale : Esperanto [eo]
  15899. //! author : Colin Dean : https://github.com/colindean
  15900. //! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko.
  15901. //! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni!
  15902. ;(function (global, factory) {
  15903. true ? factory(__webpack_require__(0)) :
  15904. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15905. factory(global.moment)
  15906. }(this, (function (moment) { 'use strict';
  15907. var eo = moment.defineLocale('eo', {
  15908. months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
  15909. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
  15910. weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'),
  15911. weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'),
  15912. weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'),
  15913. longDateFormat : {
  15914. LT : 'HH:mm',
  15915. LTS : 'HH:mm:ss',
  15916. L : 'YYYY-MM-DD',
  15917. LL : 'D[-an de] MMMM, YYYY',
  15918. LLL : 'D[-an de] MMMM, YYYY HH:mm',
  15919. LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm'
  15920. },
  15921. meridiemParse: /[ap]\.t\.m/i,
  15922. isPM: function (input) {
  15923. return input.charAt(0).toLowerCase() === 'p';
  15924. },
  15925. meridiem : function (hours, minutes, isLower) {
  15926. if (hours > 11) {
  15927. return isLower ? 'p.t.m.' : 'P.T.M.';
  15928. } else {
  15929. return isLower ? 'a.t.m.' : 'A.T.M.';
  15930. }
  15931. },
  15932. calendar : {
  15933. sameDay : '[Hodiaŭ je] LT',
  15934. nextDay : '[Morgaŭ je] LT',
  15935. nextWeek : 'dddd [je] LT',
  15936. lastDay : '[Hieraŭ je] LT',
  15937. lastWeek : '[pasinta] dddd [je] LT',
  15938. sameElse : 'L'
  15939. },
  15940. relativeTime : {
  15941. future : 'je %s',
  15942. past : 'antaŭ %s',
  15943. s : 'sekundoj',
  15944. m : 'minuto',
  15945. mm : '%d minutoj',
  15946. h : 'horo',
  15947. hh : '%d horoj',
  15948. d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
  15949. dd : '%d tagoj',
  15950. M : 'monato',
  15951. MM : '%d monatoj',
  15952. y : 'jaro',
  15953. yy : '%d jaroj'
  15954. },
  15955. ordinalParse: /\d{1,2}a/,
  15956. ordinal : '%da',
  15957. week : {
  15958. dow : 1, // Monday is the first day of the week.
  15959. doy : 7 // The week that contains Jan 1st is the first week of the year.
  15960. }
  15961. });
  15962. return eo;
  15963. })));
  15964. /***/ }),
  15965. /* 34 */
  15966. /***/ (function(module, exports, __webpack_require__) {
  15967. //! moment.js locale configuration
  15968. //! locale : Spanish (Dominican Republic) [es-do]
  15969. ;(function (global, factory) {
  15970. true ? factory(__webpack_require__(0)) :
  15971. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  15972. factory(global.moment)
  15973. }(this, (function (moment) { 'use strict';
  15974. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  15975. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  15976. var esDo = moment.defineLocale('es-do', {
  15977. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  15978. monthsShort : function (m, format) {
  15979. if (/-MMM-/.test(format)) {
  15980. return monthsShort[m.month()];
  15981. } else {
  15982. return monthsShortDot[m.month()];
  15983. }
  15984. },
  15985. monthsParseExact : true,
  15986. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  15987. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  15988. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  15989. weekdaysParseExact : true,
  15990. longDateFormat : {
  15991. LT : 'h:mm A',
  15992. LTS : 'h:mm:ss A',
  15993. L : 'DD/MM/YYYY',
  15994. LL : 'D [de] MMMM [de] YYYY',
  15995. LLL : 'D [de] MMMM [de] YYYY h:mm A',
  15996. LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A'
  15997. },
  15998. calendar : {
  15999. sameDay : function () {
  16000. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16001. },
  16002. nextDay : function () {
  16003. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16004. },
  16005. nextWeek : function () {
  16006. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16007. },
  16008. lastDay : function () {
  16009. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16010. },
  16011. lastWeek : function () {
  16012. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16013. },
  16014. sameElse : 'L'
  16015. },
  16016. relativeTime : {
  16017. future : 'en %s',
  16018. past : 'hace %s',
  16019. s : 'unos segundos',
  16020. m : 'un minuto',
  16021. mm : '%d minutos',
  16022. h : 'una hora',
  16023. hh : '%d horas',
  16024. d : 'un día',
  16025. dd : '%d días',
  16026. M : 'un mes',
  16027. MM : '%d meses',
  16028. y : 'un año',
  16029. yy : '%d años'
  16030. },
  16031. ordinalParse : /\d{1,2}º/,
  16032. ordinal : '%dº',
  16033. week : {
  16034. dow : 1, // Monday is the first day of the week.
  16035. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16036. }
  16037. });
  16038. return esDo;
  16039. })));
  16040. /***/ }),
  16041. /* 35 */
  16042. /***/ (function(module, exports, __webpack_require__) {
  16043. //! moment.js locale configuration
  16044. //! locale : Spanish [es]
  16045. //! author : Julio Napurí : https://github.com/julionc
  16046. ;(function (global, factory) {
  16047. true ? factory(__webpack_require__(0)) :
  16048. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16049. factory(global.moment)
  16050. }(this, (function (moment) { 'use strict';
  16051. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  16052. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  16053. var es = moment.defineLocale('es', {
  16054. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  16055. monthsShort : function (m, format) {
  16056. if (/-MMM-/.test(format)) {
  16057. return monthsShort[m.month()];
  16058. } else {
  16059. return monthsShortDot[m.month()];
  16060. }
  16061. },
  16062. monthsParseExact : true,
  16063. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  16064. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  16065. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  16066. weekdaysParseExact : true,
  16067. longDateFormat : {
  16068. LT : 'H:mm',
  16069. LTS : 'H:mm:ss',
  16070. L : 'DD/MM/YYYY',
  16071. LL : 'D [de] MMMM [de] YYYY',
  16072. LLL : 'D [de] MMMM [de] YYYY H:mm',
  16073. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  16074. },
  16075. calendar : {
  16076. sameDay : function () {
  16077. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16078. },
  16079. nextDay : function () {
  16080. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16081. },
  16082. nextWeek : function () {
  16083. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16084. },
  16085. lastDay : function () {
  16086. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16087. },
  16088. lastWeek : function () {
  16089. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  16090. },
  16091. sameElse : 'L'
  16092. },
  16093. relativeTime : {
  16094. future : 'en %s',
  16095. past : 'hace %s',
  16096. s : 'unos segundos',
  16097. m : 'un minuto',
  16098. mm : '%d minutos',
  16099. h : 'una hora',
  16100. hh : '%d horas',
  16101. d : 'un día',
  16102. dd : '%d días',
  16103. M : 'un mes',
  16104. MM : '%d meses',
  16105. y : 'un año',
  16106. yy : '%d años'
  16107. },
  16108. ordinalParse : /\d{1,2}º/,
  16109. ordinal : '%dº',
  16110. week : {
  16111. dow : 1, // Monday is the first day of the week.
  16112. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16113. }
  16114. });
  16115. return es;
  16116. })));
  16117. /***/ }),
  16118. /* 36 */
  16119. /***/ (function(module, exports, __webpack_require__) {
  16120. //! moment.js locale configuration
  16121. //! locale : Estonian [et]
  16122. //! author : Henry Kehlmann : https://github.com/madhenry
  16123. //! improvements : Illimar Tambek : https://github.com/ragulka
  16124. ;(function (global, factory) {
  16125. true ? factory(__webpack_require__(0)) :
  16126. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16127. factory(global.moment)
  16128. }(this, (function (moment) { 'use strict';
  16129. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  16130. var format = {
  16131. 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  16132. 'm' : ['ühe minuti', 'üks minut'],
  16133. 'mm': [number + ' minuti', number + ' minutit'],
  16134. 'h' : ['ühe tunni', 'tund aega', 'üks tund'],
  16135. 'hh': [number + ' tunni', number + ' tundi'],
  16136. 'd' : ['ühe päeva', 'üks päev'],
  16137. 'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
  16138. 'MM': [number + ' kuu', number + ' kuud'],
  16139. 'y' : ['ühe aasta', 'aasta', 'üks aasta'],
  16140. 'yy': [number + ' aasta', number + ' aastat']
  16141. };
  16142. if (withoutSuffix) {
  16143. return format[key][2] ? format[key][2] : format[key][1];
  16144. }
  16145. return isFuture ? format[key][0] : format[key][1];
  16146. }
  16147. var et = moment.defineLocale('et', {
  16148. months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
  16149. monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
  16150. weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
  16151. weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
  16152. weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),
  16153. longDateFormat : {
  16154. LT : 'H:mm',
  16155. LTS : 'H:mm:ss',
  16156. L : 'DD.MM.YYYY',
  16157. LL : 'D. MMMM YYYY',
  16158. LLL : 'D. MMMM YYYY H:mm',
  16159. LLLL : 'dddd, D. MMMM YYYY H:mm'
  16160. },
  16161. calendar : {
  16162. sameDay : '[Täna,] LT',
  16163. nextDay : '[Homme,] LT',
  16164. nextWeek : '[Järgmine] dddd LT',
  16165. lastDay : '[Eile,] LT',
  16166. lastWeek : '[Eelmine] dddd LT',
  16167. sameElse : 'L'
  16168. },
  16169. relativeTime : {
  16170. future : '%s pärast',
  16171. past : '%s tagasi',
  16172. s : processRelativeTime,
  16173. m : processRelativeTime,
  16174. mm : processRelativeTime,
  16175. h : processRelativeTime,
  16176. hh : processRelativeTime,
  16177. d : processRelativeTime,
  16178. dd : '%d päeva',
  16179. M : processRelativeTime,
  16180. MM : processRelativeTime,
  16181. y : processRelativeTime,
  16182. yy : processRelativeTime
  16183. },
  16184. ordinalParse: /\d{1,2}\./,
  16185. ordinal : '%d.',
  16186. week : {
  16187. dow : 1, // Monday is the first day of the week.
  16188. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16189. }
  16190. });
  16191. return et;
  16192. })));
  16193. /***/ }),
  16194. /* 37 */
  16195. /***/ (function(module, exports, __webpack_require__) {
  16196. //! moment.js locale configuration
  16197. //! locale : Basque [eu]
  16198. //! author : Eneko Illarramendi : https://github.com/eillarra
  16199. ;(function (global, factory) {
  16200. true ? factory(__webpack_require__(0)) :
  16201. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16202. factory(global.moment)
  16203. }(this, (function (moment) { 'use strict';
  16204. var eu = moment.defineLocale('eu', {
  16205. months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
  16206. monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
  16207. monthsParseExact : true,
  16208. weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
  16209. weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
  16210. weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
  16211. weekdaysParseExact : true,
  16212. longDateFormat : {
  16213. LT : 'HH:mm',
  16214. LTS : 'HH:mm:ss',
  16215. L : 'YYYY-MM-DD',
  16216. LL : 'YYYY[ko] MMMM[ren] D[a]',
  16217. LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  16218. LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  16219. l : 'YYYY-M-D',
  16220. ll : 'YYYY[ko] MMM D[a]',
  16221. lll : 'YYYY[ko] MMM D[a] HH:mm',
  16222. llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
  16223. },
  16224. calendar : {
  16225. sameDay : '[gaur] LT[etan]',
  16226. nextDay : '[bihar] LT[etan]',
  16227. nextWeek : 'dddd LT[etan]',
  16228. lastDay : '[atzo] LT[etan]',
  16229. lastWeek : '[aurreko] dddd LT[etan]',
  16230. sameElse : 'L'
  16231. },
  16232. relativeTime : {
  16233. future : '%s barru',
  16234. past : 'duela %s',
  16235. s : 'segundo batzuk',
  16236. m : 'minutu bat',
  16237. mm : '%d minutu',
  16238. h : 'ordu bat',
  16239. hh : '%d ordu',
  16240. d : 'egun bat',
  16241. dd : '%d egun',
  16242. M : 'hilabete bat',
  16243. MM : '%d hilabete',
  16244. y : 'urte bat',
  16245. yy : '%d urte'
  16246. },
  16247. ordinalParse: /\d{1,2}\./,
  16248. ordinal : '%d.',
  16249. week : {
  16250. dow : 1, // Monday is the first day of the week.
  16251. doy : 7 // The week that contains Jan 1st is the first week of the year.
  16252. }
  16253. });
  16254. return eu;
  16255. })));
  16256. /***/ }),
  16257. /* 38 */
  16258. /***/ (function(module, exports, __webpack_require__) {
  16259. //! moment.js locale configuration
  16260. //! locale : Persian [fa]
  16261. //! author : Ebrahim Byagowi : https://github.com/ebraminio
  16262. ;(function (global, factory) {
  16263. true ? factory(__webpack_require__(0)) :
  16264. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16265. factory(global.moment)
  16266. }(this, (function (moment) { 'use strict';
  16267. var symbolMap = {
  16268. '1': '۱',
  16269. '2': '۲',
  16270. '3': '۳',
  16271. '4': '۴',
  16272. '5': '۵',
  16273. '6': '۶',
  16274. '7': '۷',
  16275. '8': '۸',
  16276. '9': '۹',
  16277. '0': '۰'
  16278. };
  16279. var numberMap = {
  16280. '۱': '1',
  16281. '۲': '2',
  16282. '۳': '3',
  16283. '۴': '4',
  16284. '۵': '5',
  16285. '۶': '6',
  16286. '۷': '7',
  16287. '۸': '8',
  16288. '۹': '9',
  16289. '۰': '0'
  16290. };
  16291. var fa = moment.defineLocale('fa', {
  16292. months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  16293. monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
  16294. weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  16295. weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
  16296. weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
  16297. weekdaysParseExact : true,
  16298. longDateFormat : {
  16299. LT : 'HH:mm',
  16300. LTS : 'HH:mm:ss',
  16301. L : 'DD/MM/YYYY',
  16302. LL : 'D MMMM YYYY',
  16303. LLL : 'D MMMM YYYY HH:mm',
  16304. LLLL : 'dddd, D MMMM YYYY HH:mm'
  16305. },
  16306. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  16307. isPM: function (input) {
  16308. return /بعد از ظهر/.test(input);
  16309. },
  16310. meridiem : function (hour, minute, isLower) {
  16311. if (hour < 12) {
  16312. return 'قبل از ظهر';
  16313. } else {
  16314. return 'بعد از ظهر';
  16315. }
  16316. },
  16317. calendar : {
  16318. sameDay : '[امروز ساعت] LT',
  16319. nextDay : '[فردا ساعت] LT',
  16320. nextWeek : 'dddd [ساعت] LT',
  16321. lastDay : '[دیروز ساعت] LT',
  16322. lastWeek : 'dddd [پیش] [ساعت] LT',
  16323. sameElse : 'L'
  16324. },
  16325. relativeTime : {
  16326. future : 'در %s',
  16327. past : '%s پیش',
  16328. s : 'چندین ثانیه',
  16329. m : 'یک دقیقه',
  16330. mm : '%d دقیقه',
  16331. h : 'یک ساعت',
  16332. hh : '%d ساعت',
  16333. d : 'یک روز',
  16334. dd : '%d روز',
  16335. M : 'یک ماه',
  16336. MM : '%d ماه',
  16337. y : 'یک سال',
  16338. yy : '%d سال'
  16339. },
  16340. preparse: function (string) {
  16341. return string.replace(/[۰-۹]/g, function (match) {
  16342. return numberMap[match];
  16343. }).replace(/،/g, ',');
  16344. },
  16345. postformat: function (string) {
  16346. return string.replace(/\d/g, function (match) {
  16347. return symbolMap[match];
  16348. }).replace(/,/g, '،');
  16349. },
  16350. ordinalParse: /\d{1,2}م/,
  16351. ordinal : '%dم',
  16352. week : {
  16353. dow : 6, // Saturday is the first day of the week.
  16354. doy : 12 // The week that contains Jan 1st is the first week of the year.
  16355. }
  16356. });
  16357. return fa;
  16358. })));
  16359. /***/ }),
  16360. /* 39 */
  16361. /***/ (function(module, exports, __webpack_require__) {
  16362. //! moment.js locale configuration
  16363. //! locale : Finnish [fi]
  16364. //! author : Tarmo Aidantausta : https://github.com/bleadof
  16365. ;(function (global, factory) {
  16366. true ? factory(__webpack_require__(0)) :
  16367. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16368. factory(global.moment)
  16369. }(this, (function (moment) { 'use strict';
  16370. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' ');
  16371. var numbersFuture = [
  16372. 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
  16373. numbersPast[7], numbersPast[8], numbersPast[9]
  16374. ];
  16375. function translate(number, withoutSuffix, key, isFuture) {
  16376. var result = '';
  16377. switch (key) {
  16378. case 's':
  16379. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  16380. case 'm':
  16381. return isFuture ? 'minuutin' : 'minuutti';
  16382. case 'mm':
  16383. result = isFuture ? 'minuutin' : 'minuuttia';
  16384. break;
  16385. case 'h':
  16386. return isFuture ? 'tunnin' : 'tunti';
  16387. case 'hh':
  16388. result = isFuture ? 'tunnin' : 'tuntia';
  16389. break;
  16390. case 'd':
  16391. return isFuture ? 'päivän' : 'päivä';
  16392. case 'dd':
  16393. result = isFuture ? 'päivän' : 'päivää';
  16394. break;
  16395. case 'M':
  16396. return isFuture ? 'kuukauden' : 'kuukausi';
  16397. case 'MM':
  16398. result = isFuture ? 'kuukauden' : 'kuukautta';
  16399. break;
  16400. case 'y':
  16401. return isFuture ? 'vuoden' : 'vuosi';
  16402. case 'yy':
  16403. result = isFuture ? 'vuoden' : 'vuotta';
  16404. break;
  16405. }
  16406. result = verbalNumber(number, isFuture) + ' ' + result;
  16407. return result;
  16408. }
  16409. function verbalNumber(number, isFuture) {
  16410. return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
  16411. }
  16412. var fi = moment.defineLocale('fi', {
  16413. months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
  16414. monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
  16415. weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
  16416. weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
  16417. weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
  16418. longDateFormat : {
  16419. LT : 'HH.mm',
  16420. LTS : 'HH.mm.ss',
  16421. L : 'DD.MM.YYYY',
  16422. LL : 'Do MMMM[ta] YYYY',
  16423. LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
  16424. LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  16425. l : 'D.M.YYYY',
  16426. ll : 'Do MMM YYYY',
  16427. lll : 'Do MMM YYYY, [klo] HH.mm',
  16428. llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
  16429. },
  16430. calendar : {
  16431. sameDay : '[tänään] [klo] LT',
  16432. nextDay : '[huomenna] [klo] LT',
  16433. nextWeek : 'dddd [klo] LT',
  16434. lastDay : '[eilen] [klo] LT',
  16435. lastWeek : '[viime] dddd[na] [klo] LT',
  16436. sameElse : 'L'
  16437. },
  16438. relativeTime : {
  16439. future : '%s päästä',
  16440. past : '%s sitten',
  16441. s : translate,
  16442. m : translate,
  16443. mm : translate,
  16444. h : translate,
  16445. hh : translate,
  16446. d : translate,
  16447. dd : translate,
  16448. M : translate,
  16449. MM : translate,
  16450. y : translate,
  16451. yy : translate
  16452. },
  16453. ordinalParse: /\d{1,2}\./,
  16454. ordinal : '%d.',
  16455. week : {
  16456. dow : 1, // Monday is the first day of the week.
  16457. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16458. }
  16459. });
  16460. return fi;
  16461. })));
  16462. /***/ }),
  16463. /* 40 */
  16464. /***/ (function(module, exports, __webpack_require__) {
  16465. //! moment.js locale configuration
  16466. //! locale : Faroese [fo]
  16467. //! author : Ragnar Johannesen : https://github.com/ragnar123
  16468. ;(function (global, factory) {
  16469. true ? factory(__webpack_require__(0)) :
  16470. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16471. factory(global.moment)
  16472. }(this, (function (moment) { 'use strict';
  16473. var fo = moment.defineLocale('fo', {
  16474. months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  16475. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  16476. weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
  16477. weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  16478. weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
  16479. longDateFormat : {
  16480. LT : 'HH:mm',
  16481. LTS : 'HH:mm:ss',
  16482. L : 'DD/MM/YYYY',
  16483. LL : 'D MMMM YYYY',
  16484. LLL : 'D MMMM YYYY HH:mm',
  16485. LLLL : 'dddd D. MMMM, YYYY HH:mm'
  16486. },
  16487. calendar : {
  16488. sameDay : '[Í dag kl.] LT',
  16489. nextDay : '[Í morgin kl.] LT',
  16490. nextWeek : 'dddd [kl.] LT',
  16491. lastDay : '[Í gjár kl.] LT',
  16492. lastWeek : '[síðstu] dddd [kl] LT',
  16493. sameElse : 'L'
  16494. },
  16495. relativeTime : {
  16496. future : 'um %s',
  16497. past : '%s síðani',
  16498. s : 'fá sekund',
  16499. m : 'ein minutt',
  16500. mm : '%d minuttir',
  16501. h : 'ein tími',
  16502. hh : '%d tímar',
  16503. d : 'ein dagur',
  16504. dd : '%d dagar',
  16505. M : 'ein mánaði',
  16506. MM : '%d mánaðir',
  16507. y : 'eitt ár',
  16508. yy : '%d ár'
  16509. },
  16510. ordinalParse: /\d{1,2}\./,
  16511. ordinal : '%d.',
  16512. week : {
  16513. dow : 1, // Monday is the first day of the week.
  16514. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16515. }
  16516. });
  16517. return fo;
  16518. })));
  16519. /***/ }),
  16520. /* 41 */
  16521. /***/ (function(module, exports, __webpack_require__) {
  16522. //! moment.js locale configuration
  16523. //! locale : French (Canada) [fr-ca]
  16524. //! author : Jonathan Abourbih : https://github.com/jonbca
  16525. ;(function (global, factory) {
  16526. true ? factory(__webpack_require__(0)) :
  16527. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16528. factory(global.moment)
  16529. }(this, (function (moment) { 'use strict';
  16530. var frCa = moment.defineLocale('fr-ca', {
  16531. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16532. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16533. monthsParseExact : true,
  16534. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16535. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16536. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16537. weekdaysParseExact : true,
  16538. longDateFormat : {
  16539. LT : 'HH:mm',
  16540. LTS : 'HH:mm:ss',
  16541. L : 'YYYY-MM-DD',
  16542. LL : 'D MMMM YYYY',
  16543. LLL : 'D MMMM YYYY HH:mm',
  16544. LLLL : 'dddd D MMMM YYYY HH:mm'
  16545. },
  16546. calendar : {
  16547. sameDay: '[Aujourd\'hui à] LT',
  16548. nextDay: '[Demain à] LT',
  16549. nextWeek: 'dddd [à] LT',
  16550. lastDay: '[Hier à] LT',
  16551. lastWeek: 'dddd [dernier à] LT',
  16552. sameElse: 'L'
  16553. },
  16554. relativeTime : {
  16555. future : 'dans %s',
  16556. past : 'il y a %s',
  16557. s : 'quelques secondes',
  16558. m : 'une minute',
  16559. mm : '%d minutes',
  16560. h : 'une heure',
  16561. hh : '%d heures',
  16562. d : 'un jour',
  16563. dd : '%d jours',
  16564. M : 'un mois',
  16565. MM : '%d mois',
  16566. y : 'un an',
  16567. yy : '%d ans'
  16568. },
  16569. ordinalParse: /\d{1,2}(er|e)/,
  16570. ordinal : function (number) {
  16571. return number + (number === 1 ? 'er' : 'e');
  16572. }
  16573. });
  16574. return frCa;
  16575. })));
  16576. /***/ }),
  16577. /* 42 */
  16578. /***/ (function(module, exports, __webpack_require__) {
  16579. //! moment.js locale configuration
  16580. //! locale : French (Switzerland) [fr-ch]
  16581. //! author : Gaspard Bucher : https://github.com/gaspard
  16582. ;(function (global, factory) {
  16583. true ? factory(__webpack_require__(0)) :
  16584. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16585. factory(global.moment)
  16586. }(this, (function (moment) { 'use strict';
  16587. var frCh = moment.defineLocale('fr-ch', {
  16588. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16589. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16590. monthsParseExact : true,
  16591. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16592. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16593. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16594. weekdaysParseExact : true,
  16595. longDateFormat : {
  16596. LT : 'HH:mm',
  16597. LTS : 'HH:mm:ss',
  16598. L : 'DD.MM.YYYY',
  16599. LL : 'D MMMM YYYY',
  16600. LLL : 'D MMMM YYYY HH:mm',
  16601. LLLL : 'dddd D MMMM YYYY HH:mm'
  16602. },
  16603. calendar : {
  16604. sameDay: '[Aujourd\'hui à] LT',
  16605. nextDay: '[Demain à] LT',
  16606. nextWeek: 'dddd [à] LT',
  16607. lastDay: '[Hier à] LT',
  16608. lastWeek: 'dddd [dernier à] LT',
  16609. sameElse: 'L'
  16610. },
  16611. relativeTime : {
  16612. future : 'dans %s',
  16613. past : 'il y a %s',
  16614. s : 'quelques secondes',
  16615. m : 'une minute',
  16616. mm : '%d minutes',
  16617. h : 'une heure',
  16618. hh : '%d heures',
  16619. d : 'un jour',
  16620. dd : '%d jours',
  16621. M : 'un mois',
  16622. MM : '%d mois',
  16623. y : 'un an',
  16624. yy : '%d ans'
  16625. },
  16626. ordinalParse: /\d{1,2}(er|e)/,
  16627. ordinal : function (number) {
  16628. return number + (number === 1 ? 'er' : 'e');
  16629. },
  16630. week : {
  16631. dow : 1, // Monday is the first day of the week.
  16632. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16633. }
  16634. });
  16635. return frCh;
  16636. })));
  16637. /***/ }),
  16638. /* 43 */
  16639. /***/ (function(module, exports, __webpack_require__) {
  16640. //! moment.js locale configuration
  16641. //! locale : French [fr]
  16642. //! author : John Fischer : https://github.com/jfroffice
  16643. ;(function (global, factory) {
  16644. true ? factory(__webpack_require__(0)) :
  16645. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16646. factory(global.moment)
  16647. }(this, (function (moment) { 'use strict';
  16648. var fr = moment.defineLocale('fr', {
  16649. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  16650. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  16651. monthsParseExact : true,
  16652. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  16653. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  16654. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  16655. weekdaysParseExact : true,
  16656. longDateFormat : {
  16657. LT : 'HH:mm',
  16658. LTS : 'HH:mm:ss',
  16659. L : 'DD/MM/YYYY',
  16660. LL : 'D MMMM YYYY',
  16661. LLL : 'D MMMM YYYY HH:mm',
  16662. LLLL : 'dddd D MMMM YYYY HH:mm'
  16663. },
  16664. calendar : {
  16665. sameDay: '[Aujourd\'hui à] LT',
  16666. nextDay: '[Demain à] LT',
  16667. nextWeek: 'dddd [à] LT',
  16668. lastDay: '[Hier à] LT',
  16669. lastWeek: 'dddd [dernier à] LT',
  16670. sameElse: 'L'
  16671. },
  16672. relativeTime : {
  16673. future : 'dans %s',
  16674. past : 'il y a %s',
  16675. s : 'quelques secondes',
  16676. m : 'une minute',
  16677. mm : '%d minutes',
  16678. h : 'une heure',
  16679. hh : '%d heures',
  16680. d : 'un jour',
  16681. dd : '%d jours',
  16682. M : 'un mois',
  16683. MM : '%d mois',
  16684. y : 'un an',
  16685. yy : '%d ans'
  16686. },
  16687. ordinalParse: /\d{1,2}(er|)/,
  16688. ordinal : function (number) {
  16689. return number + (number === 1 ? 'er' : '');
  16690. },
  16691. week : {
  16692. dow : 1, // Monday is the first day of the week.
  16693. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16694. }
  16695. });
  16696. return fr;
  16697. })));
  16698. /***/ }),
  16699. /* 44 */
  16700. /***/ (function(module, exports, __webpack_require__) {
  16701. //! moment.js locale configuration
  16702. //! locale : Frisian [fy]
  16703. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  16704. ;(function (global, factory) {
  16705. true ? factory(__webpack_require__(0)) :
  16706. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16707. factory(global.moment)
  16708. }(this, (function (moment) { 'use strict';
  16709. var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_');
  16710. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
  16711. var fy = moment.defineLocale('fy', {
  16712. months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
  16713. monthsShort : function (m, format) {
  16714. if (/-MMM-/.test(format)) {
  16715. return monthsShortWithoutDots[m.month()];
  16716. } else {
  16717. return monthsShortWithDots[m.month()];
  16718. }
  16719. },
  16720. monthsParseExact : true,
  16721. weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
  16722. weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
  16723. weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  16724. weekdaysParseExact : true,
  16725. longDateFormat : {
  16726. LT : 'HH:mm',
  16727. LTS : 'HH:mm:ss',
  16728. L : 'DD-MM-YYYY',
  16729. LL : 'D MMMM YYYY',
  16730. LLL : 'D MMMM YYYY HH:mm',
  16731. LLLL : 'dddd D MMMM YYYY HH:mm'
  16732. },
  16733. calendar : {
  16734. sameDay: '[hjoed om] LT',
  16735. nextDay: '[moarn om] LT',
  16736. nextWeek: 'dddd [om] LT',
  16737. lastDay: '[juster om] LT',
  16738. lastWeek: '[ôfrûne] dddd [om] LT',
  16739. sameElse: 'L'
  16740. },
  16741. relativeTime : {
  16742. future : 'oer %s',
  16743. past : '%s lyn',
  16744. s : 'in pear sekonden',
  16745. m : 'ien minút',
  16746. mm : '%d minuten',
  16747. h : 'ien oere',
  16748. hh : '%d oeren',
  16749. d : 'ien dei',
  16750. dd : '%d dagen',
  16751. M : 'ien moanne',
  16752. MM : '%d moannen',
  16753. y : 'ien jier',
  16754. yy : '%d jierren'
  16755. },
  16756. ordinalParse: /\d{1,2}(ste|de)/,
  16757. ordinal : function (number) {
  16758. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  16759. },
  16760. week : {
  16761. dow : 1, // Monday is the first day of the week.
  16762. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16763. }
  16764. });
  16765. return fy;
  16766. })));
  16767. /***/ }),
  16768. /* 45 */
  16769. /***/ (function(module, exports, __webpack_require__) {
  16770. //! moment.js locale configuration
  16771. //! locale : Scottish Gaelic [gd]
  16772. //! author : Jon Ashdown : https://github.com/jonashdown
  16773. ;(function (global, factory) {
  16774. true ? factory(__webpack_require__(0)) :
  16775. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16776. factory(global.moment)
  16777. }(this, (function (moment) { 'use strict';
  16778. var months = [
  16779. 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'
  16780. ];
  16781. var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];
  16782. var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];
  16783. var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];
  16784. var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  16785. var gd = moment.defineLocale('gd', {
  16786. months : months,
  16787. monthsShort : monthsShort,
  16788. monthsParseExact : true,
  16789. weekdays : weekdays,
  16790. weekdaysShort : weekdaysShort,
  16791. weekdaysMin : weekdaysMin,
  16792. longDateFormat : {
  16793. LT : 'HH:mm',
  16794. LTS : 'HH:mm:ss',
  16795. L : 'DD/MM/YYYY',
  16796. LL : 'D MMMM YYYY',
  16797. LLL : 'D MMMM YYYY HH:mm',
  16798. LLLL : 'dddd, D MMMM YYYY HH:mm'
  16799. },
  16800. calendar : {
  16801. sameDay : '[An-diugh aig] LT',
  16802. nextDay : '[A-màireach aig] LT',
  16803. nextWeek : 'dddd [aig] LT',
  16804. lastDay : '[An-dè aig] LT',
  16805. lastWeek : 'dddd [seo chaidh] [aig] LT',
  16806. sameElse : 'L'
  16807. },
  16808. relativeTime : {
  16809. future : 'ann an %s',
  16810. past : 'bho chionn %s',
  16811. s : 'beagan diogan',
  16812. m : 'mionaid',
  16813. mm : '%d mionaidean',
  16814. h : 'uair',
  16815. hh : '%d uairean',
  16816. d : 'latha',
  16817. dd : '%d latha',
  16818. M : 'mìos',
  16819. MM : '%d mìosan',
  16820. y : 'bliadhna',
  16821. yy : '%d bliadhna'
  16822. },
  16823. ordinalParse : /\d{1,2}(d|na|mh)/,
  16824. ordinal : function (number) {
  16825. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  16826. return number + output;
  16827. },
  16828. week : {
  16829. dow : 1, // Monday is the first day of the week.
  16830. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16831. }
  16832. });
  16833. return gd;
  16834. })));
  16835. /***/ }),
  16836. /* 46 */
  16837. /***/ (function(module, exports, __webpack_require__) {
  16838. //! moment.js locale configuration
  16839. //! locale : Galician [gl]
  16840. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  16841. ;(function (global, factory) {
  16842. true ? factory(__webpack_require__(0)) :
  16843. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16844. factory(global.moment)
  16845. }(this, (function (moment) { 'use strict';
  16846. var gl = moment.defineLocale('gl', {
  16847. months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
  16848. monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
  16849. monthsParseExact: true,
  16850. weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  16851. weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  16852. weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  16853. weekdaysParseExact : true,
  16854. longDateFormat : {
  16855. LT : 'H:mm',
  16856. LTS : 'H:mm:ss',
  16857. L : 'DD/MM/YYYY',
  16858. LL : 'D [de] MMMM [de] YYYY',
  16859. LLL : 'D [de] MMMM [de] YYYY H:mm',
  16860. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  16861. },
  16862. calendar : {
  16863. sameDay : function () {
  16864. return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  16865. },
  16866. nextDay : function () {
  16867. return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  16868. },
  16869. nextWeek : function () {
  16870. return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  16871. },
  16872. lastDay : function () {
  16873. return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
  16874. },
  16875. lastWeek : function () {
  16876. return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  16877. },
  16878. sameElse : 'L'
  16879. },
  16880. relativeTime : {
  16881. future : function (str) {
  16882. if (str.indexOf('un') === 0) {
  16883. return 'n' + str;
  16884. }
  16885. return 'en ' + str;
  16886. },
  16887. past : 'hai %s',
  16888. s : 'uns segundos',
  16889. m : 'un minuto',
  16890. mm : '%d minutos',
  16891. h : 'unha hora',
  16892. hh : '%d horas',
  16893. d : 'un día',
  16894. dd : '%d días',
  16895. M : 'un mes',
  16896. MM : '%d meses',
  16897. y : 'un ano',
  16898. yy : '%d anos'
  16899. },
  16900. ordinalParse : /\d{1,2}º/,
  16901. ordinal : '%dº',
  16902. week : {
  16903. dow : 1, // Monday is the first day of the week.
  16904. doy : 4 // The week that contains Jan 4th is the first week of the year.
  16905. }
  16906. });
  16907. return gl;
  16908. })));
  16909. /***/ }),
  16910. /* 47 */
  16911. /***/ (function(module, exports, __webpack_require__) {
  16912. //! moment.js locale configuration
  16913. //! locale : Hebrew [he]
  16914. //! author : Tomer Cohen : https://github.com/tomer
  16915. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  16916. //! author : Tal Ater : https://github.com/TalAter
  16917. ;(function (global, factory) {
  16918. true ? factory(__webpack_require__(0)) :
  16919. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  16920. factory(global.moment)
  16921. }(this, (function (moment) { 'use strict';
  16922. var he = moment.defineLocale('he', {
  16923. months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
  16924. monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
  16925. weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  16926. weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  16927. weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  16928. longDateFormat : {
  16929. LT : 'HH:mm',
  16930. LTS : 'HH:mm:ss',
  16931. L : 'DD/MM/YYYY',
  16932. LL : 'D [ב]MMMM YYYY',
  16933. LLL : 'D [ב]MMMM YYYY HH:mm',
  16934. LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
  16935. l : 'D/M/YYYY',
  16936. ll : 'D MMM YYYY',
  16937. lll : 'D MMM YYYY HH:mm',
  16938. llll : 'ddd, D MMM YYYY HH:mm'
  16939. },
  16940. calendar : {
  16941. sameDay : '[היום ב־]LT',
  16942. nextDay : '[מחר ב־]LT',
  16943. nextWeek : 'dddd [בשעה] LT',
  16944. lastDay : '[אתמול ב־]LT',
  16945. lastWeek : '[ביום] dddd [האחרון בשעה] LT',
  16946. sameElse : 'L'
  16947. },
  16948. relativeTime : {
  16949. future : 'בעוד %s',
  16950. past : 'לפני %s',
  16951. s : 'מספר שניות',
  16952. m : 'דקה',
  16953. mm : '%d דקות',
  16954. h : 'שעה',
  16955. hh : function (number) {
  16956. if (number === 2) {
  16957. return 'שעתיים';
  16958. }
  16959. return number + ' שעות';
  16960. },
  16961. d : 'יום',
  16962. dd : function (number) {
  16963. if (number === 2) {
  16964. return 'יומיים';
  16965. }
  16966. return number + ' ימים';
  16967. },
  16968. M : 'חודש',
  16969. MM : function (number) {
  16970. if (number === 2) {
  16971. return 'חודשיים';
  16972. }
  16973. return number + ' חודשים';
  16974. },
  16975. y : 'שנה',
  16976. yy : function (number) {
  16977. if (number === 2) {
  16978. return 'שנתיים';
  16979. } else if (number % 10 === 0 && number !== 10) {
  16980. return number + ' שנה';
  16981. }
  16982. return number + ' שנים';
  16983. }
  16984. },
  16985. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  16986. isPM : function (input) {
  16987. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  16988. },
  16989. meridiem : function (hour, minute, isLower) {
  16990. if (hour < 5) {
  16991. return 'לפנות בוקר';
  16992. } else if (hour < 10) {
  16993. return 'בבוקר';
  16994. } else if (hour < 12) {
  16995. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  16996. } else if (hour < 18) {
  16997. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  16998. } else {
  16999. return 'בערב';
  17000. }
  17001. }
  17002. });
  17003. return he;
  17004. })));
  17005. /***/ }),
  17006. /* 48 */
  17007. /***/ (function(module, exports, __webpack_require__) {
  17008. //! moment.js locale configuration
  17009. //! locale : Hindi [hi]
  17010. //! author : Mayank Singhal : https://github.com/mayanksinghal
  17011. ;(function (global, factory) {
  17012. true ? factory(__webpack_require__(0)) :
  17013. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17014. factory(global.moment)
  17015. }(this, (function (moment) { 'use strict';
  17016. var symbolMap = {
  17017. '1': '१',
  17018. '2': '२',
  17019. '3': '३',
  17020. '4': '४',
  17021. '5': '५',
  17022. '6': '६',
  17023. '7': '७',
  17024. '8': '८',
  17025. '9': '९',
  17026. '0': '०'
  17027. };
  17028. var numberMap = {
  17029. '१': '1',
  17030. '२': '2',
  17031. '३': '3',
  17032. '४': '4',
  17033. '५': '5',
  17034. '६': '6',
  17035. '७': '7',
  17036. '८': '8',
  17037. '९': '9',
  17038. '०': '0'
  17039. };
  17040. var hi = moment.defineLocale('hi', {
  17041. months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
  17042. monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
  17043. monthsParseExact: true,
  17044. weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  17045. weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  17046. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  17047. longDateFormat : {
  17048. LT : 'A h:mm बजे',
  17049. LTS : 'A h:mm:ss बजे',
  17050. L : 'DD/MM/YYYY',
  17051. LL : 'D MMMM YYYY',
  17052. LLL : 'D MMMM YYYY, A h:mm बजे',
  17053. LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
  17054. },
  17055. calendar : {
  17056. sameDay : '[आज] LT',
  17057. nextDay : '[कल] LT',
  17058. nextWeek : 'dddd, LT',
  17059. lastDay : '[कल] LT',
  17060. lastWeek : '[पिछले] dddd, LT',
  17061. sameElse : 'L'
  17062. },
  17063. relativeTime : {
  17064. future : '%s में',
  17065. past : '%s पहले',
  17066. s : 'कुछ ही क्षण',
  17067. m : 'एक मिनट',
  17068. mm : '%d मिनट',
  17069. h : 'एक घंटा',
  17070. hh : '%d घंटे',
  17071. d : 'एक दिन',
  17072. dd : '%d दिन',
  17073. M : 'एक महीने',
  17074. MM : '%d महीने',
  17075. y : 'एक वर्ष',
  17076. yy : '%d वर्ष'
  17077. },
  17078. preparse: function (string) {
  17079. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  17080. return numberMap[match];
  17081. });
  17082. },
  17083. postformat: function (string) {
  17084. return string.replace(/\d/g, function (match) {
  17085. return symbolMap[match];
  17086. });
  17087. },
  17088. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  17089. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  17090. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  17091. meridiemHour : function (hour, meridiem) {
  17092. if (hour === 12) {
  17093. hour = 0;
  17094. }
  17095. if (meridiem === 'रात') {
  17096. return hour < 4 ? hour : hour + 12;
  17097. } else if (meridiem === 'सुबह') {
  17098. return hour;
  17099. } else if (meridiem === 'दोपहर') {
  17100. return hour >= 10 ? hour : hour + 12;
  17101. } else if (meridiem === 'शाम') {
  17102. return hour + 12;
  17103. }
  17104. },
  17105. meridiem : function (hour, minute, isLower) {
  17106. if (hour < 4) {
  17107. return 'रात';
  17108. } else if (hour < 10) {
  17109. return 'सुबह';
  17110. } else if (hour < 17) {
  17111. return 'दोपहर';
  17112. } else if (hour < 20) {
  17113. return 'शाम';
  17114. } else {
  17115. return 'रात';
  17116. }
  17117. },
  17118. week : {
  17119. dow : 0, // Sunday is the first day of the week.
  17120. doy : 6 // The week that contains Jan 1st is the first week of the year.
  17121. }
  17122. });
  17123. return hi;
  17124. })));
  17125. /***/ }),
  17126. /* 49 */
  17127. /***/ (function(module, exports, __webpack_require__) {
  17128. //! moment.js locale configuration
  17129. //! locale : Croatian [hr]
  17130. //! author : Bojan Marković : https://github.com/bmarkovic
  17131. ;(function (global, factory) {
  17132. true ? factory(__webpack_require__(0)) :
  17133. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17134. factory(global.moment)
  17135. }(this, (function (moment) { 'use strict';
  17136. function translate(number, withoutSuffix, key) {
  17137. var result = number + ' ';
  17138. switch (key) {
  17139. case 'm':
  17140. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  17141. case 'mm':
  17142. if (number === 1) {
  17143. result += 'minuta';
  17144. } else if (number === 2 || number === 3 || number === 4) {
  17145. result += 'minute';
  17146. } else {
  17147. result += 'minuta';
  17148. }
  17149. return result;
  17150. case 'h':
  17151. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  17152. case 'hh':
  17153. if (number === 1) {
  17154. result += 'sat';
  17155. } else if (number === 2 || number === 3 || number === 4) {
  17156. result += 'sata';
  17157. } else {
  17158. result += 'sati';
  17159. }
  17160. return result;
  17161. case 'dd':
  17162. if (number === 1) {
  17163. result += 'dan';
  17164. } else {
  17165. result += 'dana';
  17166. }
  17167. return result;
  17168. case 'MM':
  17169. if (number === 1) {
  17170. result += 'mjesec';
  17171. } else if (number === 2 || number === 3 || number === 4) {
  17172. result += 'mjeseca';
  17173. } else {
  17174. result += 'mjeseci';
  17175. }
  17176. return result;
  17177. case 'yy':
  17178. if (number === 1) {
  17179. result += 'godina';
  17180. } else if (number === 2 || number === 3 || number === 4) {
  17181. result += 'godine';
  17182. } else {
  17183. result += 'godina';
  17184. }
  17185. return result;
  17186. }
  17187. }
  17188. var hr = moment.defineLocale('hr', {
  17189. months : {
  17190. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
  17191. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
  17192. },
  17193. monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
  17194. monthsParseExact: true,
  17195. weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  17196. weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  17197. weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
  17198. weekdaysParseExact : true,
  17199. longDateFormat : {
  17200. LT : 'H:mm',
  17201. LTS : 'H:mm:ss',
  17202. L : 'DD.MM.YYYY',
  17203. LL : 'D. MMMM YYYY',
  17204. LLL : 'D. MMMM YYYY H:mm',
  17205. LLLL : 'dddd, D. MMMM YYYY H:mm'
  17206. },
  17207. calendar : {
  17208. sameDay : '[danas u] LT',
  17209. nextDay : '[sutra u] LT',
  17210. nextWeek : function () {
  17211. switch (this.day()) {
  17212. case 0:
  17213. return '[u] [nedjelju] [u] LT';
  17214. case 3:
  17215. return '[u] [srijedu] [u] LT';
  17216. case 6:
  17217. return '[u] [subotu] [u] LT';
  17218. case 1:
  17219. case 2:
  17220. case 4:
  17221. case 5:
  17222. return '[u] dddd [u] LT';
  17223. }
  17224. },
  17225. lastDay : '[jučer u] LT',
  17226. lastWeek : function () {
  17227. switch (this.day()) {
  17228. case 0:
  17229. case 3:
  17230. return '[prošlu] dddd [u] LT';
  17231. case 6:
  17232. return '[prošle] [subote] [u] LT';
  17233. case 1:
  17234. case 2:
  17235. case 4:
  17236. case 5:
  17237. return '[prošli] dddd [u] LT';
  17238. }
  17239. },
  17240. sameElse : 'L'
  17241. },
  17242. relativeTime : {
  17243. future : 'za %s',
  17244. past : 'prije %s',
  17245. s : 'par sekundi',
  17246. m : translate,
  17247. mm : translate,
  17248. h : translate,
  17249. hh : translate,
  17250. d : 'dan',
  17251. dd : translate,
  17252. M : 'mjesec',
  17253. MM : translate,
  17254. y : 'godinu',
  17255. yy : translate
  17256. },
  17257. ordinalParse: /\d{1,2}\./,
  17258. ordinal : '%d.',
  17259. week : {
  17260. dow : 1, // Monday is the first day of the week.
  17261. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17262. }
  17263. });
  17264. return hr;
  17265. })));
  17266. /***/ }),
  17267. /* 50 */
  17268. /***/ (function(module, exports, __webpack_require__) {
  17269. //! moment.js locale configuration
  17270. //! locale : Hungarian [hu]
  17271. //! author : Adam Brunner : https://github.com/adambrunner
  17272. ;(function (global, factory) {
  17273. true ? factory(__webpack_require__(0)) :
  17274. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17275. factory(global.moment)
  17276. }(this, (function (moment) { 'use strict';
  17277. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
  17278. function translate(number, withoutSuffix, key, isFuture) {
  17279. var num = number,
  17280. suffix;
  17281. switch (key) {
  17282. case 's':
  17283. return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
  17284. case 'm':
  17285. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  17286. case 'mm':
  17287. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  17288. case 'h':
  17289. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  17290. case 'hh':
  17291. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  17292. case 'd':
  17293. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  17294. case 'dd':
  17295. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  17296. case 'M':
  17297. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  17298. case 'MM':
  17299. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  17300. case 'y':
  17301. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  17302. case 'yy':
  17303. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  17304. }
  17305. return '';
  17306. }
  17307. function week(isFuture) {
  17308. return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
  17309. }
  17310. var hu = moment.defineLocale('hu', {
  17311. months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
  17312. monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
  17313. weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  17314. weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  17315. weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
  17316. longDateFormat : {
  17317. LT : 'H:mm',
  17318. LTS : 'H:mm:ss',
  17319. L : 'YYYY.MM.DD.',
  17320. LL : 'YYYY. MMMM D.',
  17321. LLL : 'YYYY. MMMM D. H:mm',
  17322. LLLL : 'YYYY. MMMM D., dddd H:mm'
  17323. },
  17324. meridiemParse: /de|du/i,
  17325. isPM: function (input) {
  17326. return input.charAt(1).toLowerCase() === 'u';
  17327. },
  17328. meridiem : function (hours, minutes, isLower) {
  17329. if (hours < 12) {
  17330. return isLower === true ? 'de' : 'DE';
  17331. } else {
  17332. return isLower === true ? 'du' : 'DU';
  17333. }
  17334. },
  17335. calendar : {
  17336. sameDay : '[ma] LT[-kor]',
  17337. nextDay : '[holnap] LT[-kor]',
  17338. nextWeek : function () {
  17339. return week.call(this, true);
  17340. },
  17341. lastDay : '[tegnap] LT[-kor]',
  17342. lastWeek : function () {
  17343. return week.call(this, false);
  17344. },
  17345. sameElse : 'L'
  17346. },
  17347. relativeTime : {
  17348. future : '%s múlva',
  17349. past : '%s',
  17350. s : translate,
  17351. m : translate,
  17352. mm : translate,
  17353. h : translate,
  17354. hh : translate,
  17355. d : translate,
  17356. dd : translate,
  17357. M : translate,
  17358. MM : translate,
  17359. y : translate,
  17360. yy : translate
  17361. },
  17362. ordinalParse: /\d{1,2}\./,
  17363. ordinal : '%d.',
  17364. week : {
  17365. dow : 1, // Monday is the first day of the week.
  17366. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17367. }
  17368. });
  17369. return hu;
  17370. })));
  17371. /***/ }),
  17372. /* 51 */
  17373. /***/ (function(module, exports, __webpack_require__) {
  17374. //! moment.js locale configuration
  17375. //! locale : Armenian [hy-am]
  17376. //! author : Armendarabyan : https://github.com/armendarabyan
  17377. ;(function (global, factory) {
  17378. true ? factory(__webpack_require__(0)) :
  17379. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17380. factory(global.moment)
  17381. }(this, (function (moment) { 'use strict';
  17382. var hyAm = moment.defineLocale('hy-am', {
  17383. months : {
  17384. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
  17385. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
  17386. },
  17387. monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  17388. weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
  17389. weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  17390. weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  17391. longDateFormat : {
  17392. LT : 'HH:mm',
  17393. LTS : 'HH:mm:ss',
  17394. L : 'DD.MM.YYYY',
  17395. LL : 'D MMMM YYYY թ.',
  17396. LLL : 'D MMMM YYYY թ., HH:mm',
  17397. LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
  17398. },
  17399. calendar : {
  17400. sameDay: '[այսօր] LT',
  17401. nextDay: '[վաղը] LT',
  17402. lastDay: '[երեկ] LT',
  17403. nextWeek: function () {
  17404. return 'dddd [օրը ժամը] LT';
  17405. },
  17406. lastWeek: function () {
  17407. return '[անցած] dddd [օրը ժամը] LT';
  17408. },
  17409. sameElse: 'L'
  17410. },
  17411. relativeTime : {
  17412. future : '%s հետո',
  17413. past : '%s առաջ',
  17414. s : 'մի քանի վայրկյան',
  17415. m : 'րոպե',
  17416. mm : '%d րոպե',
  17417. h : 'ժամ',
  17418. hh : '%d ժամ',
  17419. d : 'օր',
  17420. dd : '%d օր',
  17421. M : 'ամիս',
  17422. MM : '%d ամիս',
  17423. y : 'տարի',
  17424. yy : '%d տարի'
  17425. },
  17426. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  17427. isPM: function (input) {
  17428. return /^(ցերեկվա|երեկոյան)$/.test(input);
  17429. },
  17430. meridiem : function (hour) {
  17431. if (hour < 4) {
  17432. return 'գիշերվա';
  17433. } else if (hour < 12) {
  17434. return 'առավոտվա';
  17435. } else if (hour < 17) {
  17436. return 'ցերեկվա';
  17437. } else {
  17438. return 'երեկոյան';
  17439. }
  17440. },
  17441. ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  17442. ordinal: function (number, period) {
  17443. switch (period) {
  17444. case 'DDD':
  17445. case 'w':
  17446. case 'W':
  17447. case 'DDDo':
  17448. if (number === 1) {
  17449. return number + '-ին';
  17450. }
  17451. return number + '-րդ';
  17452. default:
  17453. return number;
  17454. }
  17455. },
  17456. week : {
  17457. dow : 1, // Monday is the first day of the week.
  17458. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17459. }
  17460. });
  17461. return hyAm;
  17462. })));
  17463. /***/ }),
  17464. /* 52 */
  17465. /***/ (function(module, exports, __webpack_require__) {
  17466. //! moment.js locale configuration
  17467. //! locale : Indonesian [id]
  17468. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  17469. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  17470. ;(function (global, factory) {
  17471. true ? factory(__webpack_require__(0)) :
  17472. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17473. factory(global.moment)
  17474. }(this, (function (moment) { 'use strict';
  17475. var id = moment.defineLocale('id', {
  17476. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  17477. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  17478. weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  17479. weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  17480. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  17481. longDateFormat : {
  17482. LT : 'HH.mm',
  17483. LTS : 'HH.mm.ss',
  17484. L : 'DD/MM/YYYY',
  17485. LL : 'D MMMM YYYY',
  17486. LLL : 'D MMMM YYYY [pukul] HH.mm',
  17487. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  17488. },
  17489. meridiemParse: /pagi|siang|sore|malam/,
  17490. meridiemHour : function (hour, meridiem) {
  17491. if (hour === 12) {
  17492. hour = 0;
  17493. }
  17494. if (meridiem === 'pagi') {
  17495. return hour;
  17496. } else if (meridiem === 'siang') {
  17497. return hour >= 11 ? hour : hour + 12;
  17498. } else if (meridiem === 'sore' || meridiem === 'malam') {
  17499. return hour + 12;
  17500. }
  17501. },
  17502. meridiem : function (hours, minutes, isLower) {
  17503. if (hours < 11) {
  17504. return 'pagi';
  17505. } else if (hours < 15) {
  17506. return 'siang';
  17507. } else if (hours < 19) {
  17508. return 'sore';
  17509. } else {
  17510. return 'malam';
  17511. }
  17512. },
  17513. calendar : {
  17514. sameDay : '[Hari ini pukul] LT',
  17515. nextDay : '[Besok pukul] LT',
  17516. nextWeek : 'dddd [pukul] LT',
  17517. lastDay : '[Kemarin pukul] LT',
  17518. lastWeek : 'dddd [lalu pukul] LT',
  17519. sameElse : 'L'
  17520. },
  17521. relativeTime : {
  17522. future : 'dalam %s',
  17523. past : '%s yang lalu',
  17524. s : 'beberapa detik',
  17525. m : 'semenit',
  17526. mm : '%d menit',
  17527. h : 'sejam',
  17528. hh : '%d jam',
  17529. d : 'sehari',
  17530. dd : '%d hari',
  17531. M : 'sebulan',
  17532. MM : '%d bulan',
  17533. y : 'setahun',
  17534. yy : '%d tahun'
  17535. },
  17536. week : {
  17537. dow : 1, // Monday is the first day of the week.
  17538. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17539. }
  17540. });
  17541. return id;
  17542. })));
  17543. /***/ }),
  17544. /* 53 */
  17545. /***/ (function(module, exports, __webpack_require__) {
  17546. //! moment.js locale configuration
  17547. //! locale : Icelandic [is]
  17548. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  17549. ;(function (global, factory) {
  17550. true ? factory(__webpack_require__(0)) :
  17551. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17552. factory(global.moment)
  17553. }(this, (function (moment) { 'use strict';
  17554. function plural(n) {
  17555. if (n % 100 === 11) {
  17556. return true;
  17557. } else if (n % 10 === 1) {
  17558. return false;
  17559. }
  17560. return true;
  17561. }
  17562. function translate(number, withoutSuffix, key, isFuture) {
  17563. var result = number + ' ';
  17564. switch (key) {
  17565. case 's':
  17566. return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
  17567. case 'm':
  17568. return withoutSuffix ? 'mínúta' : 'mínútu';
  17569. case 'mm':
  17570. if (plural(number)) {
  17571. return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
  17572. } else if (withoutSuffix) {
  17573. return result + 'mínúta';
  17574. }
  17575. return result + 'mínútu';
  17576. case 'hh':
  17577. if (plural(number)) {
  17578. return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
  17579. }
  17580. return result + 'klukkustund';
  17581. case 'd':
  17582. if (withoutSuffix) {
  17583. return 'dagur';
  17584. }
  17585. return isFuture ? 'dag' : 'degi';
  17586. case 'dd':
  17587. if (plural(number)) {
  17588. if (withoutSuffix) {
  17589. return result + 'dagar';
  17590. }
  17591. return result + (isFuture ? 'daga' : 'dögum');
  17592. } else if (withoutSuffix) {
  17593. return result + 'dagur';
  17594. }
  17595. return result + (isFuture ? 'dag' : 'degi');
  17596. case 'M':
  17597. if (withoutSuffix) {
  17598. return 'mánuður';
  17599. }
  17600. return isFuture ? 'mánuð' : 'mánuði';
  17601. case 'MM':
  17602. if (plural(number)) {
  17603. if (withoutSuffix) {
  17604. return result + 'mánuðir';
  17605. }
  17606. return result + (isFuture ? 'mánuði' : 'mánuðum');
  17607. } else if (withoutSuffix) {
  17608. return result + 'mánuður';
  17609. }
  17610. return result + (isFuture ? 'mánuð' : 'mánuði');
  17611. case 'y':
  17612. return withoutSuffix || isFuture ? 'ár' : 'ári';
  17613. case 'yy':
  17614. if (plural(number)) {
  17615. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  17616. }
  17617. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  17618. }
  17619. }
  17620. var is = moment.defineLocale('is', {
  17621. months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
  17622. monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  17623. weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
  17624. weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  17625. weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  17626. longDateFormat : {
  17627. LT : 'H:mm',
  17628. LTS : 'H:mm:ss',
  17629. L : 'DD.MM.YYYY',
  17630. LL : 'D. MMMM YYYY',
  17631. LLL : 'D. MMMM YYYY [kl.] H:mm',
  17632. LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
  17633. },
  17634. calendar : {
  17635. sameDay : '[í dag kl.] LT',
  17636. nextDay : '[á morgun kl.] LT',
  17637. nextWeek : 'dddd [kl.] LT',
  17638. lastDay : '[í gær kl.] LT',
  17639. lastWeek : '[síðasta] dddd [kl.] LT',
  17640. sameElse : 'L'
  17641. },
  17642. relativeTime : {
  17643. future : 'eftir %s',
  17644. past : 'fyrir %s síðan',
  17645. s : translate,
  17646. m : translate,
  17647. mm : translate,
  17648. h : 'klukkustund',
  17649. hh : translate,
  17650. d : translate,
  17651. dd : translate,
  17652. M : translate,
  17653. MM : translate,
  17654. y : translate,
  17655. yy : translate
  17656. },
  17657. ordinalParse: /\d{1,2}\./,
  17658. ordinal : '%d.',
  17659. week : {
  17660. dow : 1, // Monday is the first day of the week.
  17661. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17662. }
  17663. });
  17664. return is;
  17665. })));
  17666. /***/ }),
  17667. /* 54 */
  17668. /***/ (function(module, exports, __webpack_require__) {
  17669. //! moment.js locale configuration
  17670. //! locale : Italian [it]
  17671. //! author : Lorenzo : https://github.com/aliem
  17672. //! author: Mattia Larentis: https://github.com/nostalgiaz
  17673. ;(function (global, factory) {
  17674. true ? factory(__webpack_require__(0)) :
  17675. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17676. factory(global.moment)
  17677. }(this, (function (moment) { 'use strict';
  17678. var it = moment.defineLocale('it', {
  17679. months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
  17680. monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  17681. weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),
  17682. weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'),
  17683. weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'),
  17684. longDateFormat : {
  17685. LT : 'HH:mm',
  17686. LTS : 'HH:mm:ss',
  17687. L : 'DD/MM/YYYY',
  17688. LL : 'D MMMM YYYY',
  17689. LLL : 'D MMMM YYYY HH:mm',
  17690. LLLL : 'dddd, D MMMM YYYY HH:mm'
  17691. },
  17692. calendar : {
  17693. sameDay: '[Oggi alle] LT',
  17694. nextDay: '[Domani alle] LT',
  17695. nextWeek: 'dddd [alle] LT',
  17696. lastDay: '[Ieri alle] LT',
  17697. lastWeek: function () {
  17698. switch (this.day()) {
  17699. case 0:
  17700. return '[la scorsa] dddd [alle] LT';
  17701. default:
  17702. return '[lo scorso] dddd [alle] LT';
  17703. }
  17704. },
  17705. sameElse: 'L'
  17706. },
  17707. relativeTime : {
  17708. future : function (s) {
  17709. return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
  17710. },
  17711. past : '%s fa',
  17712. s : 'alcuni secondi',
  17713. m : 'un minuto',
  17714. mm : '%d minuti',
  17715. h : 'un\'ora',
  17716. hh : '%d ore',
  17717. d : 'un giorno',
  17718. dd : '%d giorni',
  17719. M : 'un mese',
  17720. MM : '%d mesi',
  17721. y : 'un anno',
  17722. yy : '%d anni'
  17723. },
  17724. ordinalParse : /\d{1,2}º/,
  17725. ordinal: '%dº',
  17726. week : {
  17727. dow : 1, // Monday is the first day of the week.
  17728. doy : 4 // The week that contains Jan 4th is the first week of the year.
  17729. }
  17730. });
  17731. return it;
  17732. })));
  17733. /***/ }),
  17734. /* 55 */
  17735. /***/ (function(module, exports, __webpack_require__) {
  17736. //! moment.js locale configuration
  17737. //! locale : Japanese [ja]
  17738. //! author : LI Long : https://github.com/baryon
  17739. ;(function (global, factory) {
  17740. true ? factory(__webpack_require__(0)) :
  17741. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17742. factory(global.moment)
  17743. }(this, (function (moment) { 'use strict';
  17744. var ja = moment.defineLocale('ja', {
  17745. months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  17746. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  17747. weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  17748. weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
  17749. weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
  17750. longDateFormat : {
  17751. LT : 'Ah時m分',
  17752. LTS : 'Ah時m分s秒',
  17753. L : 'YYYY/MM/DD',
  17754. LL : 'YYYY年M月D日',
  17755. LLL : 'YYYY年M月D日Ah時m分',
  17756. LLLL : 'YYYY年M月D日Ah時m分 dddd'
  17757. },
  17758. meridiemParse: /午前|午後/i,
  17759. isPM : function (input) {
  17760. return input === '午後';
  17761. },
  17762. meridiem : function (hour, minute, isLower) {
  17763. if (hour < 12) {
  17764. return '午前';
  17765. } else {
  17766. return '午後';
  17767. }
  17768. },
  17769. calendar : {
  17770. sameDay : '[今日] LT',
  17771. nextDay : '[明日] LT',
  17772. nextWeek : '[来週]dddd LT',
  17773. lastDay : '[昨日] LT',
  17774. lastWeek : '[前週]dddd LT',
  17775. sameElse : 'L'
  17776. },
  17777. ordinalParse : /\d{1,2}日/,
  17778. ordinal : function (number, period) {
  17779. switch (period) {
  17780. case 'd':
  17781. case 'D':
  17782. case 'DDD':
  17783. return number + '日';
  17784. default:
  17785. return number;
  17786. }
  17787. },
  17788. relativeTime : {
  17789. future : '%s後',
  17790. past : '%s前',
  17791. s : '数秒',
  17792. m : '1分',
  17793. mm : '%d分',
  17794. h : '1時間',
  17795. hh : '%d時間',
  17796. d : '1日',
  17797. dd : '%d日',
  17798. M : '1ヶ月',
  17799. MM : '%dヶ月',
  17800. y : '1年',
  17801. yy : '%d年'
  17802. }
  17803. });
  17804. return ja;
  17805. })));
  17806. /***/ }),
  17807. /* 56 */
  17808. /***/ (function(module, exports, __webpack_require__) {
  17809. //! moment.js locale configuration
  17810. //! locale : Javanese [jv]
  17811. //! author : Rony Lantip : https://github.com/lantip
  17812. //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
  17813. ;(function (global, factory) {
  17814. true ? factory(__webpack_require__(0)) :
  17815. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17816. factory(global.moment)
  17817. }(this, (function (moment) { 'use strict';
  17818. var jv = moment.defineLocale('jv', {
  17819. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
  17820. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  17821. weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  17822. weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  17823. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  17824. longDateFormat : {
  17825. LT : 'HH.mm',
  17826. LTS : 'HH.mm.ss',
  17827. L : 'DD/MM/YYYY',
  17828. LL : 'D MMMM YYYY',
  17829. LLL : 'D MMMM YYYY [pukul] HH.mm',
  17830. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  17831. },
  17832. meridiemParse: /enjing|siyang|sonten|ndalu/,
  17833. meridiemHour : function (hour, meridiem) {
  17834. if (hour === 12) {
  17835. hour = 0;
  17836. }
  17837. if (meridiem === 'enjing') {
  17838. return hour;
  17839. } else if (meridiem === 'siyang') {
  17840. return hour >= 11 ? hour : hour + 12;
  17841. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  17842. return hour + 12;
  17843. }
  17844. },
  17845. meridiem : function (hours, minutes, isLower) {
  17846. if (hours < 11) {
  17847. return 'enjing';
  17848. } else if (hours < 15) {
  17849. return 'siyang';
  17850. } else if (hours < 19) {
  17851. return 'sonten';
  17852. } else {
  17853. return 'ndalu';
  17854. }
  17855. },
  17856. calendar : {
  17857. sameDay : '[Dinten puniko pukul] LT',
  17858. nextDay : '[Mbenjang pukul] LT',
  17859. nextWeek : 'dddd [pukul] LT',
  17860. lastDay : '[Kala wingi pukul] LT',
  17861. lastWeek : 'dddd [kepengker pukul] LT',
  17862. sameElse : 'L'
  17863. },
  17864. relativeTime : {
  17865. future : 'wonten ing %s',
  17866. past : '%s ingkang kepengker',
  17867. s : 'sawetawis detik',
  17868. m : 'setunggal menit',
  17869. mm : '%d menit',
  17870. h : 'setunggal jam',
  17871. hh : '%d jam',
  17872. d : 'sedinten',
  17873. dd : '%d dinten',
  17874. M : 'sewulan',
  17875. MM : '%d wulan',
  17876. y : 'setaun',
  17877. yy : '%d taun'
  17878. },
  17879. week : {
  17880. dow : 1, // Monday is the first day of the week.
  17881. doy : 7 // The week that contains Jan 1st is the first week of the year.
  17882. }
  17883. });
  17884. return jv;
  17885. })));
  17886. /***/ }),
  17887. /* 57 */
  17888. /***/ (function(module, exports, __webpack_require__) {
  17889. //! moment.js locale configuration
  17890. //! locale : Georgian [ka]
  17891. //! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
  17892. ;(function (global, factory) {
  17893. true ? factory(__webpack_require__(0)) :
  17894. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17895. factory(global.moment)
  17896. }(this, (function (moment) { 'use strict';
  17897. var ka = moment.defineLocale('ka', {
  17898. months : {
  17899. standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
  17900. format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
  17901. },
  17902. monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  17903. weekdays : {
  17904. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
  17905. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
  17906. isFormat: /(წინა|შემდეგ)/
  17907. },
  17908. weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  17909. weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  17910. longDateFormat : {
  17911. LT : 'h:mm A',
  17912. LTS : 'h:mm:ss A',
  17913. L : 'DD/MM/YYYY',
  17914. LL : 'D MMMM YYYY',
  17915. LLL : 'D MMMM YYYY h:mm A',
  17916. LLLL : 'dddd, D MMMM YYYY h:mm A'
  17917. },
  17918. calendar : {
  17919. sameDay : '[დღეს] LT[-ზე]',
  17920. nextDay : '[ხვალ] LT[-ზე]',
  17921. lastDay : '[გუშინ] LT[-ზე]',
  17922. nextWeek : '[შემდეგ] dddd LT[-ზე]',
  17923. lastWeek : '[წინა] dddd LT-ზე',
  17924. sameElse : 'L'
  17925. },
  17926. relativeTime : {
  17927. future : function (s) {
  17928. return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
  17929. s.replace(/ი$/, 'ში') :
  17930. s + 'ში';
  17931. },
  17932. past : function (s) {
  17933. if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
  17934. return s.replace(/(ი|ე)$/, 'ის წინ');
  17935. }
  17936. if ((/წელი/).test(s)) {
  17937. return s.replace(/წელი$/, 'წლის წინ');
  17938. }
  17939. },
  17940. s : 'რამდენიმე წამი',
  17941. m : 'წუთი',
  17942. mm : '%d წუთი',
  17943. h : 'საათი',
  17944. hh : '%d საათი',
  17945. d : 'დღე',
  17946. dd : '%d დღე',
  17947. M : 'თვე',
  17948. MM : '%d თვე',
  17949. y : 'წელი',
  17950. yy : '%d წელი'
  17951. },
  17952. ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  17953. ordinal : function (number) {
  17954. if (number === 0) {
  17955. return number;
  17956. }
  17957. if (number === 1) {
  17958. return number + '-ლი';
  17959. }
  17960. if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {
  17961. return 'მე-' + number;
  17962. }
  17963. return number + '-ე';
  17964. },
  17965. week : {
  17966. dow : 1,
  17967. doy : 7
  17968. }
  17969. });
  17970. return ka;
  17971. })));
  17972. /***/ }),
  17973. /* 58 */
  17974. /***/ (function(module, exports, __webpack_require__) {
  17975. //! moment.js locale configuration
  17976. //! locale : Kazakh [kk]
  17977. //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
  17978. ;(function (global, factory) {
  17979. true ? factory(__webpack_require__(0)) :
  17980. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  17981. factory(global.moment)
  17982. }(this, (function (moment) { 'use strict';
  17983. var suffixes = {
  17984. 0: '-ші',
  17985. 1: '-ші',
  17986. 2: '-ші',
  17987. 3: '-ші',
  17988. 4: '-ші',
  17989. 5: '-ші',
  17990. 6: '-шы',
  17991. 7: '-ші',
  17992. 8: '-ші',
  17993. 9: '-шы',
  17994. 10: '-шы',
  17995. 20: '-шы',
  17996. 30: '-шы',
  17997. 40: '-шы',
  17998. 50: '-ші',
  17999. 60: '-шы',
  18000. 70: '-ші',
  18001. 80: '-ші',
  18002. 90: '-шы',
  18003. 100: '-ші'
  18004. };
  18005. var kk = moment.defineLocale('kk', {
  18006. months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
  18007. monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  18008. weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
  18009. weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  18010. weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  18011. longDateFormat : {
  18012. LT : 'HH:mm',
  18013. LTS : 'HH:mm:ss',
  18014. L : 'DD.MM.YYYY',
  18015. LL : 'D MMMM YYYY',
  18016. LLL : 'D MMMM YYYY HH:mm',
  18017. LLLL : 'dddd, D MMMM YYYY HH:mm'
  18018. },
  18019. calendar : {
  18020. sameDay : '[Бүгін сағат] LT',
  18021. nextDay : '[Ертең сағат] LT',
  18022. nextWeek : 'dddd [сағат] LT',
  18023. lastDay : '[Кеше сағат] LT',
  18024. lastWeek : '[Өткен аптаның] dddd [сағат] LT',
  18025. sameElse : 'L'
  18026. },
  18027. relativeTime : {
  18028. future : '%s ішінде',
  18029. past : '%s бұрын',
  18030. s : 'бірнеше секунд',
  18031. m : 'бір минут',
  18032. mm : '%d минут',
  18033. h : 'бір сағат',
  18034. hh : '%d сағат',
  18035. d : 'бір күн',
  18036. dd : '%d күн',
  18037. M : 'бір ай',
  18038. MM : '%d ай',
  18039. y : 'бір жыл',
  18040. yy : '%d жыл'
  18041. },
  18042. ordinalParse: /\d{1,2}-(ші|шы)/,
  18043. ordinal : function (number) {
  18044. var a = number % 10,
  18045. b = number >= 100 ? 100 : null;
  18046. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  18047. },
  18048. week : {
  18049. dow : 1, // Monday is the first day of the week.
  18050. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18051. }
  18052. });
  18053. return kk;
  18054. })));
  18055. /***/ }),
  18056. /* 59 */
  18057. /***/ (function(module, exports, __webpack_require__) {
  18058. //! moment.js locale configuration
  18059. //! locale : Cambodian [km]
  18060. //! author : Kruy Vanna : https://github.com/kruyvanna
  18061. ;(function (global, factory) {
  18062. true ? factory(__webpack_require__(0)) :
  18063. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18064. factory(global.moment)
  18065. }(this, (function (moment) { 'use strict';
  18066. var km = moment.defineLocale('km', {
  18067. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  18068. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
  18069. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18070. weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18071. weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  18072. longDateFormat: {
  18073. LT: 'HH:mm',
  18074. LTS : 'HH:mm:ss',
  18075. L: 'DD/MM/YYYY',
  18076. LL: 'D MMMM YYYY',
  18077. LLL: 'D MMMM YYYY HH:mm',
  18078. LLLL: 'dddd, D MMMM YYYY HH:mm'
  18079. },
  18080. calendar: {
  18081. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  18082. nextDay: '[ស្អែក ម៉ោង] LT',
  18083. nextWeek: 'dddd [ម៉ោង] LT',
  18084. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  18085. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  18086. sameElse: 'L'
  18087. },
  18088. relativeTime: {
  18089. future: '%sទៀត',
  18090. past: '%sមុន',
  18091. s: 'ប៉ុន្មានវិនាទី',
  18092. m: 'មួយនាទី',
  18093. mm: '%d នាទី',
  18094. h: 'មួយម៉ោង',
  18095. hh: '%d ម៉ោង',
  18096. d: 'មួយថ្ងៃ',
  18097. dd: '%d ថ្ងៃ',
  18098. M: 'មួយខែ',
  18099. MM: '%d ខែ',
  18100. y: 'មួយឆ្នាំ',
  18101. yy: '%d ឆ្នាំ'
  18102. },
  18103. week: {
  18104. dow: 1, // Monday is the first day of the week.
  18105. doy: 4 // The week that contains Jan 4th is the first week of the year.
  18106. }
  18107. });
  18108. return km;
  18109. })));
  18110. /***/ }),
  18111. /* 60 */
  18112. /***/ (function(module, exports, __webpack_require__) {
  18113. //! moment.js locale configuration
  18114. //! locale : Korean [ko]
  18115. //! author : Kyungwook, Park : https://github.com/kyungw00k
  18116. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  18117. ;(function (global, factory) {
  18118. true ? factory(__webpack_require__(0)) :
  18119. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18120. factory(global.moment)
  18121. }(this, (function (moment) { 'use strict';
  18122. var ko = moment.defineLocale('ko', {
  18123. months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  18124. monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  18125. weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  18126. weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
  18127. weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
  18128. longDateFormat : {
  18129. LT : 'A h시 m분',
  18130. LTS : 'A h시 m분 s초',
  18131. L : 'YYYY.MM.DD',
  18132. LL : 'YYYY년 MMMM D일',
  18133. LLL : 'YYYY년 MMMM D일 A h시 m분',
  18134. LLLL : 'YYYY년 MMMM D일 dddd A h시 m분'
  18135. },
  18136. calendar : {
  18137. sameDay : '오늘 LT',
  18138. nextDay : '내일 LT',
  18139. nextWeek : 'dddd LT',
  18140. lastDay : '어제 LT',
  18141. lastWeek : '지난주 dddd LT',
  18142. sameElse : 'L'
  18143. },
  18144. relativeTime : {
  18145. future : '%s 후',
  18146. past : '%s 전',
  18147. s : '몇 초',
  18148. ss : '%d초',
  18149. m : '일분',
  18150. mm : '%d분',
  18151. h : '한 시간',
  18152. hh : '%d시간',
  18153. d : '하루',
  18154. dd : '%d일',
  18155. M : '한 달',
  18156. MM : '%d달',
  18157. y : '일 년',
  18158. yy : '%d년'
  18159. },
  18160. ordinalParse : /\d{1,2}일/,
  18161. ordinal : '%d일',
  18162. meridiemParse : /오전|오후/,
  18163. isPM : function (token) {
  18164. return token === '오후';
  18165. },
  18166. meridiem : function (hour, minute, isUpper) {
  18167. return hour < 12 ? '오전' : '오후';
  18168. }
  18169. });
  18170. return ko;
  18171. })));
  18172. /***/ }),
  18173. /* 61 */
  18174. /***/ (function(module, exports, __webpack_require__) {
  18175. //! moment.js locale configuration
  18176. //! locale : Kyrgyz [ky]
  18177. //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
  18178. ;(function (global, factory) {
  18179. true ? factory(__webpack_require__(0)) :
  18180. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18181. factory(global.moment)
  18182. }(this, (function (moment) { 'use strict';
  18183. var suffixes = {
  18184. 0: '-чү',
  18185. 1: '-чи',
  18186. 2: '-чи',
  18187. 3: '-чү',
  18188. 4: '-чү',
  18189. 5: '-чи',
  18190. 6: '-чы',
  18191. 7: '-чи',
  18192. 8: '-чи',
  18193. 9: '-чу',
  18194. 10: '-чу',
  18195. 20: '-чы',
  18196. 30: '-чу',
  18197. 40: '-чы',
  18198. 50: '-чү',
  18199. 60: '-чы',
  18200. 70: '-чи',
  18201. 80: '-чи',
  18202. 90: '-чу',
  18203. 100: '-чү'
  18204. };
  18205. var ky = moment.defineLocale('ky', {
  18206. months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
  18207. monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
  18208. weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
  18209. weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  18210. weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  18211. longDateFormat : {
  18212. LT : 'HH:mm',
  18213. LTS : 'HH:mm:ss',
  18214. L : 'DD.MM.YYYY',
  18215. LL : 'D MMMM YYYY',
  18216. LLL : 'D MMMM YYYY HH:mm',
  18217. LLLL : 'dddd, D MMMM YYYY HH:mm'
  18218. },
  18219. calendar : {
  18220. sameDay : '[Бүгүн саат] LT',
  18221. nextDay : '[Эртең саат] LT',
  18222. nextWeek : 'dddd [саат] LT',
  18223. lastDay : '[Кече саат] LT',
  18224. lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',
  18225. sameElse : 'L'
  18226. },
  18227. relativeTime : {
  18228. future : '%s ичинде',
  18229. past : '%s мурун',
  18230. s : 'бирнече секунд',
  18231. m : 'бир мүнөт',
  18232. mm : '%d мүнөт',
  18233. h : 'бир саат',
  18234. hh : '%d саат',
  18235. d : 'бир күн',
  18236. dd : '%d күн',
  18237. M : 'бир ай',
  18238. MM : '%d ай',
  18239. y : 'бир жыл',
  18240. yy : '%d жыл'
  18241. },
  18242. ordinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  18243. ordinal : function (number) {
  18244. var a = number % 10,
  18245. b = number >= 100 ? 100 : null;
  18246. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  18247. },
  18248. week : {
  18249. dow : 1, // Monday is the first day of the week.
  18250. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18251. }
  18252. });
  18253. return ky;
  18254. })));
  18255. /***/ }),
  18256. /* 62 */
  18257. /***/ (function(module, exports, __webpack_require__) {
  18258. //! moment.js locale configuration
  18259. //! locale : Luxembourgish [lb]
  18260. //! author : mweimerskirch : https://github.com/mweimerskirch
  18261. //! author : David Raison : https://github.com/kwisatz
  18262. ;(function (global, factory) {
  18263. true ? factory(__webpack_require__(0)) :
  18264. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18265. factory(global.moment)
  18266. }(this, (function (moment) { 'use strict';
  18267. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  18268. var format = {
  18269. 'm': ['eng Minutt', 'enger Minutt'],
  18270. 'h': ['eng Stonn', 'enger Stonn'],
  18271. 'd': ['een Dag', 'engem Dag'],
  18272. 'M': ['ee Mount', 'engem Mount'],
  18273. 'y': ['ee Joer', 'engem Joer']
  18274. };
  18275. return withoutSuffix ? format[key][0] : format[key][1];
  18276. }
  18277. function processFutureTime(string) {
  18278. var number = string.substr(0, string.indexOf(' '));
  18279. if (eifelerRegelAppliesToNumber(number)) {
  18280. return 'a ' + string;
  18281. }
  18282. return 'an ' + string;
  18283. }
  18284. function processPastTime(string) {
  18285. var number = string.substr(0, string.indexOf(' '));
  18286. if (eifelerRegelAppliesToNumber(number)) {
  18287. return 'viru ' + string;
  18288. }
  18289. return 'virun ' + string;
  18290. }
  18291. /**
  18292. * Returns true if the word before the given number loses the '-n' ending.
  18293. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  18294. *
  18295. * @param number {integer}
  18296. * @returns {boolean}
  18297. */
  18298. function eifelerRegelAppliesToNumber(number) {
  18299. number = parseInt(number, 10);
  18300. if (isNaN(number)) {
  18301. return false;
  18302. }
  18303. if (number < 0) {
  18304. // Negative Number --> always true
  18305. return true;
  18306. } else if (number < 10) {
  18307. // Only 1 digit
  18308. if (4 <= number && number <= 7) {
  18309. return true;
  18310. }
  18311. return false;
  18312. } else if (number < 100) {
  18313. // 2 digits
  18314. var lastDigit = number % 10, firstDigit = number / 10;
  18315. if (lastDigit === 0) {
  18316. return eifelerRegelAppliesToNumber(firstDigit);
  18317. }
  18318. return eifelerRegelAppliesToNumber(lastDigit);
  18319. } else if (number < 10000) {
  18320. // 3 or 4 digits --> recursively check first digit
  18321. while (number >= 10) {
  18322. number = number / 10;
  18323. }
  18324. return eifelerRegelAppliesToNumber(number);
  18325. } else {
  18326. // Anything larger than 4 digits: recursively check first n-3 digits
  18327. number = number / 1000;
  18328. return eifelerRegelAppliesToNumber(number);
  18329. }
  18330. }
  18331. var lb = moment.defineLocale('lb', {
  18332. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  18333. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  18334. monthsParseExact : true,
  18335. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
  18336. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  18337. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  18338. weekdaysParseExact : true,
  18339. longDateFormat: {
  18340. LT: 'H:mm [Auer]',
  18341. LTS: 'H:mm:ss [Auer]',
  18342. L: 'DD.MM.YYYY',
  18343. LL: 'D. MMMM YYYY',
  18344. LLL: 'D. MMMM YYYY H:mm [Auer]',
  18345. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
  18346. },
  18347. calendar: {
  18348. sameDay: '[Haut um] LT',
  18349. sameElse: 'L',
  18350. nextDay: '[Muer um] LT',
  18351. nextWeek: 'dddd [um] LT',
  18352. lastDay: '[Gëschter um] LT',
  18353. lastWeek: function () {
  18354. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  18355. switch (this.day()) {
  18356. case 2:
  18357. case 4:
  18358. return '[Leschten] dddd [um] LT';
  18359. default:
  18360. return '[Leschte] dddd [um] LT';
  18361. }
  18362. }
  18363. },
  18364. relativeTime : {
  18365. future : processFutureTime,
  18366. past : processPastTime,
  18367. s : 'e puer Sekonnen',
  18368. m : processRelativeTime,
  18369. mm : '%d Minutten',
  18370. h : processRelativeTime,
  18371. hh : '%d Stonnen',
  18372. d : processRelativeTime,
  18373. dd : '%d Deeg',
  18374. M : processRelativeTime,
  18375. MM : '%d Méint',
  18376. y : processRelativeTime,
  18377. yy : '%d Joer'
  18378. },
  18379. ordinalParse: /\d{1,2}\./,
  18380. ordinal: '%d.',
  18381. week: {
  18382. dow: 1, // Monday is the first day of the week.
  18383. doy: 4 // The week that contains Jan 4th is the first week of the year.
  18384. }
  18385. });
  18386. return lb;
  18387. })));
  18388. /***/ }),
  18389. /* 63 */
  18390. /***/ (function(module, exports, __webpack_require__) {
  18391. //! moment.js locale configuration
  18392. //! locale : Lao [lo]
  18393. //! author : Ryan Hart : https://github.com/ryanhart2
  18394. ;(function (global, factory) {
  18395. true ? factory(__webpack_require__(0)) :
  18396. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18397. factory(global.moment)
  18398. }(this, (function (moment) { 'use strict';
  18399. var lo = moment.defineLocale('lo', {
  18400. months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  18401. monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
  18402. weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  18403. weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  18404. weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  18405. weekdaysParseExact : true,
  18406. longDateFormat : {
  18407. LT : 'HH:mm',
  18408. LTS : 'HH:mm:ss',
  18409. L : 'DD/MM/YYYY',
  18410. LL : 'D MMMM YYYY',
  18411. LLL : 'D MMMM YYYY HH:mm',
  18412. LLLL : 'ວັນdddd D MMMM YYYY HH:mm'
  18413. },
  18414. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  18415. isPM: function (input) {
  18416. return input === 'ຕອນແລງ';
  18417. },
  18418. meridiem : function (hour, minute, isLower) {
  18419. if (hour < 12) {
  18420. return 'ຕອນເຊົ້າ';
  18421. } else {
  18422. return 'ຕອນແລງ';
  18423. }
  18424. },
  18425. calendar : {
  18426. sameDay : '[ມື້ນີ້ເວລາ] LT',
  18427. nextDay : '[ມື້ອື່ນເວລາ] LT',
  18428. nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',
  18429. lastDay : '[ມື້ວານນີ້ເວລາ] LT',
  18430. lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  18431. sameElse : 'L'
  18432. },
  18433. relativeTime : {
  18434. future : 'ອີກ %s',
  18435. past : '%sຜ່ານມາ',
  18436. s : 'ບໍ່ເທົ່າໃດວິນາທີ',
  18437. m : '1 ນາທີ',
  18438. mm : '%d ນາທີ',
  18439. h : '1 ຊົ່ວໂມງ',
  18440. hh : '%d ຊົ່ວໂມງ',
  18441. d : '1 ມື້',
  18442. dd : '%d ມື້',
  18443. M : '1 ເດືອນ',
  18444. MM : '%d ເດືອນ',
  18445. y : '1 ປີ',
  18446. yy : '%d ປີ'
  18447. },
  18448. ordinalParse: /(ທີ່)\d{1,2}/,
  18449. ordinal : function (number) {
  18450. return 'ທີ່' + number;
  18451. }
  18452. });
  18453. return lo;
  18454. })));
  18455. /***/ }),
  18456. /* 64 */
  18457. /***/ (function(module, exports, __webpack_require__) {
  18458. //! moment.js locale configuration
  18459. //! locale : Lithuanian [lt]
  18460. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  18461. ;(function (global, factory) {
  18462. true ? factory(__webpack_require__(0)) :
  18463. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18464. factory(global.moment)
  18465. }(this, (function (moment) { 'use strict';
  18466. var units = {
  18467. 'm' : 'minutė_minutės_minutę',
  18468. 'mm': 'minutės_minučių_minutes',
  18469. 'h' : 'valanda_valandos_valandą',
  18470. 'hh': 'valandos_valandų_valandas',
  18471. 'd' : 'diena_dienos_dieną',
  18472. 'dd': 'dienos_dienų_dienas',
  18473. 'M' : 'mėnuo_mėnesio_mėnesį',
  18474. 'MM': 'mėnesiai_mėnesių_mėnesius',
  18475. 'y' : 'metai_metų_metus',
  18476. 'yy': 'metai_metų_metus'
  18477. };
  18478. function translateSeconds(number, withoutSuffix, key, isFuture) {
  18479. if (withoutSuffix) {
  18480. return 'kelios sekundės';
  18481. } else {
  18482. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  18483. }
  18484. }
  18485. function translateSingular(number, withoutSuffix, key, isFuture) {
  18486. return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
  18487. }
  18488. function special(number) {
  18489. return number % 10 === 0 || (number > 10 && number < 20);
  18490. }
  18491. function forms(key) {
  18492. return units[key].split('_');
  18493. }
  18494. function translate(number, withoutSuffix, key, isFuture) {
  18495. var result = number + ' ';
  18496. if (number === 1) {
  18497. return result + translateSingular(number, withoutSuffix, key[0], isFuture);
  18498. } else if (withoutSuffix) {
  18499. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  18500. } else {
  18501. if (isFuture) {
  18502. return result + forms(key)[1];
  18503. } else {
  18504. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  18505. }
  18506. }
  18507. }
  18508. var lt = moment.defineLocale('lt', {
  18509. months : {
  18510. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
  18511. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
  18512. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
  18513. },
  18514. monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  18515. weekdays : {
  18516. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
  18517. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
  18518. isFormat: /dddd HH:mm/
  18519. },
  18520. weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  18521. weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
  18522. weekdaysParseExact : true,
  18523. longDateFormat : {
  18524. LT : 'HH:mm',
  18525. LTS : 'HH:mm:ss',
  18526. L : 'YYYY-MM-DD',
  18527. LL : 'YYYY [m.] MMMM D [d.]',
  18528. LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  18529. LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  18530. l : 'YYYY-MM-DD',
  18531. ll : 'YYYY [m.] MMMM D [d.]',
  18532. lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  18533. llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
  18534. },
  18535. calendar : {
  18536. sameDay : '[Šiandien] LT',
  18537. nextDay : '[Rytoj] LT',
  18538. nextWeek : 'dddd LT',
  18539. lastDay : '[Vakar] LT',
  18540. lastWeek : '[Praėjusį] dddd LT',
  18541. sameElse : 'L'
  18542. },
  18543. relativeTime : {
  18544. future : 'po %s',
  18545. past : 'prieš %s',
  18546. s : translateSeconds,
  18547. m : translateSingular,
  18548. mm : translate,
  18549. h : translateSingular,
  18550. hh : translate,
  18551. d : translateSingular,
  18552. dd : translate,
  18553. M : translateSingular,
  18554. MM : translate,
  18555. y : translateSingular,
  18556. yy : translate
  18557. },
  18558. ordinalParse: /\d{1,2}-oji/,
  18559. ordinal : function (number) {
  18560. return number + '-oji';
  18561. },
  18562. week : {
  18563. dow : 1, // Monday is the first day of the week.
  18564. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18565. }
  18566. });
  18567. return lt;
  18568. })));
  18569. /***/ }),
  18570. /* 65 */
  18571. /***/ (function(module, exports, __webpack_require__) {
  18572. //! moment.js locale configuration
  18573. //! locale : Latvian [lv]
  18574. //! author : Kristaps Karlsons : https://github.com/skakri
  18575. //! author : Jānis Elmeris : https://github.com/JanisE
  18576. ;(function (global, factory) {
  18577. true ? factory(__webpack_require__(0)) :
  18578. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18579. factory(global.moment)
  18580. }(this, (function (moment) { 'use strict';
  18581. var units = {
  18582. 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  18583. 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  18584. 'h': 'stundas_stundām_stunda_stundas'.split('_'),
  18585. 'hh': 'stundas_stundām_stunda_stundas'.split('_'),
  18586. 'd': 'dienas_dienām_diena_dienas'.split('_'),
  18587. 'dd': 'dienas_dienām_diena_dienas'.split('_'),
  18588. 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  18589. 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  18590. 'y': 'gada_gadiem_gads_gadi'.split('_'),
  18591. 'yy': 'gada_gadiem_gads_gadi'.split('_')
  18592. };
  18593. /**
  18594. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  18595. */
  18596. function format(forms, number, withoutSuffix) {
  18597. if (withoutSuffix) {
  18598. // E.g. "21 minūte", "3 minūtes".
  18599. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  18600. } else {
  18601. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  18602. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  18603. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  18604. }
  18605. }
  18606. function relativeTimeWithPlural(number, withoutSuffix, key) {
  18607. return number + ' ' + format(units[key], number, withoutSuffix);
  18608. }
  18609. function relativeTimeWithSingular(number, withoutSuffix, key) {
  18610. return format(units[key], number, withoutSuffix);
  18611. }
  18612. function relativeSeconds(number, withoutSuffix) {
  18613. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  18614. }
  18615. var lv = moment.defineLocale('lv', {
  18616. months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
  18617. monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  18618. weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
  18619. weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
  18620. weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
  18621. weekdaysParseExact : true,
  18622. longDateFormat : {
  18623. LT : 'HH:mm',
  18624. LTS : 'HH:mm:ss',
  18625. L : 'DD.MM.YYYY.',
  18626. LL : 'YYYY. [gada] D. MMMM',
  18627. LLL : 'YYYY. [gada] D. MMMM, HH:mm',
  18628. LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
  18629. },
  18630. calendar : {
  18631. sameDay : '[Šodien pulksten] LT',
  18632. nextDay : '[Rīt pulksten] LT',
  18633. nextWeek : 'dddd [pulksten] LT',
  18634. lastDay : '[Vakar pulksten] LT',
  18635. lastWeek : '[Pagājušā] dddd [pulksten] LT',
  18636. sameElse : 'L'
  18637. },
  18638. relativeTime : {
  18639. future : 'pēc %s',
  18640. past : 'pirms %s',
  18641. s : relativeSeconds,
  18642. m : relativeTimeWithSingular,
  18643. mm : relativeTimeWithPlural,
  18644. h : relativeTimeWithSingular,
  18645. hh : relativeTimeWithPlural,
  18646. d : relativeTimeWithSingular,
  18647. dd : relativeTimeWithPlural,
  18648. M : relativeTimeWithSingular,
  18649. MM : relativeTimeWithPlural,
  18650. y : relativeTimeWithSingular,
  18651. yy : relativeTimeWithPlural
  18652. },
  18653. ordinalParse: /\d{1,2}\./,
  18654. ordinal : '%d.',
  18655. week : {
  18656. dow : 1, // Monday is the first day of the week.
  18657. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18658. }
  18659. });
  18660. return lv;
  18661. })));
  18662. /***/ }),
  18663. /* 66 */
  18664. /***/ (function(module, exports, __webpack_require__) {
  18665. //! moment.js locale configuration
  18666. //! locale : Montenegrin [me]
  18667. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  18668. ;(function (global, factory) {
  18669. true ? factory(__webpack_require__(0)) :
  18670. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18671. factory(global.moment)
  18672. }(this, (function (moment) { 'use strict';
  18673. var translator = {
  18674. words: { //Different grammatical cases
  18675. m: ['jedan minut', 'jednog minuta'],
  18676. mm: ['minut', 'minuta', 'minuta'],
  18677. h: ['jedan sat', 'jednog sata'],
  18678. hh: ['sat', 'sata', 'sati'],
  18679. dd: ['dan', 'dana', 'dana'],
  18680. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  18681. yy: ['godina', 'godine', 'godina']
  18682. },
  18683. correctGrammaticalCase: function (number, wordKey) {
  18684. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  18685. },
  18686. translate: function (number, withoutSuffix, key) {
  18687. var wordKey = translator.words[key];
  18688. if (key.length === 1) {
  18689. return withoutSuffix ? wordKey[0] : wordKey[1];
  18690. } else {
  18691. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  18692. }
  18693. }
  18694. };
  18695. var me = moment.defineLocale('me', {
  18696. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  18697. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  18698. monthsParseExact : true,
  18699. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
  18700. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  18701. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  18702. weekdaysParseExact : true,
  18703. longDateFormat: {
  18704. LT: 'H:mm',
  18705. LTS : 'H:mm:ss',
  18706. L: 'DD.MM.YYYY',
  18707. LL: 'D. MMMM YYYY',
  18708. LLL: 'D. MMMM YYYY H:mm',
  18709. LLLL: 'dddd, D. MMMM YYYY H:mm'
  18710. },
  18711. calendar: {
  18712. sameDay: '[danas u] LT',
  18713. nextDay: '[sjutra u] LT',
  18714. nextWeek: function () {
  18715. switch (this.day()) {
  18716. case 0:
  18717. return '[u] [nedjelju] [u] LT';
  18718. case 3:
  18719. return '[u] [srijedu] [u] LT';
  18720. case 6:
  18721. return '[u] [subotu] [u] LT';
  18722. case 1:
  18723. case 2:
  18724. case 4:
  18725. case 5:
  18726. return '[u] dddd [u] LT';
  18727. }
  18728. },
  18729. lastDay : '[juče u] LT',
  18730. lastWeek : function () {
  18731. var lastWeekDays = [
  18732. '[prošle] [nedjelje] [u] LT',
  18733. '[prošlog] [ponedjeljka] [u] LT',
  18734. '[prošlog] [utorka] [u] LT',
  18735. '[prošle] [srijede] [u] LT',
  18736. '[prošlog] [četvrtka] [u] LT',
  18737. '[prošlog] [petka] [u] LT',
  18738. '[prošle] [subote] [u] LT'
  18739. ];
  18740. return lastWeekDays[this.day()];
  18741. },
  18742. sameElse : 'L'
  18743. },
  18744. relativeTime : {
  18745. future : 'za %s',
  18746. past : 'prije %s',
  18747. s : 'nekoliko sekundi',
  18748. m : translator.translate,
  18749. mm : translator.translate,
  18750. h : translator.translate,
  18751. hh : translator.translate,
  18752. d : 'dan',
  18753. dd : translator.translate,
  18754. M : 'mjesec',
  18755. MM : translator.translate,
  18756. y : 'godinu',
  18757. yy : translator.translate
  18758. },
  18759. ordinalParse: /\d{1,2}\./,
  18760. ordinal : '%d.',
  18761. week : {
  18762. dow : 1, // Monday is the first day of the week.
  18763. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18764. }
  18765. });
  18766. return me;
  18767. })));
  18768. /***/ }),
  18769. /* 67 */
  18770. /***/ (function(module, exports, __webpack_require__) {
  18771. //! moment.js locale configuration
  18772. //! locale : Maori [mi]
  18773. //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
  18774. ;(function (global, factory) {
  18775. true ? factory(__webpack_require__(0)) :
  18776. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18777. factory(global.moment)
  18778. }(this, (function (moment) { 'use strict';
  18779. var mi = moment.defineLocale('mi', {
  18780. months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
  18781. monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
  18782. monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18783. monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18784. monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  18785. monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
  18786. weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
  18787. weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  18788. weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  18789. longDateFormat: {
  18790. LT: 'HH:mm',
  18791. LTS: 'HH:mm:ss',
  18792. L: 'DD/MM/YYYY',
  18793. LL: 'D MMMM YYYY',
  18794. LLL: 'D MMMM YYYY [i] HH:mm',
  18795. LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
  18796. },
  18797. calendar: {
  18798. sameDay: '[i teie mahana, i] LT',
  18799. nextDay: '[apopo i] LT',
  18800. nextWeek: 'dddd [i] LT',
  18801. lastDay: '[inanahi i] LT',
  18802. lastWeek: 'dddd [whakamutunga i] LT',
  18803. sameElse: 'L'
  18804. },
  18805. relativeTime: {
  18806. future: 'i roto i %s',
  18807. past: '%s i mua',
  18808. s: 'te hēkona ruarua',
  18809. m: 'he meneti',
  18810. mm: '%d meneti',
  18811. h: 'te haora',
  18812. hh: '%d haora',
  18813. d: 'he ra',
  18814. dd: '%d ra',
  18815. M: 'he marama',
  18816. MM: '%d marama',
  18817. y: 'he tau',
  18818. yy: '%d tau'
  18819. },
  18820. ordinalParse: /\d{1,2}º/,
  18821. ordinal: '%dº',
  18822. week : {
  18823. dow : 1, // Monday is the first day of the week.
  18824. doy : 4 // The week that contains Jan 4th is the first week of the year.
  18825. }
  18826. });
  18827. return mi;
  18828. })));
  18829. /***/ }),
  18830. /* 68 */
  18831. /***/ (function(module, exports, __webpack_require__) {
  18832. //! moment.js locale configuration
  18833. //! locale : Macedonian [mk]
  18834. //! author : Borislav Mickov : https://github.com/B0k0
  18835. ;(function (global, factory) {
  18836. true ? factory(__webpack_require__(0)) :
  18837. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18838. factory(global.moment)
  18839. }(this, (function (moment) { 'use strict';
  18840. var mk = moment.defineLocale('mk', {
  18841. months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
  18842. monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  18843. weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
  18844. weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  18845. weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  18846. longDateFormat : {
  18847. LT : 'H:mm',
  18848. LTS : 'H:mm:ss',
  18849. L : 'D.MM.YYYY',
  18850. LL : 'D MMMM YYYY',
  18851. LLL : 'D MMMM YYYY H:mm',
  18852. LLLL : 'dddd, D MMMM YYYY H:mm'
  18853. },
  18854. calendar : {
  18855. sameDay : '[Денес во] LT',
  18856. nextDay : '[Утре во] LT',
  18857. nextWeek : '[Во] dddd [во] LT',
  18858. lastDay : '[Вчера во] LT',
  18859. lastWeek : function () {
  18860. switch (this.day()) {
  18861. case 0:
  18862. case 3:
  18863. case 6:
  18864. return '[Изминатата] dddd [во] LT';
  18865. case 1:
  18866. case 2:
  18867. case 4:
  18868. case 5:
  18869. return '[Изминатиот] dddd [во] LT';
  18870. }
  18871. },
  18872. sameElse : 'L'
  18873. },
  18874. relativeTime : {
  18875. future : 'после %s',
  18876. past : 'пред %s',
  18877. s : 'неколку секунди',
  18878. m : 'минута',
  18879. mm : '%d минути',
  18880. h : 'час',
  18881. hh : '%d часа',
  18882. d : 'ден',
  18883. dd : '%d дена',
  18884. M : 'месец',
  18885. MM : '%d месеци',
  18886. y : 'година',
  18887. yy : '%d години'
  18888. },
  18889. ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  18890. ordinal : function (number) {
  18891. var lastDigit = number % 10,
  18892. last2Digits = number % 100;
  18893. if (number === 0) {
  18894. return number + '-ев';
  18895. } else if (last2Digits === 0) {
  18896. return number + '-ен';
  18897. } else if (last2Digits > 10 && last2Digits < 20) {
  18898. return number + '-ти';
  18899. } else if (lastDigit === 1) {
  18900. return number + '-ви';
  18901. } else if (lastDigit === 2) {
  18902. return number + '-ри';
  18903. } else if (lastDigit === 7 || lastDigit === 8) {
  18904. return number + '-ми';
  18905. } else {
  18906. return number + '-ти';
  18907. }
  18908. },
  18909. week : {
  18910. dow : 1, // Monday is the first day of the week.
  18911. doy : 7 // The week that contains Jan 1st is the first week of the year.
  18912. }
  18913. });
  18914. return mk;
  18915. })));
  18916. /***/ }),
  18917. /* 69 */
  18918. /***/ (function(module, exports, __webpack_require__) {
  18919. //! moment.js locale configuration
  18920. //! locale : Malayalam [ml]
  18921. //! author : Floyd Pink : https://github.com/floydpink
  18922. ;(function (global, factory) {
  18923. true ? factory(__webpack_require__(0)) :
  18924. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  18925. factory(global.moment)
  18926. }(this, (function (moment) { 'use strict';
  18927. var ml = moment.defineLocale('ml', {
  18928. months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
  18929. monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
  18930. monthsParseExact : true,
  18931. weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
  18932. weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  18933. weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  18934. longDateFormat : {
  18935. LT : 'A h:mm -നു',
  18936. LTS : 'A h:mm:ss -നു',
  18937. L : 'DD/MM/YYYY',
  18938. LL : 'D MMMM YYYY',
  18939. LLL : 'D MMMM YYYY, A h:mm -നു',
  18940. LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
  18941. },
  18942. calendar : {
  18943. sameDay : '[ഇന്ന്] LT',
  18944. nextDay : '[നാളെ] LT',
  18945. nextWeek : 'dddd, LT',
  18946. lastDay : '[ഇന്നലെ] LT',
  18947. lastWeek : '[കഴിഞ്ഞ] dddd, LT',
  18948. sameElse : 'L'
  18949. },
  18950. relativeTime : {
  18951. future : '%s കഴിഞ്ഞ്',
  18952. past : '%s മുൻപ്',
  18953. s : 'അൽപ നിമിഷങ്ങൾ',
  18954. m : 'ഒരു മിനിറ്റ്',
  18955. mm : '%d മിനിറ്റ്',
  18956. h : 'ഒരു മണിക്കൂർ',
  18957. hh : '%d മണിക്കൂർ',
  18958. d : 'ഒരു ദിവസം',
  18959. dd : '%d ദിവസം',
  18960. M : 'ഒരു മാസം',
  18961. MM : '%d മാസം',
  18962. y : 'ഒരു വർഷം',
  18963. yy : '%d വർഷം'
  18964. },
  18965. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  18966. meridiemHour : function (hour, meridiem) {
  18967. if (hour === 12) {
  18968. hour = 0;
  18969. }
  18970. if ((meridiem === 'രാത്രി' && hour >= 4) ||
  18971. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  18972. meridiem === 'വൈകുന്നേരം') {
  18973. return hour + 12;
  18974. } else {
  18975. return hour;
  18976. }
  18977. },
  18978. meridiem : function (hour, minute, isLower) {
  18979. if (hour < 4) {
  18980. return 'രാത്രി';
  18981. } else if (hour < 12) {
  18982. return 'രാവിലെ';
  18983. } else if (hour < 17) {
  18984. return 'ഉച്ച കഴിഞ്ഞ്';
  18985. } else if (hour < 20) {
  18986. return 'വൈകുന്നേരം';
  18987. } else {
  18988. return 'രാത്രി';
  18989. }
  18990. }
  18991. });
  18992. return ml;
  18993. })));
  18994. /***/ }),
  18995. /* 70 */
  18996. /***/ (function(module, exports, __webpack_require__) {
  18997. //! moment.js locale configuration
  18998. //! locale : Marathi [mr]
  18999. //! author : Harshad Kale : https://github.com/kalehv
  19000. //! author : Vivek Athalye : https://github.com/vnathalye
  19001. ;(function (global, factory) {
  19002. true ? factory(__webpack_require__(0)) :
  19003. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19004. factory(global.moment)
  19005. }(this, (function (moment) { 'use strict';
  19006. var symbolMap = {
  19007. '1': '१',
  19008. '2': '२',
  19009. '3': '३',
  19010. '4': '४',
  19011. '5': '५',
  19012. '6': '६',
  19013. '7': '७',
  19014. '8': '८',
  19015. '9': '९',
  19016. '0': '०'
  19017. };
  19018. var numberMap = {
  19019. '१': '1',
  19020. '२': '2',
  19021. '३': '3',
  19022. '४': '4',
  19023. '५': '5',
  19024. '६': '6',
  19025. '७': '7',
  19026. '८': '8',
  19027. '९': '9',
  19028. '०': '0'
  19029. };
  19030. function relativeTimeMr(number, withoutSuffix, string, isFuture)
  19031. {
  19032. var output = '';
  19033. if (withoutSuffix) {
  19034. switch (string) {
  19035. case 's': output = 'काही सेकंद'; break;
  19036. case 'm': output = 'एक मिनिट'; break;
  19037. case 'mm': output = '%d मिनिटे'; break;
  19038. case 'h': output = 'एक तास'; break;
  19039. case 'hh': output = '%d तास'; break;
  19040. case 'd': output = 'एक दिवस'; break;
  19041. case 'dd': output = '%d दिवस'; break;
  19042. case 'M': output = 'एक महिना'; break;
  19043. case 'MM': output = '%d महिने'; break;
  19044. case 'y': output = 'एक वर्ष'; break;
  19045. case 'yy': output = '%d वर्षे'; break;
  19046. }
  19047. }
  19048. else {
  19049. switch (string) {
  19050. case 's': output = 'काही सेकंदां'; break;
  19051. case 'm': output = 'एका मिनिटा'; break;
  19052. case 'mm': output = '%d मिनिटां'; break;
  19053. case 'h': output = 'एका तासा'; break;
  19054. case 'hh': output = '%d तासां'; break;
  19055. case 'd': output = 'एका दिवसा'; break;
  19056. case 'dd': output = '%d दिवसां'; break;
  19057. case 'M': output = 'एका महिन्या'; break;
  19058. case 'MM': output = '%d महिन्यां'; break;
  19059. case 'y': output = 'एका वर्षा'; break;
  19060. case 'yy': output = '%d वर्षां'; break;
  19061. }
  19062. }
  19063. return output.replace(/%d/i, number);
  19064. }
  19065. var mr = moment.defineLocale('mr', {
  19066. months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
  19067. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
  19068. monthsParseExact : true,
  19069. weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  19070. weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  19071. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  19072. longDateFormat : {
  19073. LT : 'A h:mm वाजता',
  19074. LTS : 'A h:mm:ss वाजता',
  19075. L : 'DD/MM/YYYY',
  19076. LL : 'D MMMM YYYY',
  19077. LLL : 'D MMMM YYYY, A h:mm वाजता',
  19078. LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
  19079. },
  19080. calendar : {
  19081. sameDay : '[आज] LT',
  19082. nextDay : '[उद्या] LT',
  19083. nextWeek : 'dddd, LT',
  19084. lastDay : '[काल] LT',
  19085. lastWeek: '[मागील] dddd, LT',
  19086. sameElse : 'L'
  19087. },
  19088. relativeTime : {
  19089. future: '%sमध्ये',
  19090. past: '%sपूर्वी',
  19091. s: relativeTimeMr,
  19092. m: relativeTimeMr,
  19093. mm: relativeTimeMr,
  19094. h: relativeTimeMr,
  19095. hh: relativeTimeMr,
  19096. d: relativeTimeMr,
  19097. dd: relativeTimeMr,
  19098. M: relativeTimeMr,
  19099. MM: relativeTimeMr,
  19100. y: relativeTimeMr,
  19101. yy: relativeTimeMr
  19102. },
  19103. preparse: function (string) {
  19104. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  19105. return numberMap[match];
  19106. });
  19107. },
  19108. postformat: function (string) {
  19109. return string.replace(/\d/g, function (match) {
  19110. return symbolMap[match];
  19111. });
  19112. },
  19113. meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
  19114. meridiemHour : function (hour, meridiem) {
  19115. if (hour === 12) {
  19116. hour = 0;
  19117. }
  19118. if (meridiem === 'रात्री') {
  19119. return hour < 4 ? hour : hour + 12;
  19120. } else if (meridiem === 'सकाळी') {
  19121. return hour;
  19122. } else if (meridiem === 'दुपारी') {
  19123. return hour >= 10 ? hour : hour + 12;
  19124. } else if (meridiem === 'सायंकाळी') {
  19125. return hour + 12;
  19126. }
  19127. },
  19128. meridiem: function (hour, minute, isLower) {
  19129. if (hour < 4) {
  19130. return 'रात्री';
  19131. } else if (hour < 10) {
  19132. return 'सकाळी';
  19133. } else if (hour < 17) {
  19134. return 'दुपारी';
  19135. } else if (hour < 20) {
  19136. return 'सायंकाळी';
  19137. } else {
  19138. return 'रात्री';
  19139. }
  19140. },
  19141. week : {
  19142. dow : 0, // Sunday is the first day of the week.
  19143. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19144. }
  19145. });
  19146. return mr;
  19147. })));
  19148. /***/ }),
  19149. /* 71 */
  19150. /***/ (function(module, exports, __webpack_require__) {
  19151. //! moment.js locale configuration
  19152. //! locale : Malay [ms-my]
  19153. //! note : DEPRECATED, the correct one is [ms]
  19154. //! author : Weldan Jamili : https://github.com/weldan
  19155. ;(function (global, factory) {
  19156. true ? factory(__webpack_require__(0)) :
  19157. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19158. factory(global.moment)
  19159. }(this, (function (moment) { 'use strict';
  19160. var msMy = moment.defineLocale('ms-my', {
  19161. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  19162. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  19163. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  19164. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  19165. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  19166. longDateFormat : {
  19167. LT : 'HH.mm',
  19168. LTS : 'HH.mm.ss',
  19169. L : 'DD/MM/YYYY',
  19170. LL : 'D MMMM YYYY',
  19171. LLL : 'D MMMM YYYY [pukul] HH.mm',
  19172. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  19173. },
  19174. meridiemParse: /pagi|tengahari|petang|malam/,
  19175. meridiemHour: function (hour, meridiem) {
  19176. if (hour === 12) {
  19177. hour = 0;
  19178. }
  19179. if (meridiem === 'pagi') {
  19180. return hour;
  19181. } else if (meridiem === 'tengahari') {
  19182. return hour >= 11 ? hour : hour + 12;
  19183. } else if (meridiem === 'petang' || meridiem === 'malam') {
  19184. return hour + 12;
  19185. }
  19186. },
  19187. meridiem : function (hours, minutes, isLower) {
  19188. if (hours < 11) {
  19189. return 'pagi';
  19190. } else if (hours < 15) {
  19191. return 'tengahari';
  19192. } else if (hours < 19) {
  19193. return 'petang';
  19194. } else {
  19195. return 'malam';
  19196. }
  19197. },
  19198. calendar : {
  19199. sameDay : '[Hari ini pukul] LT',
  19200. nextDay : '[Esok pukul] LT',
  19201. nextWeek : 'dddd [pukul] LT',
  19202. lastDay : '[Kelmarin pukul] LT',
  19203. lastWeek : 'dddd [lepas pukul] LT',
  19204. sameElse : 'L'
  19205. },
  19206. relativeTime : {
  19207. future : 'dalam %s',
  19208. past : '%s yang lepas',
  19209. s : 'beberapa saat',
  19210. m : 'seminit',
  19211. mm : '%d minit',
  19212. h : 'sejam',
  19213. hh : '%d jam',
  19214. d : 'sehari',
  19215. dd : '%d hari',
  19216. M : 'sebulan',
  19217. MM : '%d bulan',
  19218. y : 'setahun',
  19219. yy : '%d tahun'
  19220. },
  19221. week : {
  19222. dow : 1, // Monday is the first day of the week.
  19223. doy : 7 // The week that contains Jan 1st is the first week of the year.
  19224. }
  19225. });
  19226. return msMy;
  19227. })));
  19228. /***/ }),
  19229. /* 72 */
  19230. /***/ (function(module, exports, __webpack_require__) {
  19231. //! moment.js locale configuration
  19232. //! locale : Malay [ms]
  19233. //! author : Weldan Jamili : https://github.com/weldan
  19234. ;(function (global, factory) {
  19235. true ? factory(__webpack_require__(0)) :
  19236. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19237. factory(global.moment)
  19238. }(this, (function (moment) { 'use strict';
  19239. var ms = moment.defineLocale('ms', {
  19240. months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
  19241. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  19242. weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  19243. weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  19244. weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  19245. longDateFormat : {
  19246. LT : 'HH.mm',
  19247. LTS : 'HH.mm.ss',
  19248. L : 'DD/MM/YYYY',
  19249. LL : 'D MMMM YYYY',
  19250. LLL : 'D MMMM YYYY [pukul] HH.mm',
  19251. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  19252. },
  19253. meridiemParse: /pagi|tengahari|petang|malam/,
  19254. meridiemHour: function (hour, meridiem) {
  19255. if (hour === 12) {
  19256. hour = 0;
  19257. }
  19258. if (meridiem === 'pagi') {
  19259. return hour;
  19260. } else if (meridiem === 'tengahari') {
  19261. return hour >= 11 ? hour : hour + 12;
  19262. } else if (meridiem === 'petang' || meridiem === 'malam') {
  19263. return hour + 12;
  19264. }
  19265. },
  19266. meridiem : function (hours, minutes, isLower) {
  19267. if (hours < 11) {
  19268. return 'pagi';
  19269. } else if (hours < 15) {
  19270. return 'tengahari';
  19271. } else if (hours < 19) {
  19272. return 'petang';
  19273. } else {
  19274. return 'malam';
  19275. }
  19276. },
  19277. calendar : {
  19278. sameDay : '[Hari ini pukul] LT',
  19279. nextDay : '[Esok pukul] LT',
  19280. nextWeek : 'dddd [pukul] LT',
  19281. lastDay : '[Kelmarin pukul] LT',
  19282. lastWeek : 'dddd [lepas pukul] LT',
  19283. sameElse : 'L'
  19284. },
  19285. relativeTime : {
  19286. future : 'dalam %s',
  19287. past : '%s yang lepas',
  19288. s : 'beberapa saat',
  19289. m : 'seminit',
  19290. mm : '%d minit',
  19291. h : 'sejam',
  19292. hh : '%d jam',
  19293. d : 'sehari',
  19294. dd : '%d hari',
  19295. M : 'sebulan',
  19296. MM : '%d bulan',
  19297. y : 'setahun',
  19298. yy : '%d tahun'
  19299. },
  19300. week : {
  19301. dow : 1, // Monday is the first day of the week.
  19302. doy : 7 // The week that contains Jan 1st is the first week of the year.
  19303. }
  19304. });
  19305. return ms;
  19306. })));
  19307. /***/ }),
  19308. /* 73 */
  19309. /***/ (function(module, exports, __webpack_require__) {
  19310. //! moment.js locale configuration
  19311. //! locale : Burmese [my]
  19312. //! author : Squar team, mysquar.com
  19313. //! author : David Rossellat : https://github.com/gholadr
  19314. //! author : Tin Aung Lin : https://github.com/thanyawzinmin
  19315. ;(function (global, factory) {
  19316. true ? factory(__webpack_require__(0)) :
  19317. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19318. factory(global.moment)
  19319. }(this, (function (moment) { 'use strict';
  19320. var symbolMap = {
  19321. '1': '၁',
  19322. '2': '၂',
  19323. '3': '၃',
  19324. '4': '၄',
  19325. '5': '၅',
  19326. '6': '၆',
  19327. '7': '၇',
  19328. '8': '၈',
  19329. '9': '၉',
  19330. '0': '၀'
  19331. };
  19332. var numberMap = {
  19333. '၁': '1',
  19334. '၂': '2',
  19335. '၃': '3',
  19336. '၄': '4',
  19337. '၅': '5',
  19338. '၆': '6',
  19339. '၇': '7',
  19340. '၈': '8',
  19341. '၉': '9',
  19342. '၀': '0'
  19343. };
  19344. var my = moment.defineLocale('my', {
  19345. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
  19346. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  19347. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
  19348. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  19349. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  19350. longDateFormat: {
  19351. LT: 'HH:mm',
  19352. LTS: 'HH:mm:ss',
  19353. L: 'DD/MM/YYYY',
  19354. LL: 'D MMMM YYYY',
  19355. LLL: 'D MMMM YYYY HH:mm',
  19356. LLLL: 'dddd D MMMM YYYY HH:mm'
  19357. },
  19358. calendar: {
  19359. sameDay: '[ယနေ.] LT [မှာ]',
  19360. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  19361. nextWeek: 'dddd LT [မှာ]',
  19362. lastDay: '[မနေ.က] LT [မှာ]',
  19363. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  19364. sameElse: 'L'
  19365. },
  19366. relativeTime: {
  19367. future: 'လာမည့် %s မှာ',
  19368. past: 'လွန်ခဲ့သော %s က',
  19369. s: 'စက္ကန်.အနည်းငယ်',
  19370. m: 'တစ်မိနစ်',
  19371. mm: '%d မိနစ်',
  19372. h: 'တစ်နာရီ',
  19373. hh: '%d နာရီ',
  19374. d: 'တစ်ရက်',
  19375. dd: '%d ရက်',
  19376. M: 'တစ်လ',
  19377. MM: '%d လ',
  19378. y: 'တစ်နှစ်',
  19379. yy: '%d နှစ်'
  19380. },
  19381. preparse: function (string) {
  19382. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  19383. return numberMap[match];
  19384. });
  19385. },
  19386. postformat: function (string) {
  19387. return string.replace(/\d/g, function (match) {
  19388. return symbolMap[match];
  19389. });
  19390. },
  19391. week: {
  19392. dow: 1, // Monday is the first day of the week.
  19393. doy: 4 // The week that contains Jan 1st is the first week of the year.
  19394. }
  19395. });
  19396. return my;
  19397. })));
  19398. /***/ }),
  19399. /* 74 */
  19400. /***/ (function(module, exports, __webpack_require__) {
  19401. //! moment.js locale configuration
  19402. //! locale : Norwegian Bokmål [nb]
  19403. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  19404. //! Sigurd Gartmann : https://github.com/sigurdga
  19405. ;(function (global, factory) {
  19406. true ? factory(__webpack_require__(0)) :
  19407. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19408. factory(global.moment)
  19409. }(this, (function (moment) { 'use strict';
  19410. var nb = moment.defineLocale('nb', {
  19411. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  19412. monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
  19413. monthsParseExact : true,
  19414. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  19415. weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  19416. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  19417. weekdaysParseExact : true,
  19418. longDateFormat : {
  19419. LT : 'HH:mm',
  19420. LTS : 'HH:mm:ss',
  19421. L : 'DD.MM.YYYY',
  19422. LL : 'D. MMMM YYYY',
  19423. LLL : 'D. MMMM YYYY [kl.] HH:mm',
  19424. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  19425. },
  19426. calendar : {
  19427. sameDay: '[i dag kl.] LT',
  19428. nextDay: '[i morgen kl.] LT',
  19429. nextWeek: 'dddd [kl.] LT',
  19430. lastDay: '[i går kl.] LT',
  19431. lastWeek: '[forrige] dddd [kl.] LT',
  19432. sameElse: 'L'
  19433. },
  19434. relativeTime : {
  19435. future : 'om %s',
  19436. past : '%s siden',
  19437. s : 'noen sekunder',
  19438. m : 'ett minutt',
  19439. mm : '%d minutter',
  19440. h : 'en time',
  19441. hh : '%d timer',
  19442. d : 'en dag',
  19443. dd : '%d dager',
  19444. M : 'en måned',
  19445. MM : '%d måneder',
  19446. y : 'ett år',
  19447. yy : '%d år'
  19448. },
  19449. ordinalParse: /\d{1,2}\./,
  19450. ordinal : '%d.',
  19451. week : {
  19452. dow : 1, // Monday is the first day of the week.
  19453. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19454. }
  19455. });
  19456. return nb;
  19457. })));
  19458. /***/ }),
  19459. /* 75 */
  19460. /***/ (function(module, exports, __webpack_require__) {
  19461. //! moment.js locale configuration
  19462. //! locale : Nepalese [ne]
  19463. //! author : suvash : https://github.com/suvash
  19464. ;(function (global, factory) {
  19465. true ? factory(__webpack_require__(0)) :
  19466. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19467. factory(global.moment)
  19468. }(this, (function (moment) { 'use strict';
  19469. var symbolMap = {
  19470. '1': '१',
  19471. '2': '२',
  19472. '3': '३',
  19473. '4': '४',
  19474. '5': '५',
  19475. '6': '६',
  19476. '7': '७',
  19477. '8': '८',
  19478. '9': '९',
  19479. '0': '०'
  19480. };
  19481. var numberMap = {
  19482. '१': '1',
  19483. '२': '2',
  19484. '३': '3',
  19485. '४': '4',
  19486. '५': '5',
  19487. '६': '6',
  19488. '७': '7',
  19489. '८': '8',
  19490. '९': '9',
  19491. '०': '0'
  19492. };
  19493. var ne = moment.defineLocale('ne', {
  19494. months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
  19495. monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
  19496. monthsParseExact : true,
  19497. weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
  19498. weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  19499. weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  19500. weekdaysParseExact : true,
  19501. longDateFormat : {
  19502. LT : 'Aको h:mm बजे',
  19503. LTS : 'Aको h:mm:ss बजे',
  19504. L : 'DD/MM/YYYY',
  19505. LL : 'D MMMM YYYY',
  19506. LLL : 'D MMMM YYYY, Aको h:mm बजे',
  19507. LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
  19508. },
  19509. preparse: function (string) {
  19510. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  19511. return numberMap[match];
  19512. });
  19513. },
  19514. postformat: function (string) {
  19515. return string.replace(/\d/g, function (match) {
  19516. return symbolMap[match];
  19517. });
  19518. },
  19519. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  19520. meridiemHour : function (hour, meridiem) {
  19521. if (hour === 12) {
  19522. hour = 0;
  19523. }
  19524. if (meridiem === 'राति') {
  19525. return hour < 4 ? hour : hour + 12;
  19526. } else if (meridiem === 'बिहान') {
  19527. return hour;
  19528. } else if (meridiem === 'दिउँसो') {
  19529. return hour >= 10 ? hour : hour + 12;
  19530. } else if (meridiem === 'साँझ') {
  19531. return hour + 12;
  19532. }
  19533. },
  19534. meridiem : function (hour, minute, isLower) {
  19535. if (hour < 3) {
  19536. return 'राति';
  19537. } else if (hour < 12) {
  19538. return 'बिहान';
  19539. } else if (hour < 16) {
  19540. return 'दिउँसो';
  19541. } else if (hour < 20) {
  19542. return 'साँझ';
  19543. } else {
  19544. return 'राति';
  19545. }
  19546. },
  19547. calendar : {
  19548. sameDay : '[आज] LT',
  19549. nextDay : '[भोलि] LT',
  19550. nextWeek : '[आउँदो] dddd[,] LT',
  19551. lastDay : '[हिजो] LT',
  19552. lastWeek : '[गएको] dddd[,] LT',
  19553. sameElse : 'L'
  19554. },
  19555. relativeTime : {
  19556. future : '%sमा',
  19557. past : '%s अगाडि',
  19558. s : 'केही क्षण',
  19559. m : 'एक मिनेट',
  19560. mm : '%d मिनेट',
  19561. h : 'एक घण्टा',
  19562. hh : '%d घण्टा',
  19563. d : 'एक दिन',
  19564. dd : '%d दिन',
  19565. M : 'एक महिना',
  19566. MM : '%d महिना',
  19567. y : 'एक बर्ष',
  19568. yy : '%d बर्ष'
  19569. },
  19570. week : {
  19571. dow : 0, // Sunday is the first day of the week.
  19572. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19573. }
  19574. });
  19575. return ne;
  19576. })));
  19577. /***/ }),
  19578. /* 76 */
  19579. /***/ (function(module, exports, __webpack_require__) {
  19580. //! moment.js locale configuration
  19581. //! locale : Dutch (Belgium) [nl-be]
  19582. //! author : Joris Röling : https://github.com/jorisroling
  19583. //! author : Jacob Middag : https://github.com/middagj
  19584. ;(function (global, factory) {
  19585. true ? factory(__webpack_require__(0)) :
  19586. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19587. factory(global.moment)
  19588. }(this, (function (moment) { 'use strict';
  19589. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  19590. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  19591. var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
  19592. var monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  19593. var nlBe = moment.defineLocale('nl-be', {
  19594. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  19595. monthsShort : function (m, format) {
  19596. if (/-MMM-/.test(format)) {
  19597. return monthsShortWithoutDots[m.month()];
  19598. } else {
  19599. return monthsShortWithDots[m.month()];
  19600. }
  19601. },
  19602. monthsRegex: monthsRegex,
  19603. monthsShortRegex: monthsRegex,
  19604. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  19605. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  19606. monthsParse : monthsParse,
  19607. longMonthsParse : monthsParse,
  19608. shortMonthsParse : monthsParse,
  19609. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  19610. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  19611. weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
  19612. weekdaysParseExact : true,
  19613. longDateFormat : {
  19614. LT : 'HH:mm',
  19615. LTS : 'HH:mm:ss',
  19616. L : 'DD/MM/YYYY',
  19617. LL : 'D MMMM YYYY',
  19618. LLL : 'D MMMM YYYY HH:mm',
  19619. LLLL : 'dddd D MMMM YYYY HH:mm'
  19620. },
  19621. calendar : {
  19622. sameDay: '[vandaag om] LT',
  19623. nextDay: '[morgen om] LT',
  19624. nextWeek: 'dddd [om] LT',
  19625. lastDay: '[gisteren om] LT',
  19626. lastWeek: '[afgelopen] dddd [om] LT',
  19627. sameElse: 'L'
  19628. },
  19629. relativeTime : {
  19630. future : 'over %s',
  19631. past : '%s geleden',
  19632. s : 'een paar seconden',
  19633. m : 'één minuut',
  19634. mm : '%d minuten',
  19635. h : 'één uur',
  19636. hh : '%d uur',
  19637. d : 'één dag',
  19638. dd : '%d dagen',
  19639. M : 'één maand',
  19640. MM : '%d maanden',
  19641. y : 'één jaar',
  19642. yy : '%d jaar'
  19643. },
  19644. ordinalParse: /\d{1,2}(ste|de)/,
  19645. ordinal : function (number) {
  19646. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  19647. },
  19648. week : {
  19649. dow : 1, // Monday is the first day of the week.
  19650. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19651. }
  19652. });
  19653. return nlBe;
  19654. })));
  19655. /***/ }),
  19656. /* 77 */
  19657. /***/ (function(module, exports, __webpack_require__) {
  19658. //! moment.js locale configuration
  19659. //! locale : Dutch [nl]
  19660. //! author : Joris Röling : https://github.com/jorisroling
  19661. //! author : Jacob Middag : https://github.com/middagj
  19662. ;(function (global, factory) {
  19663. true ? factory(__webpack_require__(0)) :
  19664. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19665. factory(global.moment)
  19666. }(this, (function (moment) { 'use strict';
  19667. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  19668. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  19669. var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
  19670. var monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  19671. var nl = moment.defineLocale('nl', {
  19672. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  19673. monthsShort : function (m, format) {
  19674. if (/-MMM-/.test(format)) {
  19675. return monthsShortWithoutDots[m.month()];
  19676. } else {
  19677. return monthsShortWithDots[m.month()];
  19678. }
  19679. },
  19680. monthsRegex: monthsRegex,
  19681. monthsShortRegex: monthsRegex,
  19682. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  19683. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  19684. monthsParse : monthsParse,
  19685. longMonthsParse : monthsParse,
  19686. shortMonthsParse : monthsParse,
  19687. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  19688. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  19689. weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'),
  19690. weekdaysParseExact : true,
  19691. longDateFormat : {
  19692. LT : 'HH:mm',
  19693. LTS : 'HH:mm:ss',
  19694. L : 'DD-MM-YYYY',
  19695. LL : 'D MMMM YYYY',
  19696. LLL : 'D MMMM YYYY HH:mm',
  19697. LLLL : 'dddd D MMMM YYYY HH:mm'
  19698. },
  19699. calendar : {
  19700. sameDay: '[vandaag om] LT',
  19701. nextDay: '[morgen om] LT',
  19702. nextWeek: 'dddd [om] LT',
  19703. lastDay: '[gisteren om] LT',
  19704. lastWeek: '[afgelopen] dddd [om] LT',
  19705. sameElse: 'L'
  19706. },
  19707. relativeTime : {
  19708. future : 'over %s',
  19709. past : '%s geleden',
  19710. s : 'een paar seconden',
  19711. m : 'één minuut',
  19712. mm : '%d minuten',
  19713. h : 'één uur',
  19714. hh : '%d uur',
  19715. d : 'één dag',
  19716. dd : '%d dagen',
  19717. M : 'één maand',
  19718. MM : '%d maanden',
  19719. y : 'één jaar',
  19720. yy : '%d jaar'
  19721. },
  19722. ordinalParse: /\d{1,2}(ste|de)/,
  19723. ordinal : function (number) {
  19724. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  19725. },
  19726. week : {
  19727. dow : 1, // Monday is the first day of the week.
  19728. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19729. }
  19730. });
  19731. return nl;
  19732. })));
  19733. /***/ }),
  19734. /* 78 */
  19735. /***/ (function(module, exports, __webpack_require__) {
  19736. //! moment.js locale configuration
  19737. //! locale : Nynorsk [nn]
  19738. //! author : https://github.com/mechuwind
  19739. ;(function (global, factory) {
  19740. true ? factory(__webpack_require__(0)) :
  19741. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19742. factory(global.moment)
  19743. }(this, (function (moment) { 'use strict';
  19744. var nn = moment.defineLocale('nn', {
  19745. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  19746. monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  19747. weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  19748. weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
  19749. weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
  19750. longDateFormat : {
  19751. LT : 'HH:mm',
  19752. LTS : 'HH:mm:ss',
  19753. L : 'DD.MM.YYYY',
  19754. LL : 'D. MMMM YYYY',
  19755. LLL : 'D. MMMM YYYY [kl.] H:mm',
  19756. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  19757. },
  19758. calendar : {
  19759. sameDay: '[I dag klokka] LT',
  19760. nextDay: '[I morgon klokka] LT',
  19761. nextWeek: 'dddd [klokka] LT',
  19762. lastDay: '[I går klokka] LT',
  19763. lastWeek: '[Føregåande] dddd [klokka] LT',
  19764. sameElse: 'L'
  19765. },
  19766. relativeTime : {
  19767. future : 'om %s',
  19768. past : '%s sidan',
  19769. s : 'nokre sekund',
  19770. m : 'eit minutt',
  19771. mm : '%d minutt',
  19772. h : 'ein time',
  19773. hh : '%d timar',
  19774. d : 'ein dag',
  19775. dd : '%d dagar',
  19776. M : 'ein månad',
  19777. MM : '%d månader',
  19778. y : 'eit år',
  19779. yy : '%d år'
  19780. },
  19781. ordinalParse: /\d{1,2}\./,
  19782. ordinal : '%d.',
  19783. week : {
  19784. dow : 1, // Monday is the first day of the week.
  19785. doy : 4 // The week that contains Jan 4th is the first week of the year.
  19786. }
  19787. });
  19788. return nn;
  19789. })));
  19790. /***/ }),
  19791. /* 79 */
  19792. /***/ (function(module, exports, __webpack_require__) {
  19793. //! moment.js locale configuration
  19794. //! locale : Punjabi (India) [pa-in]
  19795. //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
  19796. ;(function (global, factory) {
  19797. true ? factory(__webpack_require__(0)) :
  19798. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19799. factory(global.moment)
  19800. }(this, (function (moment) { 'use strict';
  19801. var symbolMap = {
  19802. '1': '੧',
  19803. '2': '੨',
  19804. '3': '੩',
  19805. '4': '੪',
  19806. '5': '੫',
  19807. '6': '੬',
  19808. '7': '੭',
  19809. '8': '੮',
  19810. '9': '੯',
  19811. '0': '੦'
  19812. };
  19813. var numberMap = {
  19814. '੧': '1',
  19815. '੨': '2',
  19816. '੩': '3',
  19817. '੪': '4',
  19818. '੫': '5',
  19819. '੬': '6',
  19820. '੭': '7',
  19821. '੮': '8',
  19822. '੯': '9',
  19823. '੦': '0'
  19824. };
  19825. var paIn = moment.defineLocale('pa-in', {
  19826. // There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.
  19827. months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  19828. monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
  19829. weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
  19830. weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  19831. weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  19832. longDateFormat : {
  19833. LT : 'A h:mm ਵਜੇ',
  19834. LTS : 'A h:mm:ss ਵਜੇ',
  19835. L : 'DD/MM/YYYY',
  19836. LL : 'D MMMM YYYY',
  19837. LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',
  19838. LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
  19839. },
  19840. calendar : {
  19841. sameDay : '[ਅਜ] LT',
  19842. nextDay : '[ਕਲ] LT',
  19843. nextWeek : 'dddd, LT',
  19844. lastDay : '[ਕਲ] LT',
  19845. lastWeek : '[ਪਿਛਲੇ] dddd, LT',
  19846. sameElse : 'L'
  19847. },
  19848. relativeTime : {
  19849. future : '%s ਵਿੱਚ',
  19850. past : '%s ਪਿਛਲੇ',
  19851. s : 'ਕੁਝ ਸਕਿੰਟ',
  19852. m : 'ਇਕ ਮਿੰਟ',
  19853. mm : '%d ਮਿੰਟ',
  19854. h : 'ਇੱਕ ਘੰਟਾ',
  19855. hh : '%d ਘੰਟੇ',
  19856. d : 'ਇੱਕ ਦਿਨ',
  19857. dd : '%d ਦਿਨ',
  19858. M : 'ਇੱਕ ਮਹੀਨਾ',
  19859. MM : '%d ਮਹੀਨੇ',
  19860. y : 'ਇੱਕ ਸਾਲ',
  19861. yy : '%d ਸਾਲ'
  19862. },
  19863. preparse: function (string) {
  19864. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  19865. return numberMap[match];
  19866. });
  19867. },
  19868. postformat: function (string) {
  19869. return string.replace(/\d/g, function (match) {
  19870. return symbolMap[match];
  19871. });
  19872. },
  19873. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  19874. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  19875. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  19876. meridiemHour : function (hour, meridiem) {
  19877. if (hour === 12) {
  19878. hour = 0;
  19879. }
  19880. if (meridiem === 'ਰਾਤ') {
  19881. return hour < 4 ? hour : hour + 12;
  19882. } else if (meridiem === 'ਸਵੇਰ') {
  19883. return hour;
  19884. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  19885. return hour >= 10 ? hour : hour + 12;
  19886. } else if (meridiem === 'ਸ਼ਾਮ') {
  19887. return hour + 12;
  19888. }
  19889. },
  19890. meridiem : function (hour, minute, isLower) {
  19891. if (hour < 4) {
  19892. return 'ਰਾਤ';
  19893. } else if (hour < 10) {
  19894. return 'ਸਵੇਰ';
  19895. } else if (hour < 17) {
  19896. return 'ਦੁਪਹਿਰ';
  19897. } else if (hour < 20) {
  19898. return 'ਸ਼ਾਮ';
  19899. } else {
  19900. return 'ਰਾਤ';
  19901. }
  19902. },
  19903. week : {
  19904. dow : 0, // Sunday is the first day of the week.
  19905. doy : 6 // The week that contains Jan 1st is the first week of the year.
  19906. }
  19907. });
  19908. return paIn;
  19909. })));
  19910. /***/ }),
  19911. /* 80 */
  19912. /***/ (function(module, exports, __webpack_require__) {
  19913. //! moment.js locale configuration
  19914. //! locale : Polish [pl]
  19915. //! author : Rafal Hirsz : https://github.com/evoL
  19916. ;(function (global, factory) {
  19917. true ? factory(__webpack_require__(0)) :
  19918. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  19919. factory(global.moment)
  19920. }(this, (function (moment) { 'use strict';
  19921. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
  19922. var monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
  19923. function plural(n) {
  19924. return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
  19925. }
  19926. function translate(number, withoutSuffix, key) {
  19927. var result = number + ' ';
  19928. switch (key) {
  19929. case 'm':
  19930. return withoutSuffix ? 'minuta' : 'minutę';
  19931. case 'mm':
  19932. return result + (plural(number) ? 'minuty' : 'minut');
  19933. case 'h':
  19934. return withoutSuffix ? 'godzina' : 'godzinę';
  19935. case 'hh':
  19936. return result + (plural(number) ? 'godziny' : 'godzin');
  19937. case 'MM':
  19938. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  19939. case 'yy':
  19940. return result + (plural(number) ? 'lata' : 'lat');
  19941. }
  19942. }
  19943. var pl = moment.defineLocale('pl', {
  19944. months : function (momentToFormat, format) {
  19945. if (format === '') {
  19946. // Hack: if format empty we know this is used to generate
  19947. // RegExp by moment. Give then back both valid forms of months
  19948. // in RegExp ready format.
  19949. return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
  19950. } else if (/D MMMM/.test(format)) {
  19951. return monthsSubjective[momentToFormat.month()];
  19952. } else {
  19953. return monthsNominative[momentToFormat.month()];
  19954. }
  19955. },
  19956. monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  19957. weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
  19958. weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  19959. weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  19960. longDateFormat : {
  19961. LT : 'HH:mm',
  19962. LTS : 'HH:mm:ss',
  19963. L : 'DD.MM.YYYY',
  19964. LL : 'D MMMM YYYY',
  19965. LLL : 'D MMMM YYYY HH:mm',
  19966. LLLL : 'dddd, D MMMM YYYY HH:mm'
  19967. },
  19968. calendar : {
  19969. sameDay: '[Dziś o] LT',
  19970. nextDay: '[Jutro o] LT',
  19971. nextWeek: '[W] dddd [o] LT',
  19972. lastDay: '[Wczoraj o] LT',
  19973. lastWeek: function () {
  19974. switch (this.day()) {
  19975. case 0:
  19976. return '[W zeszłą niedzielę o] LT';
  19977. case 3:
  19978. return '[W zeszłą środę o] LT';
  19979. case 6:
  19980. return '[W zeszłą sobotę o] LT';
  19981. default:
  19982. return '[W zeszły] dddd [o] LT';
  19983. }
  19984. },
  19985. sameElse: 'L'
  19986. },
  19987. relativeTime : {
  19988. future : 'za %s',
  19989. past : '%s temu',
  19990. s : 'kilka sekund',
  19991. m : translate,
  19992. mm : translate,
  19993. h : translate,
  19994. hh : translate,
  19995. d : '1 dzień',
  19996. dd : '%d dni',
  19997. M : 'miesiąc',
  19998. MM : translate,
  19999. y : 'rok',
  20000. yy : translate
  20001. },
  20002. ordinalParse: /\d{1,2}\./,
  20003. ordinal : '%d.',
  20004. week : {
  20005. dow : 1, // Monday is the first day of the week.
  20006. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20007. }
  20008. });
  20009. return pl;
  20010. })));
  20011. /***/ }),
  20012. /* 81 */
  20013. /***/ (function(module, exports, __webpack_require__) {
  20014. //! moment.js locale configuration
  20015. //! locale : Portuguese (Brazil) [pt-br]
  20016. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  20017. ;(function (global, factory) {
  20018. true ? factory(__webpack_require__(0)) :
  20019. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20020. factory(global.moment)
  20021. }(this, (function (moment) { 'use strict';
  20022. var ptBr = moment.defineLocale('pt-br', {
  20023. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  20024. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  20025. weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
  20026. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  20027. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  20028. weekdaysParseExact : true,
  20029. longDateFormat : {
  20030. LT : 'HH:mm',
  20031. LTS : 'HH:mm:ss',
  20032. L : 'DD/MM/YYYY',
  20033. LL : 'D [de] MMMM [de] YYYY',
  20034. LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
  20035. LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
  20036. },
  20037. calendar : {
  20038. sameDay: '[Hoje às] LT',
  20039. nextDay: '[Amanhã às] LT',
  20040. nextWeek: 'dddd [às] LT',
  20041. lastDay: '[Ontem às] LT',
  20042. lastWeek: function () {
  20043. return (this.day() === 0 || this.day() === 6) ?
  20044. '[Último] dddd [às] LT' : // Saturday + Sunday
  20045. '[Última] dddd [às] LT'; // Monday - Friday
  20046. },
  20047. sameElse: 'L'
  20048. },
  20049. relativeTime : {
  20050. future : 'em %s',
  20051. past : '%s atrás',
  20052. s : 'poucos segundos',
  20053. m : 'um minuto',
  20054. mm : '%d minutos',
  20055. h : 'uma hora',
  20056. hh : '%d horas',
  20057. d : 'um dia',
  20058. dd : '%d dias',
  20059. M : 'um mês',
  20060. MM : '%d meses',
  20061. y : 'um ano',
  20062. yy : '%d anos'
  20063. },
  20064. ordinalParse: /\d{1,2}º/,
  20065. ordinal : '%dº'
  20066. });
  20067. return ptBr;
  20068. })));
  20069. /***/ }),
  20070. /* 82 */
  20071. /***/ (function(module, exports, __webpack_require__) {
  20072. //! moment.js locale configuration
  20073. //! locale : Portuguese [pt]
  20074. //! author : Jefferson : https://github.com/jalex79
  20075. ;(function (global, factory) {
  20076. true ? factory(__webpack_require__(0)) :
  20077. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20078. factory(global.moment)
  20079. }(this, (function (moment) { 'use strict';
  20080. var pt = moment.defineLocale('pt', {
  20081. months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  20082. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  20083. weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'),
  20084. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  20085. weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'),
  20086. weekdaysParseExact : true,
  20087. longDateFormat : {
  20088. LT : 'HH:mm',
  20089. LTS : 'HH:mm:ss',
  20090. L : 'DD/MM/YYYY',
  20091. LL : 'D [de] MMMM [de] YYYY',
  20092. LLL : 'D [de] MMMM [de] YYYY HH:mm',
  20093. LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
  20094. },
  20095. calendar : {
  20096. sameDay: '[Hoje às] LT',
  20097. nextDay: '[Amanhã às] LT',
  20098. nextWeek: 'dddd [às] LT',
  20099. lastDay: '[Ontem às] LT',
  20100. lastWeek: function () {
  20101. return (this.day() === 0 || this.day() === 6) ?
  20102. '[Último] dddd [às] LT' : // Saturday + Sunday
  20103. '[Última] dddd [às] LT'; // Monday - Friday
  20104. },
  20105. sameElse: 'L'
  20106. },
  20107. relativeTime : {
  20108. future : 'em %s',
  20109. past : 'há %s',
  20110. s : 'segundos',
  20111. m : 'um minuto',
  20112. mm : '%d minutos',
  20113. h : 'uma hora',
  20114. hh : '%d horas',
  20115. d : 'um dia',
  20116. dd : '%d dias',
  20117. M : 'um mês',
  20118. MM : '%d meses',
  20119. y : 'um ano',
  20120. yy : '%d anos'
  20121. },
  20122. ordinalParse: /\d{1,2}º/,
  20123. ordinal : '%dº',
  20124. week : {
  20125. dow : 1, // Monday is the first day of the week.
  20126. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20127. }
  20128. });
  20129. return pt;
  20130. })));
  20131. /***/ }),
  20132. /* 83 */
  20133. /***/ (function(module, exports, __webpack_require__) {
  20134. //! moment.js locale configuration
  20135. //! locale : Romanian [ro]
  20136. //! author : Vlad Gurdiga : https://github.com/gurdiga
  20137. //! author : Valentin Agachi : https://github.com/avaly
  20138. ;(function (global, factory) {
  20139. true ? factory(__webpack_require__(0)) :
  20140. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20141. factory(global.moment)
  20142. }(this, (function (moment) { 'use strict';
  20143. function relativeTimeWithPlural(number, withoutSuffix, key) {
  20144. var format = {
  20145. 'mm': 'minute',
  20146. 'hh': 'ore',
  20147. 'dd': 'zile',
  20148. 'MM': 'luni',
  20149. 'yy': 'ani'
  20150. },
  20151. separator = ' ';
  20152. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  20153. separator = ' de ';
  20154. }
  20155. return number + separator + format[key];
  20156. }
  20157. var ro = moment.defineLocale('ro', {
  20158. months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  20159. monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  20160. monthsParseExact: true,
  20161. weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  20162. weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  20163. weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  20164. longDateFormat : {
  20165. LT : 'H:mm',
  20166. LTS : 'H:mm:ss',
  20167. L : 'DD.MM.YYYY',
  20168. LL : 'D MMMM YYYY',
  20169. LLL : 'D MMMM YYYY H:mm',
  20170. LLLL : 'dddd, D MMMM YYYY H:mm'
  20171. },
  20172. calendar : {
  20173. sameDay: '[azi la] LT',
  20174. nextDay: '[mâine la] LT',
  20175. nextWeek: 'dddd [la] LT',
  20176. lastDay: '[ieri la] LT',
  20177. lastWeek: '[fosta] dddd [la] LT',
  20178. sameElse: 'L'
  20179. },
  20180. relativeTime : {
  20181. future : 'peste %s',
  20182. past : '%s în urmă',
  20183. s : 'câteva secunde',
  20184. m : 'un minut',
  20185. mm : relativeTimeWithPlural,
  20186. h : 'o oră',
  20187. hh : relativeTimeWithPlural,
  20188. d : 'o zi',
  20189. dd : relativeTimeWithPlural,
  20190. M : 'o lună',
  20191. MM : relativeTimeWithPlural,
  20192. y : 'un an',
  20193. yy : relativeTimeWithPlural
  20194. },
  20195. week : {
  20196. dow : 1, // Monday is the first day of the week.
  20197. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20198. }
  20199. });
  20200. return ro;
  20201. })));
  20202. /***/ }),
  20203. /* 84 */
  20204. /***/ (function(module, exports, __webpack_require__) {
  20205. //! moment.js locale configuration
  20206. //! locale : Russian [ru]
  20207. //! author : Viktorminator : https://github.com/Viktorminator
  20208. //! Author : Menelion Elensúle : https://github.com/Oire
  20209. //! author : Коренберг Марк : https://github.com/socketpair
  20210. ;(function (global, factory) {
  20211. true ? factory(__webpack_require__(0)) :
  20212. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20213. factory(global.moment)
  20214. }(this, (function (moment) { 'use strict';
  20215. function plural(word, num) {
  20216. var forms = word.split('_');
  20217. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  20218. }
  20219. function relativeTimeWithPlural(number, withoutSuffix, key) {
  20220. var format = {
  20221. 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  20222. 'hh': 'час_часа_часов',
  20223. 'dd': 'день_дня_дней',
  20224. 'MM': 'месяц_месяца_месяцев',
  20225. 'yy': 'год_года_лет'
  20226. };
  20227. if (key === 'm') {
  20228. return withoutSuffix ? 'минута' : 'минуту';
  20229. }
  20230. else {
  20231. return number + ' ' + plural(format[key], +number);
  20232. }
  20233. }
  20234. var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
  20235. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  20236. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  20237. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  20238. var ru = moment.defineLocale('ru', {
  20239. months : {
  20240. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
  20241. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
  20242. },
  20243. monthsShort : {
  20244. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
  20245. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  20246. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
  20247. },
  20248. weekdays : {
  20249. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  20250. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
  20251. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
  20252. },
  20253. weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  20254. weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  20255. monthsParse : monthsParse,
  20256. longMonthsParse : monthsParse,
  20257. shortMonthsParse : monthsParse,
  20258. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  20259. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  20260. // копия предыдущего
  20261. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  20262. // полные названия с падежами
  20263. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  20264. // Выражение, которое соотвествует только сокращённым формам
  20265. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  20266. longDateFormat : {
  20267. LT : 'HH:mm',
  20268. LTS : 'HH:mm:ss',
  20269. L : 'DD.MM.YYYY',
  20270. LL : 'D MMMM YYYY г.',
  20271. LLL : 'D MMMM YYYY г., HH:mm',
  20272. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  20273. },
  20274. calendar : {
  20275. sameDay: '[Сегодня в] LT',
  20276. nextDay: '[Завтра в] LT',
  20277. lastDay: '[Вчера в] LT',
  20278. nextWeek: function (now) {
  20279. if (now.week() !== this.week()) {
  20280. switch (this.day()) {
  20281. case 0:
  20282. return '[В следующее] dddd [в] LT';
  20283. case 1:
  20284. case 2:
  20285. case 4:
  20286. return '[В следующий] dddd [в] LT';
  20287. case 3:
  20288. case 5:
  20289. case 6:
  20290. return '[В следующую] dddd [в] LT';
  20291. }
  20292. } else {
  20293. if (this.day() === 2) {
  20294. return '[Во] dddd [в] LT';
  20295. } else {
  20296. return '[В] dddd [в] LT';
  20297. }
  20298. }
  20299. },
  20300. lastWeek: function (now) {
  20301. if (now.week() !== this.week()) {
  20302. switch (this.day()) {
  20303. case 0:
  20304. return '[В прошлое] dddd [в] LT';
  20305. case 1:
  20306. case 2:
  20307. case 4:
  20308. return '[В прошлый] dddd [в] LT';
  20309. case 3:
  20310. case 5:
  20311. case 6:
  20312. return '[В прошлую] dddd [в] LT';
  20313. }
  20314. } else {
  20315. if (this.day() === 2) {
  20316. return '[Во] dddd [в] LT';
  20317. } else {
  20318. return '[В] dddd [в] LT';
  20319. }
  20320. }
  20321. },
  20322. sameElse: 'L'
  20323. },
  20324. relativeTime : {
  20325. future : 'через %s',
  20326. past : '%s назад',
  20327. s : 'несколько секунд',
  20328. m : relativeTimeWithPlural,
  20329. mm : relativeTimeWithPlural,
  20330. h : 'час',
  20331. hh : relativeTimeWithPlural,
  20332. d : 'день',
  20333. dd : relativeTimeWithPlural,
  20334. M : 'месяц',
  20335. MM : relativeTimeWithPlural,
  20336. y : 'год',
  20337. yy : relativeTimeWithPlural
  20338. },
  20339. meridiemParse: /ночи|утра|дня|вечера/i,
  20340. isPM : function (input) {
  20341. return /^(дня|вечера)$/.test(input);
  20342. },
  20343. meridiem : function (hour, minute, isLower) {
  20344. if (hour < 4) {
  20345. return 'ночи';
  20346. } else if (hour < 12) {
  20347. return 'утра';
  20348. } else if (hour < 17) {
  20349. return 'дня';
  20350. } else {
  20351. return 'вечера';
  20352. }
  20353. },
  20354. ordinalParse: /\d{1,2}-(й|го|я)/,
  20355. ordinal: function (number, period) {
  20356. switch (period) {
  20357. case 'M':
  20358. case 'd':
  20359. case 'DDD':
  20360. return number + '-й';
  20361. case 'D':
  20362. return number + '-го';
  20363. case 'w':
  20364. case 'W':
  20365. return number + '-я';
  20366. default:
  20367. return number;
  20368. }
  20369. },
  20370. week : {
  20371. dow : 1, // Monday is the first day of the week.
  20372. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20373. }
  20374. });
  20375. return ru;
  20376. })));
  20377. /***/ }),
  20378. /* 85 */
  20379. /***/ (function(module, exports, __webpack_require__) {
  20380. //! moment.js locale configuration
  20381. //! locale : Northern Sami [se]
  20382. //! authors : Bård Rolstad Henriksen : https://github.com/karamell
  20383. ;(function (global, factory) {
  20384. true ? factory(__webpack_require__(0)) :
  20385. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20386. factory(global.moment)
  20387. }(this, (function (moment) { 'use strict';
  20388. var se = moment.defineLocale('se', {
  20389. months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
  20390. monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
  20391. weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
  20392. weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  20393. weekdaysMin : 's_v_m_g_d_b_L'.split('_'),
  20394. longDateFormat : {
  20395. LT : 'HH:mm',
  20396. LTS : 'HH:mm:ss',
  20397. L : 'DD.MM.YYYY',
  20398. LL : 'MMMM D. [b.] YYYY',
  20399. LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',
  20400. LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
  20401. },
  20402. calendar : {
  20403. sameDay: '[otne ti] LT',
  20404. nextDay: '[ihttin ti] LT',
  20405. nextWeek: 'dddd [ti] LT',
  20406. lastDay: '[ikte ti] LT',
  20407. lastWeek: '[ovddit] dddd [ti] LT',
  20408. sameElse: 'L'
  20409. },
  20410. relativeTime : {
  20411. future : '%s geažes',
  20412. past : 'maŋit %s',
  20413. s : 'moadde sekunddat',
  20414. m : 'okta minuhta',
  20415. mm : '%d minuhtat',
  20416. h : 'okta diimmu',
  20417. hh : '%d diimmut',
  20418. d : 'okta beaivi',
  20419. dd : '%d beaivvit',
  20420. M : 'okta mánnu',
  20421. MM : '%d mánut',
  20422. y : 'okta jahki',
  20423. yy : '%d jagit'
  20424. },
  20425. ordinalParse: /\d{1,2}\./,
  20426. ordinal : '%d.',
  20427. week : {
  20428. dow : 1, // Monday is the first day of the week.
  20429. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20430. }
  20431. });
  20432. return se;
  20433. })));
  20434. /***/ }),
  20435. /* 86 */
  20436. /***/ (function(module, exports, __webpack_require__) {
  20437. //! moment.js locale configuration
  20438. //! locale : Sinhalese [si]
  20439. //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
  20440. ;(function (global, factory) {
  20441. true ? factory(__webpack_require__(0)) :
  20442. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20443. factory(global.moment)
  20444. }(this, (function (moment) { 'use strict';
  20445. /*jshint -W100*/
  20446. var si = moment.defineLocale('si', {
  20447. months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
  20448. monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
  20449. weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
  20450. weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  20451. weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  20452. weekdaysParseExact : true,
  20453. longDateFormat : {
  20454. LT : 'a h:mm',
  20455. LTS : 'a h:mm:ss',
  20456. L : 'YYYY/MM/DD',
  20457. LL : 'YYYY MMMM D',
  20458. LLL : 'YYYY MMMM D, a h:mm',
  20459. LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
  20460. },
  20461. calendar : {
  20462. sameDay : '[අද] LT[ට]',
  20463. nextDay : '[හෙට] LT[ට]',
  20464. nextWeek : 'dddd LT[ට]',
  20465. lastDay : '[ඊයේ] LT[ට]',
  20466. lastWeek : '[පසුගිය] dddd LT[ට]',
  20467. sameElse : 'L'
  20468. },
  20469. relativeTime : {
  20470. future : '%sකින්',
  20471. past : '%sකට පෙර',
  20472. s : 'තත්පර කිහිපය',
  20473. m : 'මිනිත්තුව',
  20474. mm : 'මිනිත්තු %d',
  20475. h : 'පැය',
  20476. hh : 'පැය %d',
  20477. d : 'දිනය',
  20478. dd : 'දින %d',
  20479. M : 'මාසය',
  20480. MM : 'මාස %d',
  20481. y : 'වසර',
  20482. yy : 'වසර %d'
  20483. },
  20484. ordinalParse: /\d{1,2} වැනි/,
  20485. ordinal : function (number) {
  20486. return number + ' වැනි';
  20487. },
  20488. meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  20489. isPM : function (input) {
  20490. return input === 'ප.ව.' || input === 'පස් වරු';
  20491. },
  20492. meridiem : function (hours, minutes, isLower) {
  20493. if (hours > 11) {
  20494. return isLower ? 'ප.ව.' : 'පස් වරු';
  20495. } else {
  20496. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  20497. }
  20498. }
  20499. });
  20500. return si;
  20501. })));
  20502. /***/ }),
  20503. /* 87 */
  20504. /***/ (function(module, exports, __webpack_require__) {
  20505. //! moment.js locale configuration
  20506. //! locale : Slovak [sk]
  20507. //! author : Martin Minka : https://github.com/k2s
  20508. //! based on work of petrbela : https://github.com/petrbela
  20509. ;(function (global, factory) {
  20510. true ? factory(__webpack_require__(0)) :
  20511. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20512. factory(global.moment)
  20513. }(this, (function (moment) { 'use strict';
  20514. var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_');
  20515. var monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  20516. function plural(n) {
  20517. return (n > 1) && (n < 5);
  20518. }
  20519. function translate(number, withoutSuffix, key, isFuture) {
  20520. var result = number + ' ';
  20521. switch (key) {
  20522. case 's': // a few seconds / in a few seconds / a few seconds ago
  20523. return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
  20524. case 'm': // a minute / in a minute / a minute ago
  20525. return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
  20526. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  20527. if (withoutSuffix || isFuture) {
  20528. return result + (plural(number) ? 'minúty' : 'minút');
  20529. } else {
  20530. return result + 'minútami';
  20531. }
  20532. break;
  20533. case 'h': // an hour / in an hour / an hour ago
  20534. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  20535. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  20536. if (withoutSuffix || isFuture) {
  20537. return result + (plural(number) ? 'hodiny' : 'hodín');
  20538. } else {
  20539. return result + 'hodinami';
  20540. }
  20541. break;
  20542. case 'd': // a day / in a day / a day ago
  20543. return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
  20544. case 'dd': // 9 days / in 9 days / 9 days ago
  20545. if (withoutSuffix || isFuture) {
  20546. return result + (plural(number) ? 'dni' : 'dní');
  20547. } else {
  20548. return result + 'dňami';
  20549. }
  20550. break;
  20551. case 'M': // a month / in a month / a month ago
  20552. return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
  20553. case 'MM': // 9 months / in 9 months / 9 months ago
  20554. if (withoutSuffix || isFuture) {
  20555. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  20556. } else {
  20557. return result + 'mesiacmi';
  20558. }
  20559. break;
  20560. case 'y': // a year / in a year / a year ago
  20561. return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
  20562. case 'yy': // 9 years / in 9 years / 9 years ago
  20563. if (withoutSuffix || isFuture) {
  20564. return result + (plural(number) ? 'roky' : 'rokov');
  20565. } else {
  20566. return result + 'rokmi';
  20567. }
  20568. break;
  20569. }
  20570. }
  20571. var sk = moment.defineLocale('sk', {
  20572. months : months,
  20573. monthsShort : monthsShort,
  20574. weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  20575. weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
  20576. weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
  20577. longDateFormat : {
  20578. LT: 'H:mm',
  20579. LTS : 'H:mm:ss',
  20580. L : 'DD.MM.YYYY',
  20581. LL : 'D. MMMM YYYY',
  20582. LLL : 'D. MMMM YYYY H:mm',
  20583. LLLL : 'dddd D. MMMM YYYY H:mm'
  20584. },
  20585. calendar : {
  20586. sameDay: '[dnes o] LT',
  20587. nextDay: '[zajtra o] LT',
  20588. nextWeek: function () {
  20589. switch (this.day()) {
  20590. case 0:
  20591. return '[v nedeľu o] LT';
  20592. case 1:
  20593. case 2:
  20594. return '[v] dddd [o] LT';
  20595. case 3:
  20596. return '[v stredu o] LT';
  20597. case 4:
  20598. return '[vo štvrtok o] LT';
  20599. case 5:
  20600. return '[v piatok o] LT';
  20601. case 6:
  20602. return '[v sobotu o] LT';
  20603. }
  20604. },
  20605. lastDay: '[včera o] LT',
  20606. lastWeek: function () {
  20607. switch (this.day()) {
  20608. case 0:
  20609. return '[minulú nedeľu o] LT';
  20610. case 1:
  20611. case 2:
  20612. return '[minulý] dddd [o] LT';
  20613. case 3:
  20614. return '[minulú stredu o] LT';
  20615. case 4:
  20616. case 5:
  20617. return '[minulý] dddd [o] LT';
  20618. case 6:
  20619. return '[minulú sobotu o] LT';
  20620. }
  20621. },
  20622. sameElse: 'L'
  20623. },
  20624. relativeTime : {
  20625. future : 'za %s',
  20626. past : 'pred %s',
  20627. s : translate,
  20628. m : translate,
  20629. mm : translate,
  20630. h : translate,
  20631. hh : translate,
  20632. d : translate,
  20633. dd : translate,
  20634. M : translate,
  20635. MM : translate,
  20636. y : translate,
  20637. yy : translate
  20638. },
  20639. ordinalParse: /\d{1,2}\./,
  20640. ordinal : '%d.',
  20641. week : {
  20642. dow : 1, // Monday is the first day of the week.
  20643. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20644. }
  20645. });
  20646. return sk;
  20647. })));
  20648. /***/ }),
  20649. /* 88 */
  20650. /***/ (function(module, exports, __webpack_require__) {
  20651. //! moment.js locale configuration
  20652. //! locale : Slovenian [sl]
  20653. //! author : Robert Sedovšek : https://github.com/sedovsek
  20654. ;(function (global, factory) {
  20655. true ? factory(__webpack_require__(0)) :
  20656. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20657. factory(global.moment)
  20658. }(this, (function (moment) { 'use strict';
  20659. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  20660. var result = number + ' ';
  20661. switch (key) {
  20662. case 's':
  20663. return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
  20664. case 'm':
  20665. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  20666. case 'mm':
  20667. if (number === 1) {
  20668. result += withoutSuffix ? 'minuta' : 'minuto';
  20669. } else if (number === 2) {
  20670. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  20671. } else if (number < 5) {
  20672. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  20673. } else {
  20674. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  20675. }
  20676. return result;
  20677. case 'h':
  20678. return withoutSuffix ? 'ena ura' : 'eno uro';
  20679. case 'hh':
  20680. if (number === 1) {
  20681. result += withoutSuffix ? 'ura' : 'uro';
  20682. } else if (number === 2) {
  20683. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  20684. } else if (number < 5) {
  20685. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  20686. } else {
  20687. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  20688. }
  20689. return result;
  20690. case 'd':
  20691. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  20692. case 'dd':
  20693. if (number === 1) {
  20694. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  20695. } else if (number === 2) {
  20696. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  20697. } else {
  20698. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  20699. }
  20700. return result;
  20701. case 'M':
  20702. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  20703. case 'MM':
  20704. if (number === 1) {
  20705. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  20706. } else if (number === 2) {
  20707. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  20708. } else if (number < 5) {
  20709. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  20710. } else {
  20711. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  20712. }
  20713. return result;
  20714. case 'y':
  20715. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  20716. case 'yy':
  20717. if (number === 1) {
  20718. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  20719. } else if (number === 2) {
  20720. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  20721. } else if (number < 5) {
  20722. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  20723. } else {
  20724. result += withoutSuffix || isFuture ? 'let' : 'leti';
  20725. }
  20726. return result;
  20727. }
  20728. }
  20729. var sl = moment.defineLocale('sl', {
  20730. months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
  20731. monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
  20732. monthsParseExact: true,
  20733. weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  20734. weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  20735. weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
  20736. weekdaysParseExact : true,
  20737. longDateFormat : {
  20738. LT : 'H:mm',
  20739. LTS : 'H:mm:ss',
  20740. L : 'DD.MM.YYYY',
  20741. LL : 'D. MMMM YYYY',
  20742. LLL : 'D. MMMM YYYY H:mm',
  20743. LLLL : 'dddd, D. MMMM YYYY H:mm'
  20744. },
  20745. calendar : {
  20746. sameDay : '[danes ob] LT',
  20747. nextDay : '[jutri ob] LT',
  20748. nextWeek : function () {
  20749. switch (this.day()) {
  20750. case 0:
  20751. return '[v] [nedeljo] [ob] LT';
  20752. case 3:
  20753. return '[v] [sredo] [ob] LT';
  20754. case 6:
  20755. return '[v] [soboto] [ob] LT';
  20756. case 1:
  20757. case 2:
  20758. case 4:
  20759. case 5:
  20760. return '[v] dddd [ob] LT';
  20761. }
  20762. },
  20763. lastDay : '[včeraj ob] LT',
  20764. lastWeek : function () {
  20765. switch (this.day()) {
  20766. case 0:
  20767. return '[prejšnjo] [nedeljo] [ob] LT';
  20768. case 3:
  20769. return '[prejšnjo] [sredo] [ob] LT';
  20770. case 6:
  20771. return '[prejšnjo] [soboto] [ob] LT';
  20772. case 1:
  20773. case 2:
  20774. case 4:
  20775. case 5:
  20776. return '[prejšnji] dddd [ob] LT';
  20777. }
  20778. },
  20779. sameElse : 'L'
  20780. },
  20781. relativeTime : {
  20782. future : 'čez %s',
  20783. past : 'pred %s',
  20784. s : processRelativeTime,
  20785. m : processRelativeTime,
  20786. mm : processRelativeTime,
  20787. h : processRelativeTime,
  20788. hh : processRelativeTime,
  20789. d : processRelativeTime,
  20790. dd : processRelativeTime,
  20791. M : processRelativeTime,
  20792. MM : processRelativeTime,
  20793. y : processRelativeTime,
  20794. yy : processRelativeTime
  20795. },
  20796. ordinalParse: /\d{1,2}\./,
  20797. ordinal : '%d.',
  20798. week : {
  20799. dow : 1, // Monday is the first day of the week.
  20800. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20801. }
  20802. });
  20803. return sl;
  20804. })));
  20805. /***/ }),
  20806. /* 89 */
  20807. /***/ (function(module, exports, __webpack_require__) {
  20808. //! moment.js locale configuration
  20809. //! locale : Albanian [sq]
  20810. //! author : Flakërim Ismani : https://github.com/flakerimi
  20811. //! author : Menelion Elensúle : https://github.com/Oire
  20812. //! author : Oerd Cukalla : https://github.com/oerd
  20813. ;(function (global, factory) {
  20814. true ? factory(__webpack_require__(0)) :
  20815. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20816. factory(global.moment)
  20817. }(this, (function (moment) { 'use strict';
  20818. var sq = moment.defineLocale('sq', {
  20819. months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
  20820. monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  20821. weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
  20822. weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  20823. weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
  20824. weekdaysParseExact : true,
  20825. meridiemParse: /PD|MD/,
  20826. isPM: function (input) {
  20827. return input.charAt(0) === 'M';
  20828. },
  20829. meridiem : function (hours, minutes, isLower) {
  20830. return hours < 12 ? 'PD' : 'MD';
  20831. },
  20832. longDateFormat : {
  20833. LT : 'HH:mm',
  20834. LTS : 'HH:mm:ss',
  20835. L : 'DD/MM/YYYY',
  20836. LL : 'D MMMM YYYY',
  20837. LLL : 'D MMMM YYYY HH:mm',
  20838. LLLL : 'dddd, D MMMM YYYY HH:mm'
  20839. },
  20840. calendar : {
  20841. sameDay : '[Sot në] LT',
  20842. nextDay : '[Nesër në] LT',
  20843. nextWeek : 'dddd [në] LT',
  20844. lastDay : '[Dje në] LT',
  20845. lastWeek : 'dddd [e kaluar në] LT',
  20846. sameElse : 'L'
  20847. },
  20848. relativeTime : {
  20849. future : 'në %s',
  20850. past : '%s më parë',
  20851. s : 'disa sekonda',
  20852. m : 'një minutë',
  20853. mm : '%d minuta',
  20854. h : 'një orë',
  20855. hh : '%d orë',
  20856. d : 'një ditë',
  20857. dd : '%d ditë',
  20858. M : 'një muaj',
  20859. MM : '%d muaj',
  20860. y : 'një vit',
  20861. yy : '%d vite'
  20862. },
  20863. ordinalParse: /\d{1,2}\./,
  20864. ordinal : '%d.',
  20865. week : {
  20866. dow : 1, // Monday is the first day of the week.
  20867. doy : 4 // The week that contains Jan 4th is the first week of the year.
  20868. }
  20869. });
  20870. return sq;
  20871. })));
  20872. /***/ }),
  20873. /* 90 */
  20874. /***/ (function(module, exports, __webpack_require__) {
  20875. //! moment.js locale configuration
  20876. //! locale : Serbian Cyrillic [sr-cyrl]
  20877. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  20878. ;(function (global, factory) {
  20879. true ? factory(__webpack_require__(0)) :
  20880. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20881. factory(global.moment)
  20882. }(this, (function (moment) { 'use strict';
  20883. var translator = {
  20884. words: { //Different grammatical cases
  20885. m: ['један минут', 'једне минуте'],
  20886. mm: ['минут', 'минуте', 'минута'],
  20887. h: ['један сат', 'једног сата'],
  20888. hh: ['сат', 'сата', 'сати'],
  20889. dd: ['дан', 'дана', 'дана'],
  20890. MM: ['месец', 'месеца', 'месеци'],
  20891. yy: ['година', 'године', 'година']
  20892. },
  20893. correctGrammaticalCase: function (number, wordKey) {
  20894. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  20895. },
  20896. translate: function (number, withoutSuffix, key) {
  20897. var wordKey = translator.words[key];
  20898. if (key.length === 1) {
  20899. return withoutSuffix ? wordKey[0] : wordKey[1];
  20900. } else {
  20901. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  20902. }
  20903. }
  20904. };
  20905. var srCyrl = moment.defineLocale('sr-cyrl', {
  20906. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
  20907. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
  20908. monthsParseExact: true,
  20909. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  20910. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  20911. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  20912. weekdaysParseExact : true,
  20913. longDateFormat: {
  20914. LT: 'H:mm',
  20915. LTS : 'H:mm:ss',
  20916. L: 'DD.MM.YYYY',
  20917. LL: 'D. MMMM YYYY',
  20918. LLL: 'D. MMMM YYYY H:mm',
  20919. LLLL: 'dddd, D. MMMM YYYY H:mm'
  20920. },
  20921. calendar: {
  20922. sameDay: '[данас у] LT',
  20923. nextDay: '[сутра у] LT',
  20924. nextWeek: function () {
  20925. switch (this.day()) {
  20926. case 0:
  20927. return '[у] [недељу] [у] LT';
  20928. case 3:
  20929. return '[у] [среду] [у] LT';
  20930. case 6:
  20931. return '[у] [суботу] [у] LT';
  20932. case 1:
  20933. case 2:
  20934. case 4:
  20935. case 5:
  20936. return '[у] dddd [у] LT';
  20937. }
  20938. },
  20939. lastDay : '[јуче у] LT',
  20940. lastWeek : function () {
  20941. var lastWeekDays = [
  20942. '[прошле] [недеље] [у] LT',
  20943. '[прошлог] [понедељка] [у] LT',
  20944. '[прошлог] [уторка] [у] LT',
  20945. '[прошле] [среде] [у] LT',
  20946. '[прошлог] [четвртка] [у] LT',
  20947. '[прошлог] [петка] [у] LT',
  20948. '[прошле] [суботе] [у] LT'
  20949. ];
  20950. return lastWeekDays[this.day()];
  20951. },
  20952. sameElse : 'L'
  20953. },
  20954. relativeTime : {
  20955. future : 'за %s',
  20956. past : 'пре %s',
  20957. s : 'неколико секунди',
  20958. m : translator.translate,
  20959. mm : translator.translate,
  20960. h : translator.translate,
  20961. hh : translator.translate,
  20962. d : 'дан',
  20963. dd : translator.translate,
  20964. M : 'месец',
  20965. MM : translator.translate,
  20966. y : 'годину',
  20967. yy : translator.translate
  20968. },
  20969. ordinalParse: /\d{1,2}\./,
  20970. ordinal : '%d.',
  20971. week : {
  20972. dow : 1, // Monday is the first day of the week.
  20973. doy : 7 // The week that contains Jan 1st is the first week of the year.
  20974. }
  20975. });
  20976. return srCyrl;
  20977. })));
  20978. /***/ }),
  20979. /* 91 */
  20980. /***/ (function(module, exports, __webpack_require__) {
  20981. //! moment.js locale configuration
  20982. //! locale : Serbian [sr]
  20983. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  20984. ;(function (global, factory) {
  20985. true ? factory(__webpack_require__(0)) :
  20986. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  20987. factory(global.moment)
  20988. }(this, (function (moment) { 'use strict';
  20989. var translator = {
  20990. words: { //Different grammatical cases
  20991. m: ['jedan minut', 'jedne minute'],
  20992. mm: ['minut', 'minute', 'minuta'],
  20993. h: ['jedan sat', 'jednog sata'],
  20994. hh: ['sat', 'sata', 'sati'],
  20995. dd: ['dan', 'dana', 'dana'],
  20996. MM: ['mesec', 'meseca', 'meseci'],
  20997. yy: ['godina', 'godine', 'godina']
  20998. },
  20999. correctGrammaticalCase: function (number, wordKey) {
  21000. return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
  21001. },
  21002. translate: function (number, withoutSuffix, key) {
  21003. var wordKey = translator.words[key];
  21004. if (key.length === 1) {
  21005. return withoutSuffix ? wordKey[0] : wordKey[1];
  21006. } else {
  21007. return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
  21008. }
  21009. }
  21010. };
  21011. var sr = moment.defineLocale('sr', {
  21012. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
  21013. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
  21014. monthsParseExact: true,
  21015. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
  21016. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  21017. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  21018. weekdaysParseExact : true,
  21019. longDateFormat: {
  21020. LT: 'H:mm',
  21021. LTS : 'H:mm:ss',
  21022. L: 'DD.MM.YYYY',
  21023. LL: 'D. MMMM YYYY',
  21024. LLL: 'D. MMMM YYYY H:mm',
  21025. LLLL: 'dddd, D. MMMM YYYY H:mm'
  21026. },
  21027. calendar: {
  21028. sameDay: '[danas u] LT',
  21029. nextDay: '[sutra u] LT',
  21030. nextWeek: function () {
  21031. switch (this.day()) {
  21032. case 0:
  21033. return '[u] [nedelju] [u] LT';
  21034. case 3:
  21035. return '[u] [sredu] [u] LT';
  21036. case 6:
  21037. return '[u] [subotu] [u] LT';
  21038. case 1:
  21039. case 2:
  21040. case 4:
  21041. case 5:
  21042. return '[u] dddd [u] LT';
  21043. }
  21044. },
  21045. lastDay : '[juče u] LT',
  21046. lastWeek : function () {
  21047. var lastWeekDays = [
  21048. '[prošle] [nedelje] [u] LT',
  21049. '[prošlog] [ponedeljka] [u] LT',
  21050. '[prošlog] [utorka] [u] LT',
  21051. '[prošle] [srede] [u] LT',
  21052. '[prošlog] [četvrtka] [u] LT',
  21053. '[prošlog] [petka] [u] LT',
  21054. '[prošle] [subote] [u] LT'
  21055. ];
  21056. return lastWeekDays[this.day()];
  21057. },
  21058. sameElse : 'L'
  21059. },
  21060. relativeTime : {
  21061. future : 'za %s',
  21062. past : 'pre %s',
  21063. s : 'nekoliko sekundi',
  21064. m : translator.translate,
  21065. mm : translator.translate,
  21066. h : translator.translate,
  21067. hh : translator.translate,
  21068. d : 'dan',
  21069. dd : translator.translate,
  21070. M : 'mesec',
  21071. MM : translator.translate,
  21072. y : 'godinu',
  21073. yy : translator.translate
  21074. },
  21075. ordinalParse: /\d{1,2}\./,
  21076. ordinal : '%d.',
  21077. week : {
  21078. dow : 1, // Monday is the first day of the week.
  21079. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21080. }
  21081. });
  21082. return sr;
  21083. })));
  21084. /***/ }),
  21085. /* 92 */
  21086. /***/ (function(module, exports, __webpack_require__) {
  21087. //! moment.js locale configuration
  21088. //! locale : siSwati [ss]
  21089. //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
  21090. ;(function (global, factory) {
  21091. true ? factory(__webpack_require__(0)) :
  21092. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21093. factory(global.moment)
  21094. }(this, (function (moment) { 'use strict';
  21095. var ss = moment.defineLocale('ss', {
  21096. months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
  21097. monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  21098. weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
  21099. weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  21100. weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  21101. weekdaysParseExact : true,
  21102. longDateFormat : {
  21103. LT : 'h:mm A',
  21104. LTS : 'h:mm:ss A',
  21105. L : 'DD/MM/YYYY',
  21106. LL : 'D MMMM YYYY',
  21107. LLL : 'D MMMM YYYY h:mm A',
  21108. LLLL : 'dddd, D MMMM YYYY h:mm A'
  21109. },
  21110. calendar : {
  21111. sameDay : '[Namuhla nga] LT',
  21112. nextDay : '[Kusasa nga] LT',
  21113. nextWeek : 'dddd [nga] LT',
  21114. lastDay : '[Itolo nga] LT',
  21115. lastWeek : 'dddd [leliphelile] [nga] LT',
  21116. sameElse : 'L'
  21117. },
  21118. relativeTime : {
  21119. future : 'nga %s',
  21120. past : 'wenteka nga %s',
  21121. s : 'emizuzwana lomcane',
  21122. m : 'umzuzu',
  21123. mm : '%d emizuzu',
  21124. h : 'lihora',
  21125. hh : '%d emahora',
  21126. d : 'lilanga',
  21127. dd : '%d emalanga',
  21128. M : 'inyanga',
  21129. MM : '%d tinyanga',
  21130. y : 'umnyaka',
  21131. yy : '%d iminyaka'
  21132. },
  21133. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  21134. meridiem : function (hours, minutes, isLower) {
  21135. if (hours < 11) {
  21136. return 'ekuseni';
  21137. } else if (hours < 15) {
  21138. return 'emini';
  21139. } else if (hours < 19) {
  21140. return 'entsambama';
  21141. } else {
  21142. return 'ebusuku';
  21143. }
  21144. },
  21145. meridiemHour : function (hour, meridiem) {
  21146. if (hour === 12) {
  21147. hour = 0;
  21148. }
  21149. if (meridiem === 'ekuseni') {
  21150. return hour;
  21151. } else if (meridiem === 'emini') {
  21152. return hour >= 11 ? hour : hour + 12;
  21153. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  21154. if (hour === 0) {
  21155. return 0;
  21156. }
  21157. return hour + 12;
  21158. }
  21159. },
  21160. ordinalParse: /\d{1,2}/,
  21161. ordinal : '%d',
  21162. week : {
  21163. dow : 1, // Monday is the first day of the week.
  21164. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21165. }
  21166. });
  21167. return ss;
  21168. })));
  21169. /***/ }),
  21170. /* 93 */
  21171. /***/ (function(module, exports, __webpack_require__) {
  21172. //! moment.js locale configuration
  21173. //! locale : Swedish [sv]
  21174. //! author : Jens Alm : https://github.com/ulmus
  21175. ;(function (global, factory) {
  21176. true ? factory(__webpack_require__(0)) :
  21177. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21178. factory(global.moment)
  21179. }(this, (function (moment) { 'use strict';
  21180. var sv = moment.defineLocale('sv', {
  21181. months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
  21182. monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  21183. weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  21184. weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  21185. weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
  21186. longDateFormat : {
  21187. LT : 'HH:mm',
  21188. LTS : 'HH:mm:ss',
  21189. L : 'YYYY-MM-DD',
  21190. LL : 'D MMMM YYYY',
  21191. LLL : 'D MMMM YYYY [kl.] HH:mm',
  21192. LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',
  21193. lll : 'D MMM YYYY HH:mm',
  21194. llll : 'ddd D MMM YYYY HH:mm'
  21195. },
  21196. calendar : {
  21197. sameDay: '[Idag] LT',
  21198. nextDay: '[Imorgon] LT',
  21199. lastDay: '[Igår] LT',
  21200. nextWeek: '[På] dddd LT',
  21201. lastWeek: '[I] dddd[s] LT',
  21202. sameElse: 'L'
  21203. },
  21204. relativeTime : {
  21205. future : 'om %s',
  21206. past : 'för %s sedan',
  21207. s : 'några sekunder',
  21208. m : 'en minut',
  21209. mm : '%d minuter',
  21210. h : 'en timme',
  21211. hh : '%d timmar',
  21212. d : 'en dag',
  21213. dd : '%d dagar',
  21214. M : 'en månad',
  21215. MM : '%d månader',
  21216. y : 'ett år',
  21217. yy : '%d år'
  21218. },
  21219. ordinalParse: /\d{1,2}(e|a)/,
  21220. ordinal : function (number) {
  21221. var b = number % 10,
  21222. output = (~~(number % 100 / 10) === 1) ? 'e' :
  21223. (b === 1) ? 'a' :
  21224. (b === 2) ? 'a' :
  21225. (b === 3) ? 'e' : 'e';
  21226. return number + output;
  21227. },
  21228. week : {
  21229. dow : 1, // Monday is the first day of the week.
  21230. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21231. }
  21232. });
  21233. return sv;
  21234. })));
  21235. /***/ }),
  21236. /* 94 */
  21237. /***/ (function(module, exports, __webpack_require__) {
  21238. //! moment.js locale configuration
  21239. //! locale : Swahili [sw]
  21240. //! author : Fahad Kassim : https://github.com/fadsel
  21241. ;(function (global, factory) {
  21242. true ? factory(__webpack_require__(0)) :
  21243. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21244. factory(global.moment)
  21245. }(this, (function (moment) { 'use strict';
  21246. var sw = moment.defineLocale('sw', {
  21247. months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
  21248. monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  21249. weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
  21250. weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  21251. weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  21252. weekdaysParseExact : true,
  21253. longDateFormat : {
  21254. LT : 'HH:mm',
  21255. LTS : 'HH:mm:ss',
  21256. L : 'DD.MM.YYYY',
  21257. LL : 'D MMMM YYYY',
  21258. LLL : 'D MMMM YYYY HH:mm',
  21259. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21260. },
  21261. calendar : {
  21262. sameDay : '[leo saa] LT',
  21263. nextDay : '[kesho saa] LT',
  21264. nextWeek : '[wiki ijayo] dddd [saat] LT',
  21265. lastDay : '[jana] LT',
  21266. lastWeek : '[wiki iliyopita] dddd [saat] LT',
  21267. sameElse : 'L'
  21268. },
  21269. relativeTime : {
  21270. future : '%s baadaye',
  21271. past : 'tokea %s',
  21272. s : 'hivi punde',
  21273. m : 'dakika moja',
  21274. mm : 'dakika %d',
  21275. h : 'saa limoja',
  21276. hh : 'masaa %d',
  21277. d : 'siku moja',
  21278. dd : 'masiku %d',
  21279. M : 'mwezi mmoja',
  21280. MM : 'miezi %d',
  21281. y : 'mwaka mmoja',
  21282. yy : 'miaka %d'
  21283. },
  21284. week : {
  21285. dow : 1, // Monday is the first day of the week.
  21286. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21287. }
  21288. });
  21289. return sw;
  21290. })));
  21291. /***/ }),
  21292. /* 95 */
  21293. /***/ (function(module, exports, __webpack_require__) {
  21294. //! moment.js locale configuration
  21295. //! locale : Tamil [ta]
  21296. //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
  21297. ;(function (global, factory) {
  21298. true ? factory(__webpack_require__(0)) :
  21299. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21300. factory(global.moment)
  21301. }(this, (function (moment) { 'use strict';
  21302. var symbolMap = {
  21303. '1': '௧',
  21304. '2': '௨',
  21305. '3': '௩',
  21306. '4': '௪',
  21307. '5': '௫',
  21308. '6': '௬',
  21309. '7': '௭',
  21310. '8': '௮',
  21311. '9': '௯',
  21312. '0': '௦'
  21313. };
  21314. var numberMap = {
  21315. '௧': '1',
  21316. '௨': '2',
  21317. '௩': '3',
  21318. '௪': '4',
  21319. '௫': '5',
  21320. '௬': '6',
  21321. '௭': '7',
  21322. '௮': '8',
  21323. '௯': '9',
  21324. '௦': '0'
  21325. };
  21326. var ta = moment.defineLocale('ta', {
  21327. months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  21328. monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
  21329. weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
  21330. weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
  21331. weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  21332. longDateFormat : {
  21333. LT : 'HH:mm',
  21334. LTS : 'HH:mm:ss',
  21335. L : 'DD/MM/YYYY',
  21336. LL : 'D MMMM YYYY',
  21337. LLL : 'D MMMM YYYY, HH:mm',
  21338. LLLL : 'dddd, D MMMM YYYY, HH:mm'
  21339. },
  21340. calendar : {
  21341. sameDay : '[இன்று] LT',
  21342. nextDay : '[நாளை] LT',
  21343. nextWeek : 'dddd, LT',
  21344. lastDay : '[நேற்று] LT',
  21345. lastWeek : '[கடந்த வாரம்] dddd, LT',
  21346. sameElse : 'L'
  21347. },
  21348. relativeTime : {
  21349. future : '%s இல்',
  21350. past : '%s முன்',
  21351. s : 'ஒரு சில விநாடிகள்',
  21352. m : 'ஒரு நிமிடம்',
  21353. mm : '%d நிமிடங்கள்',
  21354. h : 'ஒரு மணி நேரம்',
  21355. hh : '%d மணி நேரம்',
  21356. d : 'ஒரு நாள்',
  21357. dd : '%d நாட்கள்',
  21358. M : 'ஒரு மாதம்',
  21359. MM : '%d மாதங்கள்',
  21360. y : 'ஒரு வருடம்',
  21361. yy : '%d ஆண்டுகள்'
  21362. },
  21363. ordinalParse: /\d{1,2}வது/,
  21364. ordinal : function (number) {
  21365. return number + 'வது';
  21366. },
  21367. preparse: function (string) {
  21368. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  21369. return numberMap[match];
  21370. });
  21371. },
  21372. postformat: function (string) {
  21373. return string.replace(/\d/g, function (match) {
  21374. return symbolMap[match];
  21375. });
  21376. },
  21377. // refer http://ta.wikipedia.org/s/1er1
  21378. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  21379. meridiem : function (hour, minute, isLower) {
  21380. if (hour < 2) {
  21381. return ' யாமம்';
  21382. } else if (hour < 6) {
  21383. return ' வைகறை'; // வைகறை
  21384. } else if (hour < 10) {
  21385. return ' காலை'; // காலை
  21386. } else if (hour < 14) {
  21387. return ' நண்பகல்'; // நண்பகல்
  21388. } else if (hour < 18) {
  21389. return ' எற்பாடு'; // எற்பாடு
  21390. } else if (hour < 22) {
  21391. return ' மாலை'; // மாலை
  21392. } else {
  21393. return ' யாமம்';
  21394. }
  21395. },
  21396. meridiemHour : function (hour, meridiem) {
  21397. if (hour === 12) {
  21398. hour = 0;
  21399. }
  21400. if (meridiem === 'யாமம்') {
  21401. return hour < 2 ? hour : hour + 12;
  21402. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  21403. return hour;
  21404. } else if (meridiem === 'நண்பகல்') {
  21405. return hour >= 10 ? hour : hour + 12;
  21406. } else {
  21407. return hour + 12;
  21408. }
  21409. },
  21410. week : {
  21411. dow : 0, // Sunday is the first day of the week.
  21412. doy : 6 // The week that contains Jan 1st is the first week of the year.
  21413. }
  21414. });
  21415. return ta;
  21416. })));
  21417. /***/ }),
  21418. /* 96 */
  21419. /***/ (function(module, exports, __webpack_require__) {
  21420. //! moment.js locale configuration
  21421. //! locale : Telugu [te]
  21422. //! author : Krishna Chaitanya Thota : https://github.com/kcthota
  21423. ;(function (global, factory) {
  21424. true ? factory(__webpack_require__(0)) :
  21425. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21426. factory(global.moment)
  21427. }(this, (function (moment) { 'use strict';
  21428. var te = moment.defineLocale('te', {
  21429. months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
  21430. monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
  21431. monthsParseExact : true,
  21432. weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
  21433. weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  21434. weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  21435. longDateFormat : {
  21436. LT : 'A h:mm',
  21437. LTS : 'A h:mm:ss',
  21438. L : 'DD/MM/YYYY',
  21439. LL : 'D MMMM YYYY',
  21440. LLL : 'D MMMM YYYY, A h:mm',
  21441. LLLL : 'dddd, D MMMM YYYY, A h:mm'
  21442. },
  21443. calendar : {
  21444. sameDay : '[నేడు] LT',
  21445. nextDay : '[రేపు] LT',
  21446. nextWeek : 'dddd, LT',
  21447. lastDay : '[నిన్న] LT',
  21448. lastWeek : '[గత] dddd, LT',
  21449. sameElse : 'L'
  21450. },
  21451. relativeTime : {
  21452. future : '%s లో',
  21453. past : '%s క్రితం',
  21454. s : 'కొన్ని క్షణాలు',
  21455. m : 'ఒక నిమిషం',
  21456. mm : '%d నిమిషాలు',
  21457. h : 'ఒక గంట',
  21458. hh : '%d గంటలు',
  21459. d : 'ఒక రోజు',
  21460. dd : '%d రోజులు',
  21461. M : 'ఒక నెల',
  21462. MM : '%d నెలలు',
  21463. y : 'ఒక సంవత్సరం',
  21464. yy : '%d సంవత్సరాలు'
  21465. },
  21466. ordinalParse : /\d{1,2}వ/,
  21467. ordinal : '%dవ',
  21468. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  21469. meridiemHour : function (hour, meridiem) {
  21470. if (hour === 12) {
  21471. hour = 0;
  21472. }
  21473. if (meridiem === 'రాత్రి') {
  21474. return hour < 4 ? hour : hour + 12;
  21475. } else if (meridiem === 'ఉదయం') {
  21476. return hour;
  21477. } else if (meridiem === 'మధ్యాహ్నం') {
  21478. return hour >= 10 ? hour : hour + 12;
  21479. } else if (meridiem === 'సాయంత్రం') {
  21480. return hour + 12;
  21481. }
  21482. },
  21483. meridiem : function (hour, minute, isLower) {
  21484. if (hour < 4) {
  21485. return 'రాత్రి';
  21486. } else if (hour < 10) {
  21487. return 'ఉదయం';
  21488. } else if (hour < 17) {
  21489. return 'మధ్యాహ్నం';
  21490. } else if (hour < 20) {
  21491. return 'సాయంత్రం';
  21492. } else {
  21493. return 'రాత్రి';
  21494. }
  21495. },
  21496. week : {
  21497. dow : 0, // Sunday is the first day of the week.
  21498. doy : 6 // The week that contains Jan 1st is the first week of the year.
  21499. }
  21500. });
  21501. return te;
  21502. })));
  21503. /***/ }),
  21504. /* 97 */
  21505. /***/ (function(module, exports, __webpack_require__) {
  21506. //! moment.js locale configuration
  21507. //! locale : Tetun Dili (East Timor) [tet]
  21508. //! author : Joshua Brooks : https://github.com/joshbrooks
  21509. //! author : Onorio De J. Afonso : https://github.com/marobo
  21510. ;(function (global, factory) {
  21511. true ? factory(__webpack_require__(0)) :
  21512. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21513. factory(global.moment)
  21514. }(this, (function (moment) { 'use strict';
  21515. var tet = moment.defineLocale('tet', {
  21516. months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
  21517. monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez'.split('_'),
  21518. weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu'.split('_'),
  21519. weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sext_Sab'.split('_'),
  21520. weekdaysMin : 'Do_Seg_Te_Ku_Ki_Sex_Sa'.split('_'),
  21521. longDateFormat : {
  21522. LT : 'HH:mm',
  21523. LTS : 'HH:mm:ss',
  21524. L : 'DD/MM/YYYY',
  21525. LL : 'D MMMM YYYY',
  21526. LLL : 'D MMMM YYYY HH:mm',
  21527. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21528. },
  21529. calendar : {
  21530. sameDay: '[Ohin iha] LT',
  21531. nextDay: '[Aban iha] LT',
  21532. nextWeek: 'dddd [iha] LT',
  21533. lastDay: '[Horiseik iha] LT',
  21534. lastWeek: 'dddd [semana kotuk] [iha] LT',
  21535. sameElse: 'L'
  21536. },
  21537. relativeTime : {
  21538. future : 'iha %s',
  21539. past : '%s liuba',
  21540. s : 'minutu balun',
  21541. m : 'minutu ida',
  21542. mm : 'minutus %d',
  21543. h : 'horas ida',
  21544. hh : 'horas %d',
  21545. d : 'loron ida',
  21546. dd : 'loron %d',
  21547. M : 'fulan ida',
  21548. MM : 'fulan %d',
  21549. y : 'tinan ida',
  21550. yy : 'tinan %d'
  21551. },
  21552. ordinalParse: /\d{1,2}(st|nd|rd|th)/,
  21553. ordinal : function (number) {
  21554. var b = number % 10,
  21555. output = (~~(number % 100 / 10) === 1) ? 'th' :
  21556. (b === 1) ? 'st' :
  21557. (b === 2) ? 'nd' :
  21558. (b === 3) ? 'rd' : 'th';
  21559. return number + output;
  21560. },
  21561. week : {
  21562. dow : 1, // Monday is the first day of the week.
  21563. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21564. }
  21565. });
  21566. return tet;
  21567. })));
  21568. /***/ }),
  21569. /* 98 */
  21570. /***/ (function(module, exports, __webpack_require__) {
  21571. //! moment.js locale configuration
  21572. //! locale : Thai [th]
  21573. //! author : Kridsada Thanabulpong : https://github.com/sirn
  21574. ;(function (global, factory) {
  21575. true ? factory(__webpack_require__(0)) :
  21576. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21577. factory(global.moment)
  21578. }(this, (function (moment) { 'use strict';
  21579. var th = moment.defineLocale('th', {
  21580. months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
  21581. monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
  21582. monthsParseExact: true,
  21583. weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  21584. weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  21585. weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  21586. weekdaysParseExact : true,
  21587. longDateFormat : {
  21588. LT : 'H:mm',
  21589. LTS : 'H:mm:ss',
  21590. L : 'YYYY/MM/DD',
  21591. LL : 'D MMMM YYYY',
  21592. LLL : 'D MMMM YYYY เวลา H:mm',
  21593. LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm'
  21594. },
  21595. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  21596. isPM: function (input) {
  21597. return input === 'หลังเที่ยง';
  21598. },
  21599. meridiem : function (hour, minute, isLower) {
  21600. if (hour < 12) {
  21601. return 'ก่อนเที่ยง';
  21602. } else {
  21603. return 'หลังเที่ยง';
  21604. }
  21605. },
  21606. calendar : {
  21607. sameDay : '[วันนี้ เวลา] LT',
  21608. nextDay : '[พรุ่งนี้ เวลา] LT',
  21609. nextWeek : 'dddd[หน้า เวลา] LT',
  21610. lastDay : '[เมื่อวานนี้ เวลา] LT',
  21611. lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
  21612. sameElse : 'L'
  21613. },
  21614. relativeTime : {
  21615. future : 'อีก %s',
  21616. past : '%sที่แล้ว',
  21617. s : 'ไม่กี่วินาที',
  21618. m : '1 นาที',
  21619. mm : '%d นาที',
  21620. h : '1 ชั่วโมง',
  21621. hh : '%d ชั่วโมง',
  21622. d : '1 วัน',
  21623. dd : '%d วัน',
  21624. M : '1 เดือน',
  21625. MM : '%d เดือน',
  21626. y : '1 ปี',
  21627. yy : '%d ปี'
  21628. }
  21629. });
  21630. return th;
  21631. })));
  21632. /***/ }),
  21633. /* 99 */
  21634. /***/ (function(module, exports, __webpack_require__) {
  21635. //! moment.js locale configuration
  21636. //! locale : Tagalog (Philippines) [tl-ph]
  21637. //! author : Dan Hagman : https://github.com/hagmandan
  21638. ;(function (global, factory) {
  21639. true ? factory(__webpack_require__(0)) :
  21640. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21641. factory(global.moment)
  21642. }(this, (function (moment) { 'use strict';
  21643. var tlPh = moment.defineLocale('tl-ph', {
  21644. months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
  21645. monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  21646. weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
  21647. weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  21648. weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  21649. longDateFormat : {
  21650. LT : 'HH:mm',
  21651. LTS : 'HH:mm:ss',
  21652. L : 'MM/D/YYYY',
  21653. LL : 'MMMM D, YYYY',
  21654. LLL : 'MMMM D, YYYY HH:mm',
  21655. LLLL : 'dddd, MMMM DD, YYYY HH:mm'
  21656. },
  21657. calendar : {
  21658. sameDay: 'LT [ngayong araw]',
  21659. nextDay: '[Bukas ng] LT',
  21660. nextWeek: 'LT [sa susunod na] dddd',
  21661. lastDay: 'LT [kahapon]',
  21662. lastWeek: 'LT [noong nakaraang] dddd',
  21663. sameElse: 'L'
  21664. },
  21665. relativeTime : {
  21666. future : 'sa loob ng %s',
  21667. past : '%s ang nakalipas',
  21668. s : 'ilang segundo',
  21669. m : 'isang minuto',
  21670. mm : '%d minuto',
  21671. h : 'isang oras',
  21672. hh : '%d oras',
  21673. d : 'isang araw',
  21674. dd : '%d araw',
  21675. M : 'isang buwan',
  21676. MM : '%d buwan',
  21677. y : 'isang taon',
  21678. yy : '%d taon'
  21679. },
  21680. ordinalParse: /\d{1,2}/,
  21681. ordinal : function (number) {
  21682. return number;
  21683. },
  21684. week : {
  21685. dow : 1, // Monday is the first day of the week.
  21686. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21687. }
  21688. });
  21689. return tlPh;
  21690. })));
  21691. /***/ }),
  21692. /* 100 */
  21693. /***/ (function(module, exports, __webpack_require__) {
  21694. //! moment.js locale configuration
  21695. //! locale : Klingon [tlh]
  21696. //! author : Dominika Kruk : https://github.com/amaranthrose
  21697. ;(function (global, factory) {
  21698. true ? factory(__webpack_require__(0)) :
  21699. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21700. factory(global.moment)
  21701. }(this, (function (moment) { 'use strict';
  21702. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  21703. function translateFuture(output) {
  21704. var time = output;
  21705. time = (output.indexOf('jaj') !== -1) ?
  21706. time.slice(0, -3) + 'leS' :
  21707. (output.indexOf('jar') !== -1) ?
  21708. time.slice(0, -3) + 'waQ' :
  21709. (output.indexOf('DIS') !== -1) ?
  21710. time.slice(0, -3) + 'nem' :
  21711. time + ' pIq';
  21712. return time;
  21713. }
  21714. function translatePast(output) {
  21715. var time = output;
  21716. time = (output.indexOf('jaj') !== -1) ?
  21717. time.slice(0, -3) + 'Hu’' :
  21718. (output.indexOf('jar') !== -1) ?
  21719. time.slice(0, -3) + 'wen' :
  21720. (output.indexOf('DIS') !== -1) ?
  21721. time.slice(0, -3) + 'ben' :
  21722. time + ' ret';
  21723. return time;
  21724. }
  21725. function translate(number, withoutSuffix, string, isFuture) {
  21726. var numberNoun = numberAsNoun(number);
  21727. switch (string) {
  21728. case 'mm':
  21729. return numberNoun + ' tup';
  21730. case 'hh':
  21731. return numberNoun + ' rep';
  21732. case 'dd':
  21733. return numberNoun + ' jaj';
  21734. case 'MM':
  21735. return numberNoun + ' jar';
  21736. case 'yy':
  21737. return numberNoun + ' DIS';
  21738. }
  21739. }
  21740. function numberAsNoun(number) {
  21741. var hundred = Math.floor((number % 1000) / 100),
  21742. ten = Math.floor((number % 100) / 10),
  21743. one = number % 10,
  21744. word = '';
  21745. if (hundred > 0) {
  21746. word += numbersNouns[hundred] + 'vatlh';
  21747. }
  21748. if (ten > 0) {
  21749. word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
  21750. }
  21751. if (one > 0) {
  21752. word += ((word !== '') ? ' ' : '') + numbersNouns[one];
  21753. }
  21754. return (word === '') ? 'pagh' : word;
  21755. }
  21756. var tlh = moment.defineLocale('tlh', {
  21757. months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
  21758. monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
  21759. monthsParseExact : true,
  21760. weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21761. weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21762. weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
  21763. longDateFormat : {
  21764. LT : 'HH:mm',
  21765. LTS : 'HH:mm:ss',
  21766. L : 'DD.MM.YYYY',
  21767. LL : 'D MMMM YYYY',
  21768. LLL : 'D MMMM YYYY HH:mm',
  21769. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21770. },
  21771. calendar : {
  21772. sameDay: '[DaHjaj] LT',
  21773. nextDay: '[wa’leS] LT',
  21774. nextWeek: 'LLL',
  21775. lastDay: '[wa’Hu’] LT',
  21776. lastWeek: 'LLL',
  21777. sameElse: 'L'
  21778. },
  21779. relativeTime : {
  21780. future : translateFuture,
  21781. past : translatePast,
  21782. s : 'puS lup',
  21783. m : 'wa’ tup',
  21784. mm : translate,
  21785. h : 'wa’ rep',
  21786. hh : translate,
  21787. d : 'wa’ jaj',
  21788. dd : translate,
  21789. M : 'wa’ jar',
  21790. MM : translate,
  21791. y : 'wa’ DIS',
  21792. yy : translate
  21793. },
  21794. ordinalParse: /\d{1,2}\./,
  21795. ordinal : '%d.',
  21796. week : {
  21797. dow : 1, // Monday is the first day of the week.
  21798. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21799. }
  21800. });
  21801. return tlh;
  21802. })));
  21803. /***/ }),
  21804. /* 101 */
  21805. /***/ (function(module, exports, __webpack_require__) {
  21806. //! moment.js locale configuration
  21807. //! locale : Turkish [tr]
  21808. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  21809. //! Burak Yiğit Kaya: https://github.com/BYK
  21810. ;(function (global, factory) {
  21811. true ? factory(__webpack_require__(0)) :
  21812. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21813. factory(global.moment)
  21814. }(this, (function (moment) { 'use strict';
  21815. var suffixes = {
  21816. 1: '\'inci',
  21817. 5: '\'inci',
  21818. 8: '\'inci',
  21819. 70: '\'inci',
  21820. 80: '\'inci',
  21821. 2: '\'nci',
  21822. 7: '\'nci',
  21823. 20: '\'nci',
  21824. 50: '\'nci',
  21825. 3: '\'üncü',
  21826. 4: '\'üncü',
  21827. 100: '\'üncü',
  21828. 6: '\'ncı',
  21829. 9: '\'uncu',
  21830. 10: '\'uncu',
  21831. 30: '\'uncu',
  21832. 60: '\'ıncı',
  21833. 90: '\'ıncı'
  21834. };
  21835. var tr = moment.defineLocale('tr', {
  21836. months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
  21837. monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  21838. weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
  21839. weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  21840. weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  21841. longDateFormat : {
  21842. LT : 'HH:mm',
  21843. LTS : 'HH:mm:ss',
  21844. L : 'DD.MM.YYYY',
  21845. LL : 'D MMMM YYYY',
  21846. LLL : 'D MMMM YYYY HH:mm',
  21847. LLLL : 'dddd, D MMMM YYYY HH:mm'
  21848. },
  21849. calendar : {
  21850. sameDay : '[bugün saat] LT',
  21851. nextDay : '[yarın saat] LT',
  21852. nextWeek : '[haftaya] dddd [saat] LT',
  21853. lastDay : '[dün] LT',
  21854. lastWeek : '[geçen hafta] dddd [saat] LT',
  21855. sameElse : 'L'
  21856. },
  21857. relativeTime : {
  21858. future : '%s sonra',
  21859. past : '%s önce',
  21860. s : 'birkaç saniye',
  21861. m : 'bir dakika',
  21862. mm : '%d dakika',
  21863. h : 'bir saat',
  21864. hh : '%d saat',
  21865. d : 'bir gün',
  21866. dd : '%d gün',
  21867. M : 'bir ay',
  21868. MM : '%d ay',
  21869. y : 'bir yıl',
  21870. yy : '%d yıl'
  21871. },
  21872. ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
  21873. ordinal : function (number) {
  21874. if (number === 0) { // special case for zero
  21875. return number + '\'ıncı';
  21876. }
  21877. var a = number % 10,
  21878. b = number % 100 - a,
  21879. c = number >= 100 ? 100 : null;
  21880. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  21881. },
  21882. week : {
  21883. dow : 1, // Monday is the first day of the week.
  21884. doy : 7 // The week that contains Jan 1st is the first week of the year.
  21885. }
  21886. });
  21887. return tr;
  21888. })));
  21889. /***/ }),
  21890. /* 102 */
  21891. /***/ (function(module, exports, __webpack_require__) {
  21892. //! moment.js locale configuration
  21893. //! locale : Talossan [tzl]
  21894. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  21895. //! author : Iustì Canun
  21896. ;(function (global, factory) {
  21897. true ? factory(__webpack_require__(0)) :
  21898. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21899. factory(global.moment)
  21900. }(this, (function (moment) { 'use strict';
  21901. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  21902. // This is currently too difficult (maybe even impossible) to add.
  21903. var tzl = moment.defineLocale('tzl', {
  21904. months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
  21905. monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  21906. weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  21907. weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  21908. weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  21909. longDateFormat : {
  21910. LT : 'HH.mm',
  21911. LTS : 'HH.mm.ss',
  21912. L : 'DD.MM.YYYY',
  21913. LL : 'D. MMMM [dallas] YYYY',
  21914. LLL : 'D. MMMM [dallas] YYYY HH.mm',
  21915. LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
  21916. },
  21917. meridiemParse: /d\'o|d\'a/i,
  21918. isPM : function (input) {
  21919. return 'd\'o' === input.toLowerCase();
  21920. },
  21921. meridiem : function (hours, minutes, isLower) {
  21922. if (hours > 11) {
  21923. return isLower ? 'd\'o' : 'D\'O';
  21924. } else {
  21925. return isLower ? 'd\'a' : 'D\'A';
  21926. }
  21927. },
  21928. calendar : {
  21929. sameDay : '[oxhi à] LT',
  21930. nextDay : '[demà à] LT',
  21931. nextWeek : 'dddd [à] LT',
  21932. lastDay : '[ieiri à] LT',
  21933. lastWeek : '[sür el] dddd [lasteu à] LT',
  21934. sameElse : 'L'
  21935. },
  21936. relativeTime : {
  21937. future : 'osprei %s',
  21938. past : 'ja%s',
  21939. s : processRelativeTime,
  21940. m : processRelativeTime,
  21941. mm : processRelativeTime,
  21942. h : processRelativeTime,
  21943. hh : processRelativeTime,
  21944. d : processRelativeTime,
  21945. dd : processRelativeTime,
  21946. M : processRelativeTime,
  21947. MM : processRelativeTime,
  21948. y : processRelativeTime,
  21949. yy : processRelativeTime
  21950. },
  21951. ordinalParse: /\d{1,2}\./,
  21952. ordinal : '%d.',
  21953. week : {
  21954. dow : 1, // Monday is the first day of the week.
  21955. doy : 4 // The week that contains Jan 4th is the first week of the year.
  21956. }
  21957. });
  21958. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  21959. var format = {
  21960. 's': ['viensas secunds', '\'iensas secunds'],
  21961. 'm': ['\'n míut', '\'iens míut'],
  21962. 'mm': [number + ' míuts', '' + number + ' míuts'],
  21963. 'h': ['\'n þora', '\'iensa þora'],
  21964. 'hh': [number + ' þoras', '' + number + ' þoras'],
  21965. 'd': ['\'n ziua', '\'iensa ziua'],
  21966. 'dd': [number + ' ziuas', '' + number + ' ziuas'],
  21967. 'M': ['\'n mes', '\'iens mes'],
  21968. 'MM': [number + ' mesen', '' + number + ' mesen'],
  21969. 'y': ['\'n ar', '\'iens ar'],
  21970. 'yy': [number + ' ars', '' + number + ' ars']
  21971. };
  21972. return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);
  21973. }
  21974. return tzl;
  21975. })));
  21976. /***/ }),
  21977. /* 103 */
  21978. /***/ (function(module, exports, __webpack_require__) {
  21979. //! moment.js locale configuration
  21980. //! locale : Central Atlas Tamazight Latin [tzm-latn]
  21981. //! author : Abdel Said : https://github.com/abdelsaid
  21982. ;(function (global, factory) {
  21983. true ? factory(__webpack_require__(0)) :
  21984. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  21985. factory(global.moment)
  21986. }(this, (function (moment) { 'use strict';
  21987. var tzmLatn = moment.defineLocale('tzm-latn', {
  21988. months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  21989. monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
  21990. weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21991. weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21992. weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  21993. longDateFormat : {
  21994. LT : 'HH:mm',
  21995. LTS : 'HH:mm:ss',
  21996. L : 'DD/MM/YYYY',
  21997. LL : 'D MMMM YYYY',
  21998. LLL : 'D MMMM YYYY HH:mm',
  21999. LLLL : 'dddd D MMMM YYYY HH:mm'
  22000. },
  22001. calendar : {
  22002. sameDay: '[asdkh g] LT',
  22003. nextDay: '[aska g] LT',
  22004. nextWeek: 'dddd [g] LT',
  22005. lastDay: '[assant g] LT',
  22006. lastWeek: 'dddd [g] LT',
  22007. sameElse: 'L'
  22008. },
  22009. relativeTime : {
  22010. future : 'dadkh s yan %s',
  22011. past : 'yan %s',
  22012. s : 'imik',
  22013. m : 'minuḍ',
  22014. mm : '%d minuḍ',
  22015. h : 'saɛa',
  22016. hh : '%d tassaɛin',
  22017. d : 'ass',
  22018. dd : '%d ossan',
  22019. M : 'ayowr',
  22020. MM : '%d iyyirn',
  22021. y : 'asgas',
  22022. yy : '%d isgasn'
  22023. },
  22024. week : {
  22025. dow : 6, // Saturday is the first day of the week.
  22026. doy : 12 // The week that contains Jan 1st is the first week of the year.
  22027. }
  22028. });
  22029. return tzmLatn;
  22030. })));
  22031. /***/ }),
  22032. /* 104 */
  22033. /***/ (function(module, exports, __webpack_require__) {
  22034. //! moment.js locale configuration
  22035. //! locale : Central Atlas Tamazight [tzm]
  22036. //! author : Abdel Said : https://github.com/abdelsaid
  22037. ;(function (global, factory) {
  22038. true ? factory(__webpack_require__(0)) :
  22039. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22040. factory(global.moment)
  22041. }(this, (function (moment) { 'use strict';
  22042. var tzm = moment.defineLocale('tzm', {
  22043. months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  22044. monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
  22045. weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  22046. weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  22047. weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  22048. longDateFormat : {
  22049. LT : 'HH:mm',
  22050. LTS: 'HH:mm:ss',
  22051. L : 'DD/MM/YYYY',
  22052. LL : 'D MMMM YYYY',
  22053. LLL : 'D MMMM YYYY HH:mm',
  22054. LLLL : 'dddd D MMMM YYYY HH:mm'
  22055. },
  22056. calendar : {
  22057. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  22058. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  22059. nextWeek: 'dddd [ⴴ] LT',
  22060. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  22061. lastWeek: 'dddd [ⴴ] LT',
  22062. sameElse: 'L'
  22063. },
  22064. relativeTime : {
  22065. future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  22066. past : 'ⵢⴰⵏ %s',
  22067. s : 'ⵉⵎⵉⴽ',
  22068. m : 'ⵎⵉⵏⵓⴺ',
  22069. mm : '%d ⵎⵉⵏⵓⴺ',
  22070. h : 'ⵙⴰⵄⴰ',
  22071. hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  22072. d : 'ⴰⵙⵙ',
  22073. dd : '%d oⵙⵙⴰⵏ',
  22074. M : 'ⴰⵢoⵓⵔ',
  22075. MM : '%d ⵉⵢⵢⵉⵔⵏ',
  22076. y : 'ⴰⵙⴳⴰⵙ',
  22077. yy : '%d ⵉⵙⴳⴰⵙⵏ'
  22078. },
  22079. week : {
  22080. dow : 6, // Saturday is the first day of the week.
  22081. doy : 12 // The week that contains Jan 1st is the first week of the year.
  22082. }
  22083. });
  22084. return tzm;
  22085. })));
  22086. /***/ }),
  22087. /* 105 */
  22088. /***/ (function(module, exports, __webpack_require__) {
  22089. //! moment.js locale configuration
  22090. //! locale : Ukrainian [uk]
  22091. //! author : zemlanin : https://github.com/zemlanin
  22092. //! Author : Menelion Elensúle : https://github.com/Oire
  22093. ;(function (global, factory) {
  22094. true ? factory(__webpack_require__(0)) :
  22095. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22096. factory(global.moment)
  22097. }(this, (function (moment) { 'use strict';
  22098. function plural(word, num) {
  22099. var forms = word.split('_');
  22100. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  22101. }
  22102. function relativeTimeWithPlural(number, withoutSuffix, key) {
  22103. var format = {
  22104. 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  22105. 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  22106. 'dd': 'день_дні_днів',
  22107. 'MM': 'місяць_місяці_місяців',
  22108. 'yy': 'рік_роки_років'
  22109. };
  22110. if (key === 'm') {
  22111. return withoutSuffix ? 'хвилина' : 'хвилину';
  22112. }
  22113. else if (key === 'h') {
  22114. return withoutSuffix ? 'година' : 'годину';
  22115. }
  22116. else {
  22117. return number + ' ' + plural(format[key], +number);
  22118. }
  22119. }
  22120. function weekdaysCaseReplace(m, format) {
  22121. var weekdays = {
  22122. 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
  22123. 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
  22124. 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
  22125. },
  22126. nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
  22127. 'accusative' :
  22128. ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
  22129. 'genitive' :
  22130. 'nominative');
  22131. return weekdays[nounCase][m.day()];
  22132. }
  22133. function processHoursFunction(str) {
  22134. return function () {
  22135. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  22136. };
  22137. }
  22138. var uk = moment.defineLocale('uk', {
  22139. months : {
  22140. 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
  22141. 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
  22142. },
  22143. monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
  22144. weekdays : weekdaysCaseReplace,
  22145. weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  22146. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  22147. longDateFormat : {
  22148. LT : 'HH:mm',
  22149. LTS : 'HH:mm:ss',
  22150. L : 'DD.MM.YYYY',
  22151. LL : 'D MMMM YYYY р.',
  22152. LLL : 'D MMMM YYYY р., HH:mm',
  22153. LLLL : 'dddd, D MMMM YYYY р., HH:mm'
  22154. },
  22155. calendar : {
  22156. sameDay: processHoursFunction('[Сьогодні '),
  22157. nextDay: processHoursFunction('[Завтра '),
  22158. lastDay: processHoursFunction('[Вчора '),
  22159. nextWeek: processHoursFunction('[У] dddd ['),
  22160. lastWeek: function () {
  22161. switch (this.day()) {
  22162. case 0:
  22163. case 3:
  22164. case 5:
  22165. case 6:
  22166. return processHoursFunction('[Минулої] dddd [').call(this);
  22167. case 1:
  22168. case 2:
  22169. case 4:
  22170. return processHoursFunction('[Минулого] dddd [').call(this);
  22171. }
  22172. },
  22173. sameElse: 'L'
  22174. },
  22175. relativeTime : {
  22176. future : 'за %s',
  22177. past : '%s тому',
  22178. s : 'декілька секунд',
  22179. m : relativeTimeWithPlural,
  22180. mm : relativeTimeWithPlural,
  22181. h : 'годину',
  22182. hh : relativeTimeWithPlural,
  22183. d : 'день',
  22184. dd : relativeTimeWithPlural,
  22185. M : 'місяць',
  22186. MM : relativeTimeWithPlural,
  22187. y : 'рік',
  22188. yy : relativeTimeWithPlural
  22189. },
  22190. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  22191. meridiemParse: /ночі|ранку|дня|вечора/,
  22192. isPM: function (input) {
  22193. return /^(дня|вечора)$/.test(input);
  22194. },
  22195. meridiem : function (hour, minute, isLower) {
  22196. if (hour < 4) {
  22197. return 'ночі';
  22198. } else if (hour < 12) {
  22199. return 'ранку';
  22200. } else if (hour < 17) {
  22201. return 'дня';
  22202. } else {
  22203. return 'вечора';
  22204. }
  22205. },
  22206. ordinalParse: /\d{1,2}-(й|го)/,
  22207. ordinal: function (number, period) {
  22208. switch (period) {
  22209. case 'M':
  22210. case 'd':
  22211. case 'DDD':
  22212. case 'w':
  22213. case 'W':
  22214. return number + '-й';
  22215. case 'D':
  22216. return number + '-го';
  22217. default:
  22218. return number;
  22219. }
  22220. },
  22221. week : {
  22222. dow : 1, // Monday is the first day of the week.
  22223. doy : 7 // The week that contains Jan 1st is the first week of the year.
  22224. }
  22225. });
  22226. return uk;
  22227. })));
  22228. /***/ }),
  22229. /* 106 */
  22230. /***/ (function(module, exports, __webpack_require__) {
  22231. //! moment.js locale configuration
  22232. //! locale : Uzbek [uz]
  22233. //! author : Sardor Muminov : https://github.com/muminoff
  22234. ;(function (global, factory) {
  22235. true ? factory(__webpack_require__(0)) :
  22236. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22237. factory(global.moment)
  22238. }(this, (function (moment) { 'use strict';
  22239. var uz = moment.defineLocale('uz', {
  22240. months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
  22241. monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  22242. weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  22243. weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  22244. weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  22245. longDateFormat : {
  22246. LT : 'HH:mm',
  22247. LTS : 'HH:mm:ss',
  22248. L : 'DD/MM/YYYY',
  22249. LL : 'D MMMM YYYY',
  22250. LLL : 'D MMMM YYYY HH:mm',
  22251. LLLL : 'D MMMM YYYY, dddd HH:mm'
  22252. },
  22253. calendar : {
  22254. sameDay : '[Бугун соат] LT [да]',
  22255. nextDay : '[Эртага] LT [да]',
  22256. nextWeek : 'dddd [куни соат] LT [да]',
  22257. lastDay : '[Кеча соат] LT [да]',
  22258. lastWeek : '[Утган] dddd [куни соат] LT [да]',
  22259. sameElse : 'L'
  22260. },
  22261. relativeTime : {
  22262. future : 'Якин %s ичида',
  22263. past : 'Бир неча %s олдин',
  22264. s : 'фурсат',
  22265. m : 'бир дакика',
  22266. mm : '%d дакика',
  22267. h : 'бир соат',
  22268. hh : '%d соат',
  22269. d : 'бир кун',
  22270. dd : '%d кун',
  22271. M : 'бир ой',
  22272. MM : '%d ой',
  22273. y : 'бир йил',
  22274. yy : '%d йил'
  22275. },
  22276. week : {
  22277. dow : 1, // Monday is the first day of the week.
  22278. doy : 7 // The week that contains Jan 4th is the first week of the year.
  22279. }
  22280. });
  22281. return uz;
  22282. })));
  22283. /***/ }),
  22284. /* 107 */
  22285. /***/ (function(module, exports, __webpack_require__) {
  22286. //! moment.js locale configuration
  22287. //! locale : Vietnamese [vi]
  22288. //! author : Bang Nguyen : https://github.com/bangnk
  22289. ;(function (global, factory) {
  22290. true ? factory(__webpack_require__(0)) :
  22291. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22292. factory(global.moment)
  22293. }(this, (function (moment) { 'use strict';
  22294. var vi = moment.defineLocale('vi', {
  22295. months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
  22296. monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
  22297. monthsParseExact : true,
  22298. weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
  22299. weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  22300. weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  22301. weekdaysParseExact : true,
  22302. meridiemParse: /sa|ch/i,
  22303. isPM : function (input) {
  22304. return /^ch$/i.test(input);
  22305. },
  22306. meridiem : function (hours, minutes, isLower) {
  22307. if (hours < 12) {
  22308. return isLower ? 'sa' : 'SA';
  22309. } else {
  22310. return isLower ? 'ch' : 'CH';
  22311. }
  22312. },
  22313. longDateFormat : {
  22314. LT : 'HH:mm',
  22315. LTS : 'HH:mm:ss',
  22316. L : 'DD/MM/YYYY',
  22317. LL : 'D MMMM [năm] YYYY',
  22318. LLL : 'D MMMM [năm] YYYY HH:mm',
  22319. LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
  22320. l : 'DD/M/YYYY',
  22321. ll : 'D MMM YYYY',
  22322. lll : 'D MMM YYYY HH:mm',
  22323. llll : 'ddd, D MMM YYYY HH:mm'
  22324. },
  22325. calendar : {
  22326. sameDay: '[Hôm nay lúc] LT',
  22327. nextDay: '[Ngày mai lúc] LT',
  22328. nextWeek: 'dddd [tuần tới lúc] LT',
  22329. lastDay: '[Hôm qua lúc] LT',
  22330. lastWeek: 'dddd [tuần rồi lúc] LT',
  22331. sameElse: 'L'
  22332. },
  22333. relativeTime : {
  22334. future : '%s tới',
  22335. past : '%s trước',
  22336. s : 'vài giây',
  22337. m : 'một phút',
  22338. mm : '%d phút',
  22339. h : 'một giờ',
  22340. hh : '%d giờ',
  22341. d : 'một ngày',
  22342. dd : '%d ngày',
  22343. M : 'một tháng',
  22344. MM : '%d tháng',
  22345. y : 'một năm',
  22346. yy : '%d năm'
  22347. },
  22348. ordinalParse: /\d{1,2}/,
  22349. ordinal : function (number) {
  22350. return number;
  22351. },
  22352. week : {
  22353. dow : 1, // Monday is the first day of the week.
  22354. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22355. }
  22356. });
  22357. return vi;
  22358. })));
  22359. /***/ }),
  22360. /* 108 */
  22361. /***/ (function(module, exports, __webpack_require__) {
  22362. //! moment.js locale configuration
  22363. //! locale : Pseudo [x-pseudo]
  22364. //! author : Andrew Hood : https://github.com/andrewhood125
  22365. ;(function (global, factory) {
  22366. true ? factory(__webpack_require__(0)) :
  22367. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22368. factory(global.moment)
  22369. }(this, (function (moment) { 'use strict';
  22370. var xPseudo = moment.defineLocale('x-pseudo', {
  22371. months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
  22372. monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
  22373. monthsParseExact : true,
  22374. weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
  22375. weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  22376. weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  22377. weekdaysParseExact : true,
  22378. longDateFormat : {
  22379. LT : 'HH:mm',
  22380. L : 'DD/MM/YYYY',
  22381. LL : 'D MMMM YYYY',
  22382. LLL : 'D MMMM YYYY HH:mm',
  22383. LLLL : 'dddd, D MMMM YYYY HH:mm'
  22384. },
  22385. calendar : {
  22386. sameDay : '[T~ódá~ý át] LT',
  22387. nextDay : '[T~ómó~rró~w át] LT',
  22388. nextWeek : 'dddd [át] LT',
  22389. lastDay : '[Ý~ést~érdá~ý át] LT',
  22390. lastWeek : '[L~ást] dddd [át] LT',
  22391. sameElse : 'L'
  22392. },
  22393. relativeTime : {
  22394. future : 'í~ñ %s',
  22395. past : '%s á~gó',
  22396. s : 'á ~féw ~sécó~ñds',
  22397. m : 'á ~míñ~úté',
  22398. mm : '%d m~íñú~tés',
  22399. h : 'á~ñ hó~úr',
  22400. hh : '%d h~óúrs',
  22401. d : 'á ~dáý',
  22402. dd : '%d d~áýs',
  22403. M : 'á ~móñ~th',
  22404. MM : '%d m~óñt~hs',
  22405. y : 'á ~ýéár',
  22406. yy : '%d ý~éárs'
  22407. },
  22408. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  22409. ordinal : function (number) {
  22410. var b = number % 10,
  22411. output = (~~(number % 100 / 10) === 1) ? 'th' :
  22412. (b === 1) ? 'st' :
  22413. (b === 2) ? 'nd' :
  22414. (b === 3) ? 'rd' : 'th';
  22415. return number + output;
  22416. },
  22417. week : {
  22418. dow : 1, // Monday is the first day of the week.
  22419. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22420. }
  22421. });
  22422. return xPseudo;
  22423. })));
  22424. /***/ }),
  22425. /* 109 */
  22426. /***/ (function(module, exports, __webpack_require__) {
  22427. //! moment.js locale configuration
  22428. //! locale : Yoruba Nigeria [yo]
  22429. //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
  22430. ;(function (global, factory) {
  22431. true ? factory(__webpack_require__(0)) :
  22432. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22433. factory(global.moment)
  22434. }(this, (function (moment) { 'use strict';
  22435. var yo = moment.defineLocale('yo', {
  22436. months : 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
  22437. monthsShort : 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
  22438. weekdays : 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
  22439. weekdaysShort : 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
  22440. weekdaysMin : 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
  22441. longDateFormat : {
  22442. LT : 'h:mm A',
  22443. LTS : 'h:mm:ss A',
  22444. L : 'DD/MM/YYYY',
  22445. LL : 'D MMMM YYYY',
  22446. LLL : 'D MMMM YYYY h:mm A',
  22447. LLLL : 'dddd, D MMMM YYYY h:mm A'
  22448. },
  22449. calendar : {
  22450. sameDay : '[Ònì ni] LT',
  22451. nextDay : '[Ọ̀la ni] LT',
  22452. nextWeek : 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
  22453. lastDay : '[Àna ni] LT',
  22454. lastWeek : 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
  22455. sameElse : 'L'
  22456. },
  22457. relativeTime : {
  22458. future : 'ní %s',
  22459. past : '%s kọjá',
  22460. s : 'ìsẹjú aayá die',
  22461. m : 'ìsẹjú kan',
  22462. mm : 'ìsẹjú %d',
  22463. h : 'wákati kan',
  22464. hh : 'wákati %d',
  22465. d : 'ọjọ́ kan',
  22466. dd : 'ọjọ́ %d',
  22467. M : 'osù kan',
  22468. MM : 'osù %d',
  22469. y : 'ọdún kan',
  22470. yy : 'ọdún %d'
  22471. },
  22472. ordinalParse : /ọjọ́\s\d{1,2}/,
  22473. ordinal : 'ọjọ́ %d',
  22474. week : {
  22475. dow : 1, // Monday is the first day of the week.
  22476. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22477. }
  22478. });
  22479. return yo;
  22480. })));
  22481. /***/ }),
  22482. /* 110 */
  22483. /***/ (function(module, exports, __webpack_require__) {
  22484. //! moment.js locale configuration
  22485. //! locale : Chinese (China) [zh-cn]
  22486. //! author : suupic : https://github.com/suupic
  22487. //! author : Zeno Zeng : https://github.com/zenozeng
  22488. ;(function (global, factory) {
  22489. true ? factory(__webpack_require__(0)) :
  22490. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22491. factory(global.moment)
  22492. }(this, (function (moment) { 'use strict';
  22493. var zhCn = moment.defineLocale('zh-cn', {
  22494. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22495. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22496. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22497. weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  22498. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22499. longDateFormat : {
  22500. LT : 'Ah点mm分',
  22501. LTS : 'Ah点m分s秒',
  22502. L : 'YYYY-MM-DD',
  22503. LL : 'YYYY年MMMD日',
  22504. LLL : 'YYYY年MMMD日Ah点mm分',
  22505. LLLL : 'YYYY年MMMD日ddddAh点mm分',
  22506. l : 'YYYY-MM-DD',
  22507. ll : 'YYYY年MMMD日',
  22508. lll : 'YYYY年MMMD日Ah点mm分',
  22509. llll : 'YYYY年MMMD日ddddAh点mm分'
  22510. },
  22511. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22512. meridiemHour: function (hour, meridiem) {
  22513. if (hour === 12) {
  22514. hour = 0;
  22515. }
  22516. if (meridiem === '凌晨' || meridiem === '早上' ||
  22517. meridiem === '上午') {
  22518. return hour;
  22519. } else if (meridiem === '下午' || meridiem === '晚上') {
  22520. return hour + 12;
  22521. } else {
  22522. // '中午'
  22523. return hour >= 11 ? hour : hour + 12;
  22524. }
  22525. },
  22526. meridiem : function (hour, minute, isLower) {
  22527. var hm = hour * 100 + minute;
  22528. if (hm < 600) {
  22529. return '凌晨';
  22530. } else if (hm < 900) {
  22531. return '早上';
  22532. } else if (hm < 1130) {
  22533. return '上午';
  22534. } else if (hm < 1230) {
  22535. return '中午';
  22536. } else if (hm < 1800) {
  22537. return '下午';
  22538. } else {
  22539. return '晚上';
  22540. }
  22541. },
  22542. calendar : {
  22543. sameDay : function () {
  22544. return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
  22545. },
  22546. nextDay : function () {
  22547. return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
  22548. },
  22549. lastDay : function () {
  22550. return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
  22551. },
  22552. nextWeek : function () {
  22553. var startOfWeek, prefix;
  22554. startOfWeek = moment().startOf('week');
  22555. prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]';
  22556. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  22557. },
  22558. lastWeek : function () {
  22559. var startOfWeek, prefix;
  22560. startOfWeek = moment().startOf('week');
  22561. prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
  22562. return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
  22563. },
  22564. sameElse : 'LL'
  22565. },
  22566. ordinalParse: /\d{1,2}(日|月|周)/,
  22567. ordinal : function (number, period) {
  22568. switch (period) {
  22569. case 'd':
  22570. case 'D':
  22571. case 'DDD':
  22572. return number + '日';
  22573. case 'M':
  22574. return number + '月';
  22575. case 'w':
  22576. case 'W':
  22577. return number + '周';
  22578. default:
  22579. return number;
  22580. }
  22581. },
  22582. relativeTime : {
  22583. future : '%s内',
  22584. past : '%s前',
  22585. s : '几秒',
  22586. m : '1 分钟',
  22587. mm : '%d 分钟',
  22588. h : '1 小时',
  22589. hh : '%d 小时',
  22590. d : '1 天',
  22591. dd : '%d 天',
  22592. M : '1 个月',
  22593. MM : '%d 个月',
  22594. y : '1 年',
  22595. yy : '%d 年'
  22596. },
  22597. week : {
  22598. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  22599. dow : 1, // Monday is the first day of the week.
  22600. doy : 4 // The week that contains Jan 4th is the first week of the year.
  22601. }
  22602. });
  22603. return zhCn;
  22604. })));
  22605. /***/ }),
  22606. /* 111 */
  22607. /***/ (function(module, exports, __webpack_require__) {
  22608. //! moment.js locale configuration
  22609. //! locale : Chinese (Hong Kong) [zh-hk]
  22610. //! author : Ben : https://github.com/ben-lin
  22611. //! author : Chris Lam : https://github.com/hehachris
  22612. //! author : Konstantin : https://github.com/skfd
  22613. ;(function (global, factory) {
  22614. true ? factory(__webpack_require__(0)) :
  22615. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22616. factory(global.moment)
  22617. }(this, (function (moment) { 'use strict';
  22618. var zhHk = moment.defineLocale('zh-hk', {
  22619. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22620. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22621. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22622. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  22623. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22624. longDateFormat : {
  22625. LT : 'Ah點mm分',
  22626. LTS : 'Ah點m分s秒',
  22627. L : 'YYYY年MMMD日',
  22628. LL : 'YYYY年MMMD日',
  22629. LLL : 'YYYY年MMMD日Ah點mm分',
  22630. LLLL : 'YYYY年MMMD日ddddAh點mm分',
  22631. l : 'YYYY年MMMD日',
  22632. ll : 'YYYY年MMMD日',
  22633. lll : 'YYYY年MMMD日Ah點mm分',
  22634. llll : 'YYYY年MMMD日ddddAh點mm分'
  22635. },
  22636. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22637. meridiemHour : function (hour, meridiem) {
  22638. if (hour === 12) {
  22639. hour = 0;
  22640. }
  22641. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  22642. return hour;
  22643. } else if (meridiem === '中午') {
  22644. return hour >= 11 ? hour : hour + 12;
  22645. } else if (meridiem === '下午' || meridiem === '晚上') {
  22646. return hour + 12;
  22647. }
  22648. },
  22649. meridiem : function (hour, minute, isLower) {
  22650. var hm = hour * 100 + minute;
  22651. if (hm < 600) {
  22652. return '凌晨';
  22653. } else if (hm < 900) {
  22654. return '早上';
  22655. } else if (hm < 1130) {
  22656. return '上午';
  22657. } else if (hm < 1230) {
  22658. return '中午';
  22659. } else if (hm < 1800) {
  22660. return '下午';
  22661. } else {
  22662. return '晚上';
  22663. }
  22664. },
  22665. calendar : {
  22666. sameDay : '[今天]LT',
  22667. nextDay : '[明天]LT',
  22668. nextWeek : '[下]ddddLT',
  22669. lastDay : '[昨天]LT',
  22670. lastWeek : '[上]ddddLT',
  22671. sameElse : 'L'
  22672. },
  22673. ordinalParse: /\d{1,2}(日|月|週)/,
  22674. ordinal : function (number, period) {
  22675. switch (period) {
  22676. case 'd' :
  22677. case 'D' :
  22678. case 'DDD' :
  22679. return number + '日';
  22680. case 'M' :
  22681. return number + '月';
  22682. case 'w' :
  22683. case 'W' :
  22684. return number + '週';
  22685. default :
  22686. return number;
  22687. }
  22688. },
  22689. relativeTime : {
  22690. future : '%s內',
  22691. past : '%s前',
  22692. s : '幾秒',
  22693. m : '1 分鐘',
  22694. mm : '%d 分鐘',
  22695. h : '1 小時',
  22696. hh : '%d 小時',
  22697. d : '1 天',
  22698. dd : '%d 天',
  22699. M : '1 個月',
  22700. MM : '%d 個月',
  22701. y : '1 年',
  22702. yy : '%d 年'
  22703. }
  22704. });
  22705. return zhHk;
  22706. })));
  22707. /***/ }),
  22708. /* 112 */
  22709. /***/ (function(module, exports, __webpack_require__) {
  22710. //! moment.js locale configuration
  22711. //! locale : Chinese (Taiwan) [zh-tw]
  22712. //! author : Ben : https://github.com/ben-lin
  22713. //! author : Chris Lam : https://github.com/hehachris
  22714. ;(function (global, factory) {
  22715. true ? factory(__webpack_require__(0)) :
  22716. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  22717. factory(global.moment)
  22718. }(this, (function (moment) { 'use strict';
  22719. var zhTw = moment.defineLocale('zh-tw', {
  22720. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  22721. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  22722. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  22723. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  22724. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  22725. longDateFormat : {
  22726. LT : 'Ah點mm分',
  22727. LTS : 'Ah點m分s秒',
  22728. L : 'YYYY年MMMD日',
  22729. LL : 'YYYY年MMMD日',
  22730. LLL : 'YYYY年MMMD日Ah點mm分',
  22731. LLLL : 'YYYY年MMMD日ddddAh點mm分',
  22732. l : 'YYYY年MMMD日',
  22733. ll : 'YYYY年MMMD日',
  22734. lll : 'YYYY年MMMD日Ah點mm分',
  22735. llll : 'YYYY年MMMD日ddddAh點mm分'
  22736. },
  22737. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  22738. meridiemHour : function (hour, meridiem) {
  22739. if (hour === 12) {
  22740. hour = 0;
  22741. }
  22742. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  22743. return hour;
  22744. } else if (meridiem === '中午') {
  22745. return hour >= 11 ? hour : hour + 12;
  22746. } else if (meridiem === '下午' || meridiem === '晚上') {
  22747. return hour + 12;
  22748. }
  22749. },
  22750. meridiem : function (hour, minute, isLower) {
  22751. var hm = hour * 100 + minute;
  22752. if (hm < 600) {
  22753. return '凌晨';
  22754. } else if (hm < 900) {
  22755. return '早上';
  22756. } else if (hm < 1130) {
  22757. return '上午';
  22758. } else if (hm < 1230) {
  22759. return '中午';
  22760. } else if (hm < 1800) {
  22761. return '下午';
  22762. } else {
  22763. return '晚上';
  22764. }
  22765. },
  22766. calendar : {
  22767. sameDay : '[今天]LT',
  22768. nextDay : '[明天]LT',
  22769. nextWeek : '[下]ddddLT',
  22770. lastDay : '[昨天]LT',
  22771. lastWeek : '[上]ddddLT',
  22772. sameElse : 'L'
  22773. },
  22774. ordinalParse: /\d{1,2}(日|月|週)/,
  22775. ordinal : function (number, period) {
  22776. switch (period) {
  22777. case 'd' :
  22778. case 'D' :
  22779. case 'DDD' :
  22780. return number + '日';
  22781. case 'M' :
  22782. return number + '月';
  22783. case 'w' :
  22784. case 'W' :
  22785. return number + '週';
  22786. default :
  22787. return number;
  22788. }
  22789. },
  22790. relativeTime : {
  22791. future : '%s內',
  22792. past : '%s前',
  22793. s : '幾秒',
  22794. m : '1 分鐘',
  22795. mm : '%d 分鐘',
  22796. h : '1 小時',
  22797. hh : '%d 小時',
  22798. d : '1 天',
  22799. dd : '%d 天',
  22800. M : '1 個月',
  22801. MM : '%d 個月',
  22802. y : '1 年',
  22803. yy : '%d 年'
  22804. }
  22805. });
  22806. return zhTw;
  22807. })));
  22808. /***/ }),
  22809. /* 113 */
  22810. /***/ (function(module, exports) {
  22811. // shim for using process in browser
  22812. var process = module.exports = {};
  22813. // cached from whatever global is present so that test runners that stub it
  22814. // don't break things. But we need to wrap it in a try catch in case it is
  22815. // wrapped in strict mode code which doesn't define any globals. It's inside a
  22816. // function because try/catches deoptimize in certain engines.
  22817. var cachedSetTimeout;
  22818. var cachedClearTimeout;
  22819. function defaultSetTimout() {
  22820. throw new Error('setTimeout has not been defined');
  22821. }
  22822. function defaultClearTimeout () {
  22823. throw new Error('clearTimeout has not been defined');
  22824. }
  22825. (function () {
  22826. try {
  22827. if (typeof setTimeout === 'function') {
  22828. cachedSetTimeout = setTimeout;
  22829. } else {
  22830. cachedSetTimeout = defaultSetTimout;
  22831. }
  22832. } catch (e) {
  22833. cachedSetTimeout = defaultSetTimout;
  22834. }
  22835. try {
  22836. if (typeof clearTimeout === 'function') {
  22837. cachedClearTimeout = clearTimeout;
  22838. } else {
  22839. cachedClearTimeout = defaultClearTimeout;
  22840. }
  22841. } catch (e) {
  22842. cachedClearTimeout = defaultClearTimeout;
  22843. }
  22844. } ())
  22845. function runTimeout(fun) {
  22846. if (cachedSetTimeout === setTimeout) {
  22847. //normal enviroments in sane situations
  22848. return setTimeout(fun, 0);
  22849. }
  22850. // if setTimeout wasn't available but was latter defined
  22851. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  22852. cachedSetTimeout = setTimeout;
  22853. return setTimeout(fun, 0);
  22854. }
  22855. try {
  22856. // when when somebody has screwed with setTimeout but no I.E. maddness
  22857. return cachedSetTimeout(fun, 0);
  22858. } catch(e){
  22859. try {
  22860. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22861. return cachedSetTimeout.call(null, fun, 0);
  22862. } catch(e){
  22863. // 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
  22864. return cachedSetTimeout.call(this, fun, 0);
  22865. }
  22866. }
  22867. }
  22868. function runClearTimeout(marker) {
  22869. if (cachedClearTimeout === clearTimeout) {
  22870. //normal enviroments in sane situations
  22871. return clearTimeout(marker);
  22872. }
  22873. // if clearTimeout wasn't available but was latter defined
  22874. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  22875. cachedClearTimeout = clearTimeout;
  22876. return clearTimeout(marker);
  22877. }
  22878. try {
  22879. // when when somebody has screwed with setTimeout but no I.E. maddness
  22880. return cachedClearTimeout(marker);
  22881. } catch (e){
  22882. try {
  22883. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  22884. return cachedClearTimeout.call(null, marker);
  22885. } catch (e){
  22886. // 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.
  22887. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  22888. return cachedClearTimeout.call(this, marker);
  22889. }
  22890. }
  22891. }
  22892. var queue = [];
  22893. var draining = false;
  22894. var currentQueue;
  22895. var queueIndex = -1;
  22896. function cleanUpNextTick() {
  22897. if (!draining || !currentQueue) {
  22898. return;
  22899. }
  22900. draining = false;
  22901. if (currentQueue.length) {
  22902. queue = currentQueue.concat(queue);
  22903. } else {
  22904. queueIndex = -1;
  22905. }
  22906. if (queue.length) {
  22907. drainQueue();
  22908. }
  22909. }
  22910. function drainQueue() {
  22911. if (draining) {
  22912. return;
  22913. }
  22914. var timeout = runTimeout(cleanUpNextTick);
  22915. draining = true;
  22916. var len = queue.length;
  22917. while(len) {
  22918. currentQueue = queue;
  22919. queue = [];
  22920. while (++queueIndex < len) {
  22921. if (currentQueue) {
  22922. currentQueue[queueIndex].run();
  22923. }
  22924. }
  22925. queueIndex = -1;
  22926. len = queue.length;
  22927. }
  22928. currentQueue = null;
  22929. draining = false;
  22930. runClearTimeout(timeout);
  22931. }
  22932. process.nextTick = function (fun) {
  22933. var args = new Array(arguments.length - 1);
  22934. if (arguments.length > 1) {
  22935. for (var i = 1; i < arguments.length; i++) {
  22936. args[i - 1] = arguments[i];
  22937. }
  22938. }
  22939. queue.push(new Item(fun, args));
  22940. if (queue.length === 1 && !draining) {
  22941. runTimeout(drainQueue);
  22942. }
  22943. };
  22944. // v8 likes predictible objects
  22945. function Item(fun, array) {
  22946. this.fun = fun;
  22947. this.array = array;
  22948. }
  22949. Item.prototype.run = function () {
  22950. this.fun.apply(null, this.array);
  22951. };
  22952. process.title = 'browser';
  22953. process.browser = true;
  22954. process.env = {};
  22955. process.argv = [];
  22956. process.version = ''; // empty string to avoid regexp issues
  22957. process.versions = {};
  22958. function noop() {}
  22959. process.on = noop;
  22960. process.addListener = noop;
  22961. process.once = noop;
  22962. process.off = noop;
  22963. process.removeListener = noop;
  22964. process.removeAllListeners = noop;
  22965. process.emit = noop;
  22966. process.binding = function (name) {
  22967. throw new Error('process.binding is not supported');
  22968. };
  22969. process.cwd = function () { return '/' };
  22970. process.chdir = function (dir) {
  22971. throw new Error('process.chdir is not supported');
  22972. };
  22973. process.umask = function() { return 0; };
  22974. /***/ }),
  22975. /* 114 */
  22976. /***/ (function(module, exports, __webpack_require__) {
  22977. /*
  22978. MIT License http://www.opensource.org/licenses/mit-license.php
  22979. Author Tobias Koppers @sokra
  22980. Modified by Evan You @yyx990803
  22981. */
  22982. var hasDocument = typeof document !== 'undefined'
  22983. if (typeof DEBUG !== 'undefined' && DEBUG) {
  22984. if (!hasDocument) {
  22985. throw new Error(
  22986. 'vue-style-loader cannot be used in a non-browser environment. ' +
  22987. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  22988. ) }
  22989. }
  22990. var listToStyles = __webpack_require__(189)
  22991. /*
  22992. type StyleObject = {
  22993. id: number;
  22994. parts: Array<StyleObjectPart>
  22995. }
  22996. type StyleObjectPart = {
  22997. css: string;
  22998. media: string;
  22999. sourceMap: ?string
  23000. }
  23001. */
  23002. var stylesInDom = {/*
  23003. [id: number]: {
  23004. id: number,
  23005. refs: number,
  23006. parts: Array<(obj?: StyleObjectPart) => void>
  23007. }
  23008. */}
  23009. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  23010. var singletonElement = null
  23011. var singletonCounter = 0
  23012. var isProduction = false
  23013. var noop = function () {}
  23014. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  23015. // tags it will allow on a page
  23016. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  23017. module.exports = function (parentId, list, _isProduction) {
  23018. isProduction = _isProduction
  23019. var styles = listToStyles(parentId, list)
  23020. addStylesToDom(styles)
  23021. return function update (newList) {
  23022. var mayRemove = []
  23023. for (var i = 0; i < styles.length; i++) {
  23024. var item = styles[i]
  23025. var domStyle = stylesInDom[item.id]
  23026. domStyle.refs--
  23027. mayRemove.push(domStyle)
  23028. }
  23029. if (newList) {
  23030. styles = listToStyles(parentId, newList)
  23031. addStylesToDom(styles)
  23032. } else {
  23033. styles = []
  23034. }
  23035. for (var i = 0; i < mayRemove.length; i++) {
  23036. var domStyle = mayRemove[i]
  23037. if (domStyle.refs === 0) {
  23038. for (var j = 0; j < domStyle.parts.length; j++) {
  23039. domStyle.parts[j]()
  23040. }
  23041. delete stylesInDom[domStyle.id]
  23042. }
  23043. }
  23044. }
  23045. }
  23046. function addStylesToDom (styles /* Array<StyleObject> */) {
  23047. for (var i = 0; i < styles.length; i++) {
  23048. var item = styles[i]
  23049. var domStyle = stylesInDom[item.id]
  23050. if (domStyle) {
  23051. domStyle.refs++
  23052. for (var j = 0; j < domStyle.parts.length; j++) {
  23053. domStyle.parts[j](item.parts[j])
  23054. }
  23055. for (; j < item.parts.length; j++) {
  23056. domStyle.parts.push(addStyle(item.parts[j]))
  23057. }
  23058. if (domStyle.parts.length > item.parts.length) {
  23059. domStyle.parts.length = item.parts.length
  23060. }
  23061. } else {
  23062. var parts = []
  23063. for (var j = 0; j < item.parts.length; j++) {
  23064. parts.push(addStyle(item.parts[j]))
  23065. }
  23066. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  23067. }
  23068. }
  23069. }
  23070. function listToStyles (parentId, list) {
  23071. var styles = []
  23072. var newStyles = {}
  23073. for (var i = 0; i < list.length; i++) {
  23074. var item = list[i]
  23075. var id = item[0]
  23076. var css = item[1]
  23077. var media = item[2]
  23078. var sourceMap = item[3]
  23079. var part = { css: css, media: media, sourceMap: sourceMap }
  23080. if (!newStyles[id]) {
  23081. part.id = parentId + ':0'
  23082. styles.push(newStyles[id] = { id: id, parts: [part] })
  23083. } else {
  23084. part.id = parentId + ':' + newStyles[id].parts.length
  23085. newStyles[id].parts.push(part)
  23086. }
  23087. }
  23088. return styles
  23089. }
  23090. function createStyleElement () {
  23091. var styleElement = document.createElement('style')
  23092. styleElement.type = 'text/css'
  23093. head.appendChild(styleElement)
  23094. return styleElement
  23095. }
  23096. function addStyle (obj /* StyleObjectPart */) {
  23097. var update, remove
  23098. var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
  23099. var hasSSR = styleElement != null
  23100. // if in production mode and style is already provided by SSR,
  23101. // simply do nothing.
  23102. if (hasSSR && isProduction) {
  23103. return noop
  23104. }
  23105. if (isOldIE) {
  23106. // use singleton mode for IE9.
  23107. var styleIndex = singletonCounter++
  23108. styleElement = singletonElement || (singletonElement = createStyleElement())
  23109. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  23110. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  23111. } else {
  23112. // use multi-style-tag mode in all other cases
  23113. styleElement = styleElement || createStyleElement()
  23114. update = applyToTag.bind(null, styleElement)
  23115. remove = function () {
  23116. styleElement.parentNode.removeChild(styleElement)
  23117. }
  23118. }
  23119. if (!hasSSR) {
  23120. update(obj)
  23121. }
  23122. return function updateStyle (newObj /* StyleObjectPart */) {
  23123. if (newObj) {
  23124. if (newObj.css === obj.css &&
  23125. newObj.media === obj.media &&
  23126. newObj.sourceMap === obj.sourceMap) {
  23127. return
  23128. }
  23129. update(obj = newObj)
  23130. } else {
  23131. remove()
  23132. }
  23133. }
  23134. }
  23135. var replaceText = (function () {
  23136. var textStore = []
  23137. return function (index, replacement) {
  23138. textStore[index] = replacement
  23139. return textStore.filter(Boolean).join('\n')
  23140. }
  23141. })()
  23142. function applyToSingletonTag (styleElement, index, remove, obj) {
  23143. var css = remove ? '' : obj.css
  23144. if (styleElement.styleSheet) {
  23145. styleElement.styleSheet.cssText = replaceText(index, css)
  23146. } else {
  23147. var cssNode = document.createTextNode(css)
  23148. var childNodes = styleElement.childNodes
  23149. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  23150. if (childNodes.length) {
  23151. styleElement.insertBefore(cssNode, childNodes[index])
  23152. } else {
  23153. styleElement.appendChild(cssNode)
  23154. }
  23155. }
  23156. }
  23157. function applyToTag (styleElement, obj) {
  23158. var css = obj.css
  23159. var media = obj.media
  23160. var sourceMap = obj.sourceMap
  23161. if (media) {
  23162. styleElement.setAttribute('media', media)
  23163. }
  23164. if (sourceMap) {
  23165. // https://developer.chrome.com/devtools/docs/javascript-debugging
  23166. // this makes source maps inside style tags work properly in Chrome
  23167. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  23168. // http://stackoverflow.com/a/26603875
  23169. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  23170. }
  23171. if (styleElement.styleSheet) {
  23172. styleElement.styleSheet.cssText = css
  23173. } else {
  23174. while (styleElement.firstChild) {
  23175. styleElement.removeChild(styleElement.firstChild)
  23176. }
  23177. styleElement.appendChild(document.createTextNode(css))
  23178. }
  23179. }
  23180. /***/ }),
  23181. /* 115 */
  23182. /***/ (function(module, exports) {
  23183. // removed by extract-text-webpack-plugin
  23184. /***/ }),
  23185. /* 116 */
  23186. /***/ (function(module, exports) {
  23187. // removed by extract-text-webpack-plugin
  23188. /***/ }),
  23189. /* 117 */
  23190. /***/ (function(module, exports, __webpack_require__) {
  23191. /* styles */
  23192. __webpack_require__(188)
  23193. var Component = __webpack_require__(1)(
  23194. /* script */
  23195. __webpack_require__(175),
  23196. /* template */
  23197. __webpack_require__(184),
  23198. /* scopeId */
  23199. null,
  23200. /* cssModules */
  23201. null
  23202. )
  23203. Component.options.__file = "G:\\Server Stats\\webSource\\config.vue"
  23204. 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.")}
  23205. if (Component.options.functional) {console.error("[vue-loader] config.vue: functional components are not supported with templates, they should use render functions.")}
  23206. /* hot reload */
  23207. if (false) {(function () {
  23208. var hotAPI = require("vue-hot-reload-api")
  23209. hotAPI.install(require("vue"), false)
  23210. if (!hotAPI.compatible) return
  23211. module.hot.accept()
  23212. if (!module.hot.data) {
  23213. hotAPI.createRecord("data-v-798d3b91", Component.options)
  23214. } else {
  23215. hotAPI.reload("data-v-798d3b91", Component.options)
  23216. }
  23217. })()}
  23218. module.exports = Component.exports
  23219. /***/ }),
  23220. /* 118 */
  23221. /***/ (function(module, exports, __webpack_require__) {
  23222. var Component = __webpack_require__(1)(
  23223. /* script */
  23224. __webpack_require__(176),
  23225. /* template */
  23226. __webpack_require__(182),
  23227. /* scopeId */
  23228. null,
  23229. /* cssModules */
  23230. null
  23231. )
  23232. Component.options.__file = "G:\\Server Stats\\webSource\\server.vue"
  23233. 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.")}
  23234. if (Component.options.functional) {console.error("[vue-loader] server.vue: functional components are not supported with templates, they should use render functions.")}
  23235. /* hot reload */
  23236. if (false) {(function () {
  23237. var hotAPI = require("vue-hot-reload-api")
  23238. hotAPI.install(require("vue"), false)
  23239. if (!hotAPI.compatible) return
  23240. module.hot.accept()
  23241. if (!module.hot.data) {
  23242. hotAPI.createRecord("data-v-49b001dc", Component.options)
  23243. } else {
  23244. hotAPI.reload("data-v-49b001dc", Component.options)
  23245. }
  23246. })()}
  23247. module.exports = Component.exports
  23248. /***/ }),
  23249. /* 119 */
  23250. /***/ (function(module, exports, __webpack_require__) {
  23251. var Component = __webpack_require__(1)(
  23252. /* script */
  23253. __webpack_require__(177),
  23254. /* template */
  23255. __webpack_require__(181),
  23256. /* scopeId */
  23257. null,
  23258. /* cssModules */
  23259. null
  23260. )
  23261. Component.options.__file = "G:\\Server Stats\\webSource\\serverDetails.vue"
  23262. 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.")}
  23263. if (Component.options.functional) {console.error("[vue-loader] serverDetails.vue: functional components are not supported with templates, they should use render functions.")}
  23264. /* hot reload */
  23265. if (false) {(function () {
  23266. var hotAPI = require("vue-hot-reload-api")
  23267. hotAPI.install(require("vue"), false)
  23268. if (!hotAPI.compatible) return
  23269. module.hot.accept()
  23270. if (!module.hot.data) {
  23271. hotAPI.createRecord("data-v-04a2f200", Component.options)
  23272. } else {
  23273. hotAPI.reload("data-v-04a2f200", Component.options)
  23274. }
  23275. })()}
  23276. module.exports = Component.exports
  23277. /***/ }),
  23278. /* 120 */
  23279. /***/ (function(module, exports, __webpack_require__) {
  23280. /* styles */
  23281. __webpack_require__(187)
  23282. var Component = __webpack_require__(1)(
  23283. /* script */
  23284. __webpack_require__(178),
  23285. /* template */
  23286. __webpack_require__(183),
  23287. /* scopeId */
  23288. null,
  23289. /* cssModules */
  23290. null
  23291. )
  23292. Component.options.__file = "G:\\Server Stats\\webSource\\serverList.vue"
  23293. 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.")}
  23294. if (Component.options.functional) {console.error("[vue-loader] serverList.vue: functional components are not supported with templates, they should use render functions.")}
  23295. /* hot reload */
  23296. if (false) {(function () {
  23297. var hotAPI = require("vue-hot-reload-api")
  23298. hotAPI.install(require("vue"), false)
  23299. if (!hotAPI.compatible) return
  23300. module.hot.accept()
  23301. if (!module.hot.data) {
  23302. hotAPI.createRecord("data-v-7440c7d0", Component.options)
  23303. } else {
  23304. hotAPI.reload("data-v-7440c7d0", Component.options)
  23305. }
  23306. })()}
  23307. module.exports = Component.exports
  23308. /***/ }),
  23309. /* 121 */
  23310. /***/ (function(module, exports, __webpack_require__) {
  23311. var Component = __webpack_require__(1)(
  23312. /* script */
  23313. __webpack_require__(179),
  23314. /* template */
  23315. __webpack_require__(185),
  23316. /* scopeId */
  23317. null,
  23318. /* cssModules */
  23319. null
  23320. )
  23321. Component.options.__file = "G:\\Server Stats\\webSource\\serveredit.vue"
  23322. 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.")}
  23323. if (Component.options.functional) {console.error("[vue-loader] serveredit.vue: functional components are not supported with templates, they should use render functions.")}
  23324. /* hot reload */
  23325. if (false) {(function () {
  23326. var hotAPI = require("vue-hot-reload-api")
  23327. hotAPI.install(require("vue"), false)
  23328. if (!hotAPI.compatible) return
  23329. module.hot.accept()
  23330. if (!module.hot.data) {
  23331. hotAPI.createRecord("data-v-7fae8b1c", Component.options)
  23332. } else {
  23333. hotAPI.reload("data-v-7fae8b1c", Component.options)
  23334. }
  23335. })()}
  23336. module.exports = Component.exports
  23337. /***/ }),
  23338. /* 122 */
  23339. /***/ (function(module, exports, __webpack_require__) {
  23340. var Component = __webpack_require__(1)(
  23341. /* script */
  23342. __webpack_require__(180),
  23343. /* template */
  23344. __webpack_require__(186),
  23345. /* scopeId */
  23346. null,
  23347. /* cssModules */
  23348. null
  23349. )
  23350. Component.options.__file = "G:\\Server Stats\\webSource\\servergraph.vue"
  23351. 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.")}
  23352. if (Component.options.functional) {console.error("[vue-loader] servergraph.vue: functional components are not supported with templates, they should use render functions.")}
  23353. /* hot reload */
  23354. if (false) {(function () {
  23355. var hotAPI = require("vue-hot-reload-api")
  23356. hotAPI.install(require("vue"), false)
  23357. if (!hotAPI.compatible) return
  23358. module.hot.accept()
  23359. if (!module.hot.data) {
  23360. hotAPI.createRecord("data-v-bbf0e6a8", Component.options)
  23361. } else {
  23362. hotAPI.reload("data-v-bbf0e6a8", Component.options)
  23363. }
  23364. })()}
  23365. module.exports = Component.exports
  23366. /***/ }),
  23367. /* 123 */
  23368. /***/ (function(module, exports, __webpack_require__) {
  23369. "use strict";
  23370. /* WEBPACK VAR INJECTION */(function(process) {/**
  23371. * vue-router v2.2.1
  23372. * (c) 2017 Evan You
  23373. * @license MIT
  23374. */
  23375. /* */
  23376. function assert (condition, message) {
  23377. if (!condition) {
  23378. throw new Error(("[vue-router] " + message))
  23379. }
  23380. }
  23381. function warn (condition, message) {
  23382. if (!condition) {
  23383. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  23384. }
  23385. }
  23386. var View = {
  23387. name: 'router-view',
  23388. functional: true,
  23389. props: {
  23390. name: {
  23391. type: String,
  23392. default: 'default'
  23393. }
  23394. },
  23395. render: function render (h, ref) {
  23396. var props = ref.props;
  23397. var children = ref.children;
  23398. var parent = ref.parent;
  23399. var data = ref.data;
  23400. data.routerView = true;
  23401. var name = props.name;
  23402. var route = parent.$route;
  23403. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  23404. // determine current view depth, also check to see if the tree
  23405. // has been toggled inactive but kept-alive.
  23406. var depth = 0;
  23407. var inactive = false;
  23408. while (parent) {
  23409. if (parent.$vnode && parent.$vnode.data.routerView) {
  23410. depth++;
  23411. }
  23412. if (parent._inactive) {
  23413. inactive = true;
  23414. }
  23415. parent = parent.$parent;
  23416. }
  23417. data.routerViewDepth = depth;
  23418. // render previous view if the tree is inactive and kept-alive
  23419. if (inactive) {
  23420. return h(cache[name], data, children)
  23421. }
  23422. var matched = route.matched[depth];
  23423. // render empty node if no matched route
  23424. if (!matched) {
  23425. cache[name] = null;
  23426. return h()
  23427. }
  23428. var component = cache[name] = matched.components[name];
  23429. // inject instance registration hooks
  23430. var hooks = data.hook || (data.hook = {});
  23431. hooks.init = function (vnode) {
  23432. matched.instances[name] = vnode.child;
  23433. };
  23434. hooks.prepatch = function (oldVnode, vnode) {
  23435. matched.instances[name] = vnode.child;
  23436. };
  23437. hooks.destroy = function (vnode) {
  23438. if (matched.instances[name] === vnode.child) {
  23439. matched.instances[name] = undefined;
  23440. }
  23441. };
  23442. // resolve props
  23443. data.props = resolveProps(route, matched.props && matched.props[name]);
  23444. return h(component, data, children)
  23445. }
  23446. };
  23447. function resolveProps (route, config) {
  23448. switch (typeof config) {
  23449. case 'undefined':
  23450. return
  23451. case 'object':
  23452. return config
  23453. case 'function':
  23454. return config(route)
  23455. case 'boolean':
  23456. return config ? route.params : undefined
  23457. default:
  23458. warn(false, ("props in \"" + (route.path) + "\" is a " + (typeof config) + ", expecting an object, function or boolean."));
  23459. }
  23460. }
  23461. /* */
  23462. var encodeReserveRE = /[!'()*]/g;
  23463. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  23464. var commaRE = /%2C/g;
  23465. // fixed encodeURIComponent which is more comformant to RFC3986:
  23466. // - escapes [!'()*]
  23467. // - preserve commas
  23468. var encode = function (str) { return encodeURIComponent(str)
  23469. .replace(encodeReserveRE, encodeReserveReplacer)
  23470. .replace(commaRE, ','); };
  23471. var decode = decodeURIComponent;
  23472. function resolveQuery (
  23473. query,
  23474. extraQuery
  23475. ) {
  23476. if ( extraQuery === void 0 ) extraQuery = {};
  23477. if (query) {
  23478. var parsedQuery;
  23479. try {
  23480. parsedQuery = parseQuery(query);
  23481. } catch (e) {
  23482. process.env.NODE_ENV !== 'production' && warn(false, e.message);
  23483. parsedQuery = {};
  23484. }
  23485. for (var key in extraQuery) {
  23486. parsedQuery[key] = extraQuery[key];
  23487. }
  23488. return parsedQuery
  23489. } else {
  23490. return extraQuery
  23491. }
  23492. }
  23493. function parseQuery (query) {
  23494. var res = {};
  23495. query = query.trim().replace(/^(\?|#|&)/, '');
  23496. if (!query) {
  23497. return res
  23498. }
  23499. query.split('&').forEach(function (param) {
  23500. var parts = param.replace(/\+/g, ' ').split('=');
  23501. var key = decode(parts.shift());
  23502. var val = parts.length > 0
  23503. ? decode(parts.join('='))
  23504. : null;
  23505. if (res[key] === undefined) {
  23506. res[key] = val;
  23507. } else if (Array.isArray(res[key])) {
  23508. res[key].push(val);
  23509. } else {
  23510. res[key] = [res[key], val];
  23511. }
  23512. });
  23513. return res
  23514. }
  23515. function stringifyQuery (obj) {
  23516. var res = obj ? Object.keys(obj).map(function (key) {
  23517. var val = obj[key];
  23518. if (val === undefined) {
  23519. return ''
  23520. }
  23521. if (val === null) {
  23522. return encode(key)
  23523. }
  23524. if (Array.isArray(val)) {
  23525. var result = [];
  23526. val.slice().forEach(function (val2) {
  23527. if (val2 === undefined) {
  23528. return
  23529. }
  23530. if (val2 === null) {
  23531. result.push(encode(key));
  23532. } else {
  23533. result.push(encode(key) + '=' + encode(val2));
  23534. }
  23535. });
  23536. return result.join('&')
  23537. }
  23538. return encode(key) + '=' + encode(val)
  23539. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  23540. return res ? ("?" + res) : ''
  23541. }
  23542. /* */
  23543. var trailingSlashRE = /\/?$/;
  23544. function createRoute (
  23545. record,
  23546. location,
  23547. redirectedFrom
  23548. ) {
  23549. var route = {
  23550. name: location.name || (record && record.name),
  23551. meta: (record && record.meta) || {},
  23552. path: location.path || '/',
  23553. hash: location.hash || '',
  23554. query: location.query || {},
  23555. params: location.params || {},
  23556. fullPath: getFullPath(location),
  23557. matched: record ? formatMatch(record) : []
  23558. };
  23559. if (redirectedFrom) {
  23560. route.redirectedFrom = getFullPath(redirectedFrom);
  23561. }
  23562. return Object.freeze(route)
  23563. }
  23564. // the starting route that represents the initial state
  23565. var START = createRoute(null, {
  23566. path: '/'
  23567. });
  23568. function formatMatch (record) {
  23569. var res = [];
  23570. while (record) {
  23571. res.unshift(record);
  23572. record = record.parent;
  23573. }
  23574. return res
  23575. }
  23576. function getFullPath (ref) {
  23577. var path = ref.path;
  23578. var query = ref.query; if ( query === void 0 ) query = {};
  23579. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  23580. return (path || '/') + stringifyQuery(query) + hash
  23581. }
  23582. function isSameRoute (a, b) {
  23583. if (b === START) {
  23584. return a === b
  23585. } else if (!b) {
  23586. return false
  23587. } else if (a.path && b.path) {
  23588. return (
  23589. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  23590. a.hash === b.hash &&
  23591. isObjectEqual(a.query, b.query)
  23592. )
  23593. } else if (a.name && b.name) {
  23594. return (
  23595. a.name === b.name &&
  23596. a.hash === b.hash &&
  23597. isObjectEqual(a.query, b.query) &&
  23598. isObjectEqual(a.params, b.params)
  23599. )
  23600. } else {
  23601. return false
  23602. }
  23603. }
  23604. function isObjectEqual (a, b) {
  23605. if ( a === void 0 ) a = {};
  23606. if ( b === void 0 ) b = {};
  23607. var aKeys = Object.keys(a);
  23608. var bKeys = Object.keys(b);
  23609. if (aKeys.length !== bKeys.length) {
  23610. return false
  23611. }
  23612. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  23613. }
  23614. function isIncludedRoute (current, target) {
  23615. return (
  23616. current.path.replace(trailingSlashRE, '/').indexOf(
  23617. target.path.replace(trailingSlashRE, '/')
  23618. ) === 0 &&
  23619. (!target.hash || current.hash === target.hash) &&
  23620. queryIncludes(current.query, target.query)
  23621. )
  23622. }
  23623. function queryIncludes (current, target) {
  23624. for (var key in target) {
  23625. if (!(key in current)) {
  23626. return false
  23627. }
  23628. }
  23629. return true
  23630. }
  23631. /* */
  23632. // work around weird flow bug
  23633. var toTypes = [String, Object];
  23634. var eventTypes = [String, Array];
  23635. var Link = {
  23636. name: 'router-link',
  23637. props: {
  23638. to: {
  23639. type: toTypes,
  23640. required: true
  23641. },
  23642. tag: {
  23643. type: String,
  23644. default: 'a'
  23645. },
  23646. exact: Boolean,
  23647. append: Boolean,
  23648. replace: Boolean,
  23649. activeClass: String,
  23650. event: {
  23651. type: eventTypes,
  23652. default: 'click'
  23653. }
  23654. },
  23655. render: function render (h) {
  23656. var this$1 = this;
  23657. var router = this.$router;
  23658. var current = this.$route;
  23659. var ref = router.resolve(this.to, current, this.append);
  23660. var location = ref.location;
  23661. var route = ref.route;
  23662. var href = ref.href;
  23663. var classes = {};
  23664. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active';
  23665. var compareTarget = location.path ? createRoute(null, location) : route;
  23666. classes[activeClass] = this.exact
  23667. ? isSameRoute(current, compareTarget)
  23668. : isIncludedRoute(current, compareTarget);
  23669. var handler = function (e) {
  23670. if (guardEvent(e)) {
  23671. if (this$1.replace) {
  23672. router.replace(location);
  23673. } else {
  23674. router.push(location);
  23675. }
  23676. }
  23677. };
  23678. var on = { click: guardEvent };
  23679. if (Array.isArray(this.event)) {
  23680. this.event.forEach(function (e) { on[e] = handler; });
  23681. } else {
  23682. on[this.event] = handler;
  23683. }
  23684. var data = {
  23685. class: classes
  23686. };
  23687. if (this.tag === 'a') {
  23688. data.on = on;
  23689. data.attrs = { href: href };
  23690. } else {
  23691. // find the first <a> child and apply listener and href
  23692. var a = findAnchor(this.$slots.default);
  23693. if (a) {
  23694. // in case the <a> is a static node
  23695. a.isStatic = false;
  23696. var extend = _Vue.util.extend;
  23697. var aData = a.data = extend({}, a.data);
  23698. aData.on = on;
  23699. var aAttrs = a.data.attrs = extend({}, a.data.attrs);
  23700. aAttrs.href = href;
  23701. } else {
  23702. // doesn't have <a> child, apply listener to self
  23703. data.on = on;
  23704. }
  23705. }
  23706. return h(this.tag, data, this.$slots.default)
  23707. }
  23708. };
  23709. function guardEvent (e) {
  23710. // don't redirect with control keys
  23711. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  23712. // don't redirect when preventDefault called
  23713. if (e.defaultPrevented) { return }
  23714. // don't redirect on right click
  23715. if (e.button !== undefined && e.button !== 0) { return }
  23716. // don't redirect if `target="_blank"`
  23717. if (e.target && e.target.getAttribute) {
  23718. var target = e.target.getAttribute('target');
  23719. if (/\b_blank\b/i.test(target)) { return }
  23720. }
  23721. // this may be a Weex event which doesn't have this method
  23722. if (e.preventDefault) {
  23723. e.preventDefault();
  23724. }
  23725. return true
  23726. }
  23727. function findAnchor (children) {
  23728. if (children) {
  23729. var child;
  23730. for (var i = 0; i < children.length; i++) {
  23731. child = children[i];
  23732. if (child.tag === 'a') {
  23733. return child
  23734. }
  23735. if (child.children && (child = findAnchor(child.children))) {
  23736. return child
  23737. }
  23738. }
  23739. }
  23740. }
  23741. var _Vue;
  23742. function install (Vue) {
  23743. if (install.installed) { return }
  23744. install.installed = true;
  23745. _Vue = Vue;
  23746. Object.defineProperty(Vue.prototype, '$router', {
  23747. get: function get () { return this.$root._router }
  23748. });
  23749. Object.defineProperty(Vue.prototype, '$route', {
  23750. get: function get () { return this.$root._route }
  23751. });
  23752. Vue.mixin({
  23753. beforeCreate: function beforeCreate () {
  23754. if (this.$options.router) {
  23755. this._router = this.$options.router;
  23756. this._router.init(this);
  23757. Vue.util.defineReactive(this, '_route', this._router.history.current);
  23758. }
  23759. }
  23760. });
  23761. Vue.component('router-view', View);
  23762. Vue.component('router-link', Link);
  23763. var strats = Vue.config.optionMergeStrategies;
  23764. // use the same hook merging strategy for route hooks
  23765. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created;
  23766. }
  23767. /* */
  23768. var inBrowser = typeof window !== 'undefined';
  23769. /* */
  23770. function resolvePath (
  23771. relative,
  23772. base,
  23773. append
  23774. ) {
  23775. if (relative.charAt(0) === '/') {
  23776. return relative
  23777. }
  23778. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  23779. return base + relative
  23780. }
  23781. var stack = base.split('/');
  23782. // remove trailing segment if:
  23783. // - not appending
  23784. // - appending to trailing slash (last segment is empty)
  23785. if (!append || !stack[stack.length - 1]) {
  23786. stack.pop();
  23787. }
  23788. // resolve relative path
  23789. var segments = relative.replace(/^\//, '').split('/');
  23790. for (var i = 0; i < segments.length; i++) {
  23791. var segment = segments[i];
  23792. if (segment === '.') {
  23793. continue
  23794. } else if (segment === '..') {
  23795. stack.pop();
  23796. } else {
  23797. stack.push(segment);
  23798. }
  23799. }
  23800. // ensure leading slash
  23801. if (stack[0] !== '') {
  23802. stack.unshift('');
  23803. }
  23804. return stack.join('/')
  23805. }
  23806. function parsePath (path) {
  23807. var hash = '';
  23808. var query = '';
  23809. var hashIndex = path.indexOf('#');
  23810. if (hashIndex >= 0) {
  23811. hash = path.slice(hashIndex);
  23812. path = path.slice(0, hashIndex);
  23813. }
  23814. var queryIndex = path.indexOf('?');
  23815. if (queryIndex >= 0) {
  23816. query = path.slice(queryIndex + 1);
  23817. path = path.slice(0, queryIndex);
  23818. }
  23819. return {
  23820. path: path,
  23821. query: query,
  23822. hash: hash
  23823. }
  23824. }
  23825. function cleanPath (path) {
  23826. return path.replace(/\/\//g, '/')
  23827. }
  23828. /* */
  23829. function createRouteMap (
  23830. routes,
  23831. oldPathMap,
  23832. oldNameMap
  23833. ) {
  23834. var pathMap = oldPathMap || Object.create(null);
  23835. var nameMap = oldNameMap || Object.create(null);
  23836. routes.forEach(function (route) {
  23837. addRouteRecord(pathMap, nameMap, route);
  23838. });
  23839. return {
  23840. pathMap: pathMap,
  23841. nameMap: nameMap
  23842. }
  23843. }
  23844. function addRouteRecord (
  23845. pathMap,
  23846. nameMap,
  23847. route,
  23848. parent,
  23849. matchAs
  23850. ) {
  23851. var path = route.path;
  23852. var name = route.name;
  23853. if (process.env.NODE_ENV !== 'production') {
  23854. assert(path != null, "\"path\" is required in a route configuration.");
  23855. assert(
  23856. typeof route.component !== 'string',
  23857. "route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
  23858. "string id. Use an actual component instead."
  23859. );
  23860. }
  23861. var record = {
  23862. path: normalizePath(path, parent),
  23863. components: route.components || { default: route.component },
  23864. instances: {},
  23865. name: name,
  23866. parent: parent,
  23867. matchAs: matchAs,
  23868. redirect: route.redirect,
  23869. beforeEnter: route.beforeEnter,
  23870. meta: route.meta || {},
  23871. props: route.props == null
  23872. ? {}
  23873. : route.components
  23874. ? route.props
  23875. : { default: route.props }
  23876. };
  23877. if (route.children) {
  23878. // Warn if route is named and has a default child route.
  23879. // If users navigate to this route by name, the default child will
  23880. // not be rendered (GH Issue #629)
  23881. if (process.env.NODE_ENV !== 'production') {
  23882. if (route.name && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
  23883. warn(
  23884. false,
  23885. "Named Route '" + (route.name) + "' has a default child route. " +
  23886. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  23887. "the default child route will not be rendered. Remove the name from " +
  23888. "this route and use the name of the default child route for named " +
  23889. "links instead."
  23890. );
  23891. }
  23892. }
  23893. route.children.forEach(function (child) {
  23894. var childMatchAs = matchAs
  23895. ? cleanPath((matchAs + "/" + (child.path)))
  23896. : undefined;
  23897. addRouteRecord(pathMap, nameMap, child, record, childMatchAs);
  23898. });
  23899. }
  23900. if (route.alias !== undefined) {
  23901. if (Array.isArray(route.alias)) {
  23902. route.alias.forEach(function (alias) {
  23903. var aliasRoute = {
  23904. path: alias,
  23905. children: route.children
  23906. };
  23907. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23908. });
  23909. } else {
  23910. var aliasRoute = {
  23911. path: route.alias,
  23912. children: route.children
  23913. };
  23914. addRouteRecord(pathMap, nameMap, aliasRoute, parent, record.path);
  23915. }
  23916. }
  23917. if (!pathMap[record.path]) {
  23918. pathMap[record.path] = record;
  23919. }
  23920. if (name) {
  23921. if (!nameMap[name]) {
  23922. nameMap[name] = record;
  23923. } else if (process.env.NODE_ENV !== 'production' && !matchAs) {
  23924. warn(
  23925. false,
  23926. "Duplicate named routes definition: " +
  23927. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  23928. );
  23929. }
  23930. }
  23931. }
  23932. function normalizePath (path, parent) {
  23933. path = path.replace(/\/$/, '');
  23934. if (path[0] === '/') { return path }
  23935. if (parent == null) { return path }
  23936. return cleanPath(((parent.path) + "/" + path))
  23937. }
  23938. var index$1 = Array.isArray || function (arr) {
  23939. return Object.prototype.toString.call(arr) == '[object Array]';
  23940. };
  23941. var isarray = index$1;
  23942. /**
  23943. * Expose `pathToRegexp`.
  23944. */
  23945. var index = pathToRegexp;
  23946. var parse_1 = parse;
  23947. var compile_1 = compile;
  23948. var tokensToFunction_1 = tokensToFunction;
  23949. var tokensToRegExp_1 = tokensToRegExp;
  23950. /**
  23951. * The main path matching regexp utility.
  23952. *
  23953. * @type {RegExp}
  23954. */
  23955. var PATH_REGEXP = new RegExp([
  23956. // Match escaped characters that would otherwise appear in future matches.
  23957. // This allows the user to escape special characters that won't transform.
  23958. '(\\\\.)',
  23959. // Match Express-style parameters and un-named parameters with a prefix
  23960. // and optional suffixes. Matches appear as:
  23961. //
  23962. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  23963. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  23964. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  23965. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  23966. ].join('|'), 'g');
  23967. /**
  23968. * Parse a string for the raw tokens.
  23969. *
  23970. * @param {string} str
  23971. * @param {Object=} options
  23972. * @return {!Array}
  23973. */
  23974. function parse (str, options) {
  23975. var tokens = [];
  23976. var key = 0;
  23977. var index = 0;
  23978. var path = '';
  23979. var defaultDelimiter = options && options.delimiter || '/';
  23980. var res;
  23981. while ((res = PATH_REGEXP.exec(str)) != null) {
  23982. var m = res[0];
  23983. var escaped = res[1];
  23984. var offset = res.index;
  23985. path += str.slice(index, offset);
  23986. index = offset + m.length;
  23987. // Ignore already escaped sequences.
  23988. if (escaped) {
  23989. path += escaped[1];
  23990. continue
  23991. }
  23992. var next = str[index];
  23993. var prefix = res[2];
  23994. var name = res[3];
  23995. var capture = res[4];
  23996. var group = res[5];
  23997. var modifier = res[6];
  23998. var asterisk = res[7];
  23999. // Push the current path onto the tokens.
  24000. if (path) {
  24001. tokens.push(path);
  24002. path = '';
  24003. }
  24004. var partial = prefix != null && next != null && next !== prefix;
  24005. var repeat = modifier === '+' || modifier === '*';
  24006. var optional = modifier === '?' || modifier === '*';
  24007. var delimiter = res[2] || defaultDelimiter;
  24008. var pattern = capture || group;
  24009. tokens.push({
  24010. name: name || key++,
  24011. prefix: prefix || '',
  24012. delimiter: delimiter,
  24013. optional: optional,
  24014. repeat: repeat,
  24015. partial: partial,
  24016. asterisk: !!asterisk,
  24017. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  24018. });
  24019. }
  24020. // Match any characters still remaining.
  24021. if (index < str.length) {
  24022. path += str.substr(index);
  24023. }
  24024. // If the path exists, push it onto the end.
  24025. if (path) {
  24026. tokens.push(path);
  24027. }
  24028. return tokens
  24029. }
  24030. /**
  24031. * Compile a string to a template function for the path.
  24032. *
  24033. * @param {string} str
  24034. * @param {Object=} options
  24035. * @return {!function(Object=, Object=)}
  24036. */
  24037. function compile (str, options) {
  24038. return tokensToFunction(parse(str, options))
  24039. }
  24040. /**
  24041. * Prettier encoding of URI path segments.
  24042. *
  24043. * @param {string}
  24044. * @return {string}
  24045. */
  24046. function encodeURIComponentPretty (str) {
  24047. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  24048. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  24049. })
  24050. }
  24051. /**
  24052. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  24053. *
  24054. * @param {string}
  24055. * @return {string}
  24056. */
  24057. function encodeAsterisk (str) {
  24058. return encodeURI(str).replace(/[?#]/g, function (c) {
  24059. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  24060. })
  24061. }
  24062. /**
  24063. * Expose a method for transforming tokens into the path function.
  24064. */
  24065. function tokensToFunction (tokens) {
  24066. // Compile all the tokens into regexps.
  24067. var matches = new Array(tokens.length);
  24068. // Compile all the patterns before compilation.
  24069. for (var i = 0; i < tokens.length; i++) {
  24070. if (typeof tokens[i] === 'object') {
  24071. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  24072. }
  24073. }
  24074. return function (obj, opts) {
  24075. var path = '';
  24076. var data = obj || {};
  24077. var options = opts || {};
  24078. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  24079. for (var i = 0; i < tokens.length; i++) {
  24080. var token = tokens[i];
  24081. if (typeof token === 'string') {
  24082. path += token;
  24083. continue
  24084. }
  24085. var value = data[token.name];
  24086. var segment;
  24087. if (value == null) {
  24088. if (token.optional) {
  24089. // Prepend partial segment prefixes.
  24090. if (token.partial) {
  24091. path += token.prefix;
  24092. }
  24093. continue
  24094. } else {
  24095. throw new TypeError('Expected "' + token.name + '" to be defined')
  24096. }
  24097. }
  24098. if (isarray(value)) {
  24099. if (!token.repeat) {
  24100. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  24101. }
  24102. if (value.length === 0) {
  24103. if (token.optional) {
  24104. continue
  24105. } else {
  24106. throw new TypeError('Expected "' + token.name + '" to not be empty')
  24107. }
  24108. }
  24109. for (var j = 0; j < value.length; j++) {
  24110. segment = encode(value[j]);
  24111. if (!matches[i].test(segment)) {
  24112. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  24113. }
  24114. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  24115. }
  24116. continue
  24117. }
  24118. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  24119. if (!matches[i].test(segment)) {
  24120. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  24121. }
  24122. path += token.prefix + segment;
  24123. }
  24124. return path
  24125. }
  24126. }
  24127. /**
  24128. * Escape a regular expression string.
  24129. *
  24130. * @param {string} str
  24131. * @return {string}
  24132. */
  24133. function escapeString (str) {
  24134. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  24135. }
  24136. /**
  24137. * Escape the capturing group by escaping special characters and meaning.
  24138. *
  24139. * @param {string} group
  24140. * @return {string}
  24141. */
  24142. function escapeGroup (group) {
  24143. return group.replace(/([=!:$\/()])/g, '\\$1')
  24144. }
  24145. /**
  24146. * Attach the keys as a property of the regexp.
  24147. *
  24148. * @param {!RegExp} re
  24149. * @param {Array} keys
  24150. * @return {!RegExp}
  24151. */
  24152. function attachKeys (re, keys) {
  24153. re.keys = keys;
  24154. return re
  24155. }
  24156. /**
  24157. * Get the flags for a regexp from the options.
  24158. *
  24159. * @param {Object} options
  24160. * @return {string}
  24161. */
  24162. function flags (options) {
  24163. return options.sensitive ? '' : 'i'
  24164. }
  24165. /**
  24166. * Pull out keys from a regexp.
  24167. *
  24168. * @param {!RegExp} path
  24169. * @param {!Array} keys
  24170. * @return {!RegExp}
  24171. */
  24172. function regexpToRegexp (path, keys) {
  24173. // Use a negative lookahead to match only capturing groups.
  24174. var groups = path.source.match(/\((?!\?)/g);
  24175. if (groups) {
  24176. for (var i = 0; i < groups.length; i++) {
  24177. keys.push({
  24178. name: i,
  24179. prefix: null,
  24180. delimiter: null,
  24181. optional: false,
  24182. repeat: false,
  24183. partial: false,
  24184. asterisk: false,
  24185. pattern: null
  24186. });
  24187. }
  24188. }
  24189. return attachKeys(path, keys)
  24190. }
  24191. /**
  24192. * Transform an array into a regexp.
  24193. *
  24194. * @param {!Array} path
  24195. * @param {Array} keys
  24196. * @param {!Object} options
  24197. * @return {!RegExp}
  24198. */
  24199. function arrayToRegexp (path, keys, options) {
  24200. var parts = [];
  24201. for (var i = 0; i < path.length; i++) {
  24202. parts.push(pathToRegexp(path[i], keys, options).source);
  24203. }
  24204. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  24205. return attachKeys(regexp, keys)
  24206. }
  24207. /**
  24208. * Create a path regexp from string input.
  24209. *
  24210. * @param {string} path
  24211. * @param {!Array} keys
  24212. * @param {!Object} options
  24213. * @return {!RegExp}
  24214. */
  24215. function stringToRegexp (path, keys, options) {
  24216. return tokensToRegExp(parse(path, options), keys, options)
  24217. }
  24218. /**
  24219. * Expose a function for taking tokens and returning a RegExp.
  24220. *
  24221. * @param {!Array} tokens
  24222. * @param {(Array|Object)=} keys
  24223. * @param {Object=} options
  24224. * @return {!RegExp}
  24225. */
  24226. function tokensToRegExp (tokens, keys, options) {
  24227. if (!isarray(keys)) {
  24228. options = /** @type {!Object} */ (keys || options);
  24229. keys = [];
  24230. }
  24231. options = options || {};
  24232. var strict = options.strict;
  24233. var end = options.end !== false;
  24234. var route = '';
  24235. // Iterate over the tokens and create our regexp string.
  24236. for (var i = 0; i < tokens.length; i++) {
  24237. var token = tokens[i];
  24238. if (typeof token === 'string') {
  24239. route += escapeString(token);
  24240. } else {
  24241. var prefix = escapeString(token.prefix);
  24242. var capture = '(?:' + token.pattern + ')';
  24243. keys.push(token);
  24244. if (token.repeat) {
  24245. capture += '(?:' + prefix + capture + ')*';
  24246. }
  24247. if (token.optional) {
  24248. if (!token.partial) {
  24249. capture = '(?:' + prefix + '(' + capture + '))?';
  24250. } else {
  24251. capture = prefix + '(' + capture + ')?';
  24252. }
  24253. } else {
  24254. capture = prefix + '(' + capture + ')';
  24255. }
  24256. route += capture;
  24257. }
  24258. }
  24259. var delimiter = escapeString(options.delimiter || '/');
  24260. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  24261. // In non-strict mode we allow a slash at the end of match. If the path to
  24262. // match already ends with a slash, we remove it for consistency. The slash
  24263. // is valid at the end of a path match, not in the middle. This is important
  24264. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  24265. if (!strict) {
  24266. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  24267. }
  24268. if (end) {
  24269. route += '$';
  24270. } else {
  24271. // In non-ending mode, we need the capturing groups to match as much as
  24272. // possible by using a positive lookahead to the end or next path segment.
  24273. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  24274. }
  24275. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  24276. }
  24277. /**
  24278. * Normalize the given path string, returning a regular expression.
  24279. *
  24280. * An empty array can be passed in for the keys, which will hold the
  24281. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  24282. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  24283. *
  24284. * @param {(string|RegExp|Array)} path
  24285. * @param {(Array|Object)=} keys
  24286. * @param {Object=} options
  24287. * @return {!RegExp}
  24288. */
  24289. function pathToRegexp (path, keys, options) {
  24290. if (!isarray(keys)) {
  24291. options = /** @type {!Object} */ (keys || options);
  24292. keys = [];
  24293. }
  24294. options = options || {};
  24295. if (path instanceof RegExp) {
  24296. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  24297. }
  24298. if (isarray(path)) {
  24299. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  24300. }
  24301. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  24302. }
  24303. index.parse = parse_1;
  24304. index.compile = compile_1;
  24305. index.tokensToFunction = tokensToFunction_1;
  24306. index.tokensToRegExp = tokensToRegExp_1;
  24307. /* */
  24308. var regexpCache = Object.create(null);
  24309. function getRouteRegex (path) {
  24310. var hit = regexpCache[path];
  24311. var keys, regexp;
  24312. if (hit) {
  24313. keys = hit.keys;
  24314. regexp = hit.regexp;
  24315. } else {
  24316. keys = [];
  24317. regexp = index(path, keys);
  24318. regexpCache[path] = { keys: keys, regexp: regexp };
  24319. }
  24320. return { keys: keys, regexp: regexp }
  24321. }
  24322. var regexpCompileCache = Object.create(null);
  24323. function fillParams (
  24324. path,
  24325. params,
  24326. routeMsg
  24327. ) {
  24328. try {
  24329. var filler =
  24330. regexpCompileCache[path] ||
  24331. (regexpCompileCache[path] = index.compile(path));
  24332. return filler(params || {}, { pretty: true })
  24333. } catch (e) {
  24334. if (process.env.NODE_ENV !== 'production') {
  24335. warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
  24336. }
  24337. return ''
  24338. }
  24339. }
  24340. /* */
  24341. function normalizeLocation (
  24342. raw,
  24343. current,
  24344. append
  24345. ) {
  24346. var next = typeof raw === 'string' ? { path: raw } : raw;
  24347. // named target
  24348. if (next.name || next._normalized) {
  24349. return next
  24350. }
  24351. // relative params
  24352. if (!next.path && next.params && current) {
  24353. next = assign({}, next);
  24354. next._normalized = true;
  24355. var params = assign(assign({}, current.params), next.params);
  24356. if (current.name) {
  24357. next.name = current.name;
  24358. next.params = params;
  24359. } else if (current.matched) {
  24360. var rawPath = current.matched[current.matched.length - 1].path;
  24361. next.path = fillParams(rawPath, params, ("path " + (current.path)));
  24362. } else if (process.env.NODE_ENV !== 'production') {
  24363. warn(false, "relative params navigation requires a current route.");
  24364. }
  24365. return next
  24366. }
  24367. var parsedPath = parsePath(next.path || '');
  24368. var basePath = (current && current.path) || '/';
  24369. var path = parsedPath.path
  24370. ? resolvePath(parsedPath.path, basePath, append || next.append)
  24371. : (current && current.path) || '/';
  24372. var query = resolveQuery(parsedPath.query, next.query);
  24373. var hash = next.hash || parsedPath.hash;
  24374. if (hash && hash.charAt(0) !== '#') {
  24375. hash = "#" + hash;
  24376. }
  24377. return {
  24378. _normalized: true,
  24379. path: path,
  24380. query: query,
  24381. hash: hash
  24382. }
  24383. }
  24384. function assign (a, b) {
  24385. for (var key in b) {
  24386. a[key] = b[key];
  24387. }
  24388. return a
  24389. }
  24390. /* */
  24391. function createMatcher (routes) {
  24392. var ref = createRouteMap(routes);
  24393. var pathMap = ref.pathMap;
  24394. var nameMap = ref.nameMap;
  24395. function addRoutes (routes) {
  24396. createRouteMap(routes, pathMap, nameMap);
  24397. }
  24398. function match (
  24399. raw,
  24400. currentRoute,
  24401. redirectedFrom
  24402. ) {
  24403. var location = normalizeLocation(raw, currentRoute);
  24404. var name = location.name;
  24405. if (name) {
  24406. var record = nameMap[name];
  24407. if (process.env.NODE_ENV !== 'production') {
  24408. warn(record, ("Route with name '" + name + "' does not exist"));
  24409. }
  24410. var paramNames = getRouteRegex(record.path).keys
  24411. .filter(function (key) { return !key.optional; })
  24412. .map(function (key) { return key.name; });
  24413. if (typeof location.params !== 'object') {
  24414. location.params = {};
  24415. }
  24416. if (currentRoute && typeof currentRoute.params === 'object') {
  24417. for (var key in currentRoute.params) {
  24418. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  24419. location.params[key] = currentRoute.params[key];
  24420. }
  24421. }
  24422. }
  24423. if (record) {
  24424. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  24425. return _createRoute(record, location, redirectedFrom)
  24426. }
  24427. } else if (location.path) {
  24428. location.params = {};
  24429. for (var path in pathMap) {
  24430. if (matchRoute(path, location.params, location.path)) {
  24431. return _createRoute(pathMap[path], location, redirectedFrom)
  24432. }
  24433. }
  24434. }
  24435. // no match
  24436. return _createRoute(null, location)
  24437. }
  24438. function redirect (
  24439. record,
  24440. location
  24441. ) {
  24442. var originalRedirect = record.redirect;
  24443. var redirect = typeof originalRedirect === 'function'
  24444. ? originalRedirect(createRoute(record, location))
  24445. : originalRedirect;
  24446. if (typeof redirect === 'string') {
  24447. redirect = { path: redirect };
  24448. }
  24449. if (!redirect || typeof redirect !== 'object') {
  24450. process.env.NODE_ENV !== 'production' && warn(
  24451. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  24452. );
  24453. return _createRoute(null, location)
  24454. }
  24455. var re = redirect;
  24456. var name = re.name;
  24457. var path = re.path;
  24458. var query = location.query;
  24459. var hash = location.hash;
  24460. var params = location.params;
  24461. query = re.hasOwnProperty('query') ? re.query : query;
  24462. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  24463. params = re.hasOwnProperty('params') ? re.params : params;
  24464. if (name) {
  24465. // resolved named direct
  24466. var targetRecord = nameMap[name];
  24467. if (process.env.NODE_ENV !== 'production') {
  24468. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  24469. }
  24470. return match({
  24471. _normalized: true,
  24472. name: name,
  24473. query: query,
  24474. hash: hash,
  24475. params: params
  24476. }, undefined, location)
  24477. } else if (path) {
  24478. // 1. resolve relative redirect
  24479. var rawPath = resolveRecordPath(path, record);
  24480. // 2. resolve params
  24481. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  24482. // 3. rematch with existing query and hash
  24483. return match({
  24484. _normalized: true,
  24485. path: resolvedPath,
  24486. query: query,
  24487. hash: hash
  24488. }, undefined, location)
  24489. } else {
  24490. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  24491. return _createRoute(null, location)
  24492. }
  24493. }
  24494. function alias (
  24495. record,
  24496. location,
  24497. matchAs
  24498. ) {
  24499. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  24500. var aliasedMatch = match({
  24501. _normalized: true,
  24502. path: aliasedPath
  24503. });
  24504. if (aliasedMatch) {
  24505. var matched = aliasedMatch.matched;
  24506. var aliasedRecord = matched[matched.length - 1];
  24507. location.params = aliasedMatch.params;
  24508. return _createRoute(aliasedRecord, location)
  24509. }
  24510. return _createRoute(null, location)
  24511. }
  24512. function _createRoute (
  24513. record,
  24514. location,
  24515. redirectedFrom
  24516. ) {
  24517. if (record && record.redirect) {
  24518. return redirect(record, redirectedFrom || location)
  24519. }
  24520. if (record && record.matchAs) {
  24521. return alias(record, location, record.matchAs)
  24522. }
  24523. return createRoute(record, location, redirectedFrom)
  24524. }
  24525. return {
  24526. match: match,
  24527. addRoutes: addRoutes
  24528. }
  24529. }
  24530. function matchRoute (
  24531. path,
  24532. params,
  24533. pathname
  24534. ) {
  24535. var ref = getRouteRegex(path);
  24536. var regexp = ref.regexp;
  24537. var keys = ref.keys;
  24538. var m = pathname.match(regexp);
  24539. if (!m) {
  24540. return false
  24541. } else if (!params) {
  24542. return true
  24543. }
  24544. for (var i = 1, len = m.length; i < len; ++i) {
  24545. var key = keys[i - 1];
  24546. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  24547. if (key) { params[key.name] = val; }
  24548. }
  24549. return true
  24550. }
  24551. function resolveRecordPath (path, record) {
  24552. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  24553. }
  24554. /* */
  24555. var positionStore = Object.create(null);
  24556. function setupScroll () {
  24557. window.addEventListener('popstate', function (e) {
  24558. saveScrollPosition();
  24559. if (e.state && e.state.key) {
  24560. setStateKey(e.state.key);
  24561. }
  24562. });
  24563. }
  24564. function handleScroll (
  24565. router,
  24566. to,
  24567. from,
  24568. isPop
  24569. ) {
  24570. if (!router.app) {
  24571. return
  24572. }
  24573. var behavior = router.options.scrollBehavior;
  24574. if (!behavior) {
  24575. return
  24576. }
  24577. if (process.env.NODE_ENV !== 'production') {
  24578. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  24579. }
  24580. // wait until re-render finishes before scrolling
  24581. router.app.$nextTick(function () {
  24582. var position = getScrollPosition();
  24583. var shouldScroll = behavior(to, from, isPop ? position : null);
  24584. if (!shouldScroll) {
  24585. return
  24586. }
  24587. var isObject = typeof shouldScroll === 'object';
  24588. if (isObject && typeof shouldScroll.selector === 'string') {
  24589. var el = document.querySelector(shouldScroll.selector);
  24590. if (el) {
  24591. position = getElementPosition(el);
  24592. } else if (isValidPosition(shouldScroll)) {
  24593. position = normalizePosition(shouldScroll);
  24594. }
  24595. } else if (isObject && isValidPosition(shouldScroll)) {
  24596. position = normalizePosition(shouldScroll);
  24597. }
  24598. if (position) {
  24599. window.scrollTo(position.x, position.y);
  24600. }
  24601. });
  24602. }
  24603. function saveScrollPosition () {
  24604. var key = getStateKey();
  24605. if (key) {
  24606. positionStore[key] = {
  24607. x: window.pageXOffset,
  24608. y: window.pageYOffset
  24609. };
  24610. }
  24611. }
  24612. function getScrollPosition () {
  24613. var key = getStateKey();
  24614. if (key) {
  24615. return positionStore[key]
  24616. }
  24617. }
  24618. function getElementPosition (el) {
  24619. var docRect = document.documentElement.getBoundingClientRect();
  24620. var elRect = el.getBoundingClientRect();
  24621. return {
  24622. x: elRect.left - docRect.left,
  24623. y: elRect.top - docRect.top
  24624. }
  24625. }
  24626. function isValidPosition (obj) {
  24627. return isNumber(obj.x) || isNumber(obj.y)
  24628. }
  24629. function normalizePosition (obj) {
  24630. return {
  24631. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  24632. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  24633. }
  24634. }
  24635. function isNumber (v) {
  24636. return typeof v === 'number'
  24637. }
  24638. /* */
  24639. var supportsPushState = inBrowser && (function () {
  24640. var ua = window.navigator.userAgent;
  24641. if (
  24642. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  24643. ua.indexOf('Mobile Safari') !== -1 &&
  24644. ua.indexOf('Chrome') === -1 &&
  24645. ua.indexOf('Windows Phone') === -1
  24646. ) {
  24647. return false
  24648. }
  24649. return window.history && 'pushState' in window.history
  24650. })();
  24651. // use User Timing api (if present) for more accurate key precision
  24652. var Time = inBrowser && window.performance && window.performance.now
  24653. ? window.performance
  24654. : Date;
  24655. var _key = genKey();
  24656. function genKey () {
  24657. return Time.now().toFixed(3)
  24658. }
  24659. function getStateKey () {
  24660. return _key
  24661. }
  24662. function setStateKey (key) {
  24663. _key = key;
  24664. }
  24665. function pushState (url, replace) {
  24666. saveScrollPosition();
  24667. // try...catch the pushState call to get around Safari
  24668. // DOM Exception 18 where it limits to 100 pushState calls
  24669. var history = window.history;
  24670. try {
  24671. if (replace) {
  24672. history.replaceState({ key: _key }, '', url);
  24673. } else {
  24674. _key = genKey();
  24675. history.pushState({ key: _key }, '', url);
  24676. }
  24677. } catch (e) {
  24678. window.location[replace ? 'replace' : 'assign'](url);
  24679. }
  24680. }
  24681. function replaceState (url) {
  24682. pushState(url, true);
  24683. }
  24684. /* */
  24685. function runQueue (queue, fn, cb) {
  24686. var step = function (index) {
  24687. if (index >= queue.length) {
  24688. cb();
  24689. } else {
  24690. if (queue[index]) {
  24691. fn(queue[index], function () {
  24692. step(index + 1);
  24693. });
  24694. } else {
  24695. step(index + 1);
  24696. }
  24697. }
  24698. };
  24699. step(0);
  24700. }
  24701. /* */
  24702. var History = function History (router, base) {
  24703. this.router = router;
  24704. this.base = normalizeBase(base);
  24705. // start with a route object that stands for "nowhere"
  24706. this.current = START;
  24707. this.pending = null;
  24708. this.ready = false;
  24709. this.readyCbs = [];
  24710. };
  24711. History.prototype.listen = function listen (cb) {
  24712. this.cb = cb;
  24713. };
  24714. History.prototype.onReady = function onReady (cb) {
  24715. if (this.ready) {
  24716. cb();
  24717. } else {
  24718. this.readyCbs.push(cb);
  24719. }
  24720. };
  24721. History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {
  24722. var this$1 = this;
  24723. var route = this.router.match(location, this.current);
  24724. this.confirmTransition(route, function () {
  24725. this$1.updateRoute(route);
  24726. onComplete && onComplete(route);
  24727. this$1.ensureURL();
  24728. // fire ready cbs once
  24729. if (!this$1.ready) {
  24730. this$1.ready = true;
  24731. this$1.readyCbs.forEach(function (cb) {
  24732. cb(route);
  24733. });
  24734. }
  24735. }, onAbort);
  24736. };
  24737. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  24738. var this$1 = this;
  24739. var current = this.current;
  24740. var abort = function () { onAbort && onAbort(); };
  24741. if (
  24742. isSameRoute(route, current) &&
  24743. // in the case the route map has been dynamically appended to
  24744. route.matched.length === current.matched.length
  24745. ) {
  24746. this.ensureURL();
  24747. return abort()
  24748. }
  24749. var ref = resolveQueue(this.current.matched, route.matched);
  24750. var updated = ref.updated;
  24751. var deactivated = ref.deactivated;
  24752. var activated = ref.activated;
  24753. var queue = [].concat(
  24754. // in-component leave guards
  24755. extractLeaveGuards(deactivated),
  24756. // global before hooks
  24757. this.router.beforeHooks,
  24758. // in-component update hooks
  24759. extractUpdateHooks(updated),
  24760. // in-config enter guards
  24761. activated.map(function (m) { return m.beforeEnter; }),
  24762. // async components
  24763. resolveAsyncComponents(activated)
  24764. );
  24765. this.pending = route;
  24766. var iterator = function (hook, next) {
  24767. if (this$1.pending !== route) {
  24768. return abort()
  24769. }
  24770. hook(route, current, function (to) {
  24771. if (to === false) {
  24772. // next(false) -> abort navigation, ensure current URL
  24773. this$1.ensureURL(true);
  24774. abort();
  24775. } else if (typeof to === 'string' || typeof to === 'object') {
  24776. // next('/') or next({ path: '/' }) -> redirect
  24777. (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to);
  24778. abort();
  24779. } else {
  24780. // confirm transition and pass on the value
  24781. next(to);
  24782. }
  24783. });
  24784. };
  24785. runQueue(queue, iterator, function () {
  24786. var postEnterCbs = [];
  24787. var isValid = function () { return this$1.current === route; };
  24788. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  24789. // wait until async components are resolved before
  24790. // extracting in-component enter guards
  24791. runQueue(enterGuards, iterator, function () {
  24792. if (this$1.pending !== route) {
  24793. return abort()
  24794. }
  24795. this$1.pending = null;
  24796. onComplete(route);
  24797. if (this$1.router.app) {
  24798. this$1.router.app.$nextTick(function () {
  24799. postEnterCbs.forEach(function (cb) { return cb(); });
  24800. });
  24801. }
  24802. });
  24803. });
  24804. };
  24805. History.prototype.updateRoute = function updateRoute (route) {
  24806. var prev = this.current;
  24807. this.current = route;
  24808. this.cb && this.cb(route);
  24809. this.router.afterHooks.forEach(function (hook) {
  24810. hook && hook(route, prev);
  24811. });
  24812. };
  24813. function normalizeBase (base) {
  24814. if (!base) {
  24815. if (inBrowser) {
  24816. // respect <base> tag
  24817. var baseEl = document.querySelector('base');
  24818. base = baseEl ? baseEl.getAttribute('href') : '/';
  24819. } else {
  24820. base = '/';
  24821. }
  24822. }
  24823. // make sure there's the starting slash
  24824. if (base.charAt(0) !== '/') {
  24825. base = '/' + base;
  24826. }
  24827. // remove trailing slash
  24828. return base.replace(/\/$/, '')
  24829. }
  24830. function resolveQueue (
  24831. current,
  24832. next
  24833. ) {
  24834. var i;
  24835. var max = Math.max(current.length, next.length);
  24836. for (i = 0; i < max; i++) {
  24837. if (current[i] !== next[i]) {
  24838. break
  24839. }
  24840. }
  24841. return {
  24842. updated: next.slice(0, i),
  24843. activated: next.slice(i),
  24844. deactivated: current.slice(i)
  24845. }
  24846. }
  24847. function extractGuards (
  24848. records,
  24849. name,
  24850. bind,
  24851. reverse
  24852. ) {
  24853. var guards = flatMapComponents(records, function (def, instance, match, key) {
  24854. var guard = extractGuard(def, name);
  24855. if (guard) {
  24856. return Array.isArray(guard)
  24857. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  24858. : bind(guard, instance, match, key)
  24859. }
  24860. });
  24861. return flatten(reverse ? guards.reverse() : guards)
  24862. }
  24863. function extractGuard (
  24864. def,
  24865. key
  24866. ) {
  24867. if (typeof def !== 'function') {
  24868. // extend now so that global mixins are applied.
  24869. def = _Vue.extend(def);
  24870. }
  24871. return def.options[key]
  24872. }
  24873. function extractLeaveGuards (deactivated) {
  24874. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  24875. }
  24876. function extractUpdateHooks (updated) {
  24877. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  24878. }
  24879. function bindGuard (guard, instance) {
  24880. return function boundRouteGuard () {
  24881. return guard.apply(instance, arguments)
  24882. }
  24883. }
  24884. function extractEnterGuards (
  24885. activated,
  24886. cbs,
  24887. isValid
  24888. ) {
  24889. return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {
  24890. return bindEnterGuard(guard, match, key, cbs, isValid)
  24891. })
  24892. }
  24893. function bindEnterGuard (
  24894. guard,
  24895. match,
  24896. key,
  24897. cbs,
  24898. isValid
  24899. ) {
  24900. return function routeEnterGuard (to, from, next) {
  24901. return guard(to, from, function (cb) {
  24902. next(cb);
  24903. if (typeof cb === 'function') {
  24904. cbs.push(function () {
  24905. // #750
  24906. // if a router-view is wrapped with an out-in transition,
  24907. // the instance may not have been registered at this time.
  24908. // we will need to poll for registration until current route
  24909. // is no longer valid.
  24910. poll(cb, match.instances, key, isValid);
  24911. });
  24912. }
  24913. })
  24914. }
  24915. }
  24916. function poll (
  24917. cb, // somehow flow cannot infer this is a function
  24918. instances,
  24919. key,
  24920. isValid
  24921. ) {
  24922. if (instances[key]) {
  24923. cb(instances[key]);
  24924. } else if (isValid()) {
  24925. setTimeout(function () {
  24926. poll(cb, instances, key, isValid);
  24927. }, 16);
  24928. }
  24929. }
  24930. function resolveAsyncComponents (matched) {
  24931. return flatMapComponents(matched, function (def, _, match, key) {
  24932. // if it's a function and doesn't have Vue options attached,
  24933. // assume it's an async component resolve function.
  24934. // we are not using Vue's default async resolving mechanism because
  24935. // we want to halt the navigation until the incoming component has been
  24936. // resolved.
  24937. if (typeof def === 'function' && !def.options) {
  24938. return function (to, from, next) {
  24939. var resolve = once(function (resolvedDef) {
  24940. match.components[key] = resolvedDef;
  24941. next();
  24942. });
  24943. var reject = once(function (reason) {
  24944. warn(false, ("Failed to resolve async component " + key + ": " + reason));
  24945. next(false);
  24946. });
  24947. var res = def(resolve, reject);
  24948. if (res && typeof res.then === 'function') {
  24949. res.then(resolve, reject);
  24950. }
  24951. }
  24952. }
  24953. })
  24954. }
  24955. function flatMapComponents (
  24956. matched,
  24957. fn
  24958. ) {
  24959. return flatten(matched.map(function (m) {
  24960. return Object.keys(m.components).map(function (key) { return fn(
  24961. m.components[key],
  24962. m.instances[key],
  24963. m, key
  24964. ); })
  24965. }))
  24966. }
  24967. function flatten (arr) {
  24968. return Array.prototype.concat.apply([], arr)
  24969. }
  24970. // in Webpack 2, require.ensure now also returns a Promise
  24971. // so the resolve/reject functions may get called an extra time
  24972. // if the user uses an arrow function shorthand that happens to
  24973. // return that Promise.
  24974. function once (fn) {
  24975. var called = false;
  24976. return function () {
  24977. if (called) { return }
  24978. called = true;
  24979. return fn.apply(this, arguments)
  24980. }
  24981. }
  24982. /* */
  24983. var HTML5History = (function (History$$1) {
  24984. function HTML5History (router, base) {
  24985. var this$1 = this;
  24986. History$$1.call(this, router, base);
  24987. var expectScroll = router.options.scrollBehavior;
  24988. if (expectScroll) {
  24989. setupScroll();
  24990. }
  24991. window.addEventListener('popstate', function (e) {
  24992. this$1.transitionTo(getLocation(this$1.base), function (route) {
  24993. if (expectScroll) {
  24994. handleScroll(router, route, this$1.current, true);
  24995. }
  24996. });
  24997. });
  24998. }
  24999. if ( History$$1 ) HTML5History.__proto__ = History$$1;
  25000. HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
  25001. HTML5History.prototype.constructor = HTML5History;
  25002. HTML5History.prototype.go = function go (n) {
  25003. window.history.go(n);
  25004. };
  25005. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  25006. var this$1 = this;
  25007. this.transitionTo(location, function (route) {
  25008. pushState(cleanPath(this$1.base + route.fullPath));
  25009. handleScroll(this$1.router, route, this$1.current, false);
  25010. onComplete && onComplete(route);
  25011. }, onAbort);
  25012. };
  25013. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  25014. var this$1 = this;
  25015. this.transitionTo(location, function (route) {
  25016. replaceState(cleanPath(this$1.base + route.fullPath));
  25017. handleScroll(this$1.router, route, this$1.current, false);
  25018. onComplete && onComplete(route);
  25019. }, onAbort);
  25020. };
  25021. HTML5History.prototype.ensureURL = function ensureURL (push) {
  25022. if (getLocation(this.base) !== this.current.fullPath) {
  25023. var current = cleanPath(this.base + this.current.fullPath);
  25024. push ? pushState(current) : replaceState(current);
  25025. }
  25026. };
  25027. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  25028. return getLocation(this.base)
  25029. };
  25030. return HTML5History;
  25031. }(History));
  25032. function getLocation (base) {
  25033. var path = window.location.pathname;
  25034. if (base && path.indexOf(base) === 0) {
  25035. path = path.slice(base.length);
  25036. }
  25037. return (path || '/') + window.location.search + window.location.hash
  25038. }
  25039. /* */
  25040. var HashHistory = (function (History$$1) {
  25041. function HashHistory (router, base, fallback) {
  25042. History$$1.call(this, router, base);
  25043. // check history fallback deeplinking
  25044. if (fallback && checkFallback(this.base)) {
  25045. return
  25046. }
  25047. ensureSlash();
  25048. }
  25049. if ( History$$1 ) HashHistory.__proto__ = History$$1;
  25050. HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  25051. HashHistory.prototype.constructor = HashHistory;
  25052. // this is delayed until the app mounts
  25053. // to avoid the hashchange listener being fired too early
  25054. HashHistory.prototype.setupListeners = function setupListeners () {
  25055. var this$1 = this;
  25056. window.addEventListener('hashchange', function () {
  25057. if (!ensureSlash()) {
  25058. return
  25059. }
  25060. this$1.transitionTo(getHash(), function (route) {
  25061. replaceHash(route.fullPath);
  25062. });
  25063. });
  25064. };
  25065. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  25066. this.transitionTo(location, function (route) {
  25067. pushHash(route.fullPath);
  25068. onComplete && onComplete(route);
  25069. }, onAbort);
  25070. };
  25071. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  25072. this.transitionTo(location, function (route) {
  25073. replaceHash(route.fullPath);
  25074. onComplete && onComplete(route);
  25075. }, onAbort);
  25076. };
  25077. HashHistory.prototype.go = function go (n) {
  25078. window.history.go(n);
  25079. };
  25080. HashHistory.prototype.ensureURL = function ensureURL (push) {
  25081. var current = this.current.fullPath;
  25082. if (getHash() !== current) {
  25083. push ? pushHash(current) : replaceHash(current);
  25084. }
  25085. };
  25086. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  25087. return getHash()
  25088. };
  25089. return HashHistory;
  25090. }(History));
  25091. function checkFallback (base) {
  25092. var location = getLocation(base);
  25093. if (!/^\/#/.test(location)) {
  25094. window.location.replace(
  25095. cleanPath(base + '/#' + location)
  25096. );
  25097. return true
  25098. }
  25099. }
  25100. function ensureSlash () {
  25101. var path = getHash();
  25102. if (path.charAt(0) === '/') {
  25103. return true
  25104. }
  25105. replaceHash('/' + path);
  25106. return false
  25107. }
  25108. function getHash () {
  25109. // We can't use window.location.hash here because it's not
  25110. // consistent across browsers - Firefox will pre-decode it!
  25111. var href = window.location.href;
  25112. var index = href.indexOf('#');
  25113. return index === -1 ? '' : href.slice(index + 1)
  25114. }
  25115. function pushHash (path) {
  25116. window.location.hash = path;
  25117. }
  25118. function replaceHash (path) {
  25119. var i = window.location.href.indexOf('#');
  25120. window.location.replace(
  25121. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  25122. );
  25123. }
  25124. /* */
  25125. var AbstractHistory = (function (History$$1) {
  25126. function AbstractHistory (router, base) {
  25127. History$$1.call(this, router, base);
  25128. this.stack = [];
  25129. this.index = -1;
  25130. }
  25131. if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
  25132. AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
  25133. AbstractHistory.prototype.constructor = AbstractHistory;
  25134. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  25135. var this$1 = this;
  25136. this.transitionTo(location, function (route) {
  25137. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  25138. this$1.index++;
  25139. onComplete && onComplete(route);
  25140. }, onAbort);
  25141. };
  25142. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  25143. var this$1 = this;
  25144. this.transitionTo(location, function (route) {
  25145. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  25146. onComplete && onComplete(route);
  25147. }, onAbort);
  25148. };
  25149. AbstractHistory.prototype.go = function go (n) {
  25150. var this$1 = this;
  25151. var targetIndex = this.index + n;
  25152. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  25153. return
  25154. }
  25155. var route = this.stack[targetIndex];
  25156. this.confirmTransition(route, function () {
  25157. this$1.index = targetIndex;
  25158. this$1.updateRoute(route);
  25159. });
  25160. };
  25161. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  25162. var current = this.stack[this.stack.length - 1];
  25163. return current ? current.fullPath : '/'
  25164. };
  25165. AbstractHistory.prototype.ensureURL = function ensureURL () {
  25166. // noop
  25167. };
  25168. return AbstractHistory;
  25169. }(History));
  25170. /* */
  25171. var VueRouter = function VueRouter (options) {
  25172. if ( options === void 0 ) options = {};
  25173. this.app = null;
  25174. this.apps = [];
  25175. this.options = options;
  25176. this.beforeHooks = [];
  25177. this.afterHooks = [];
  25178. this.matcher = createMatcher(options.routes || []);
  25179. var mode = options.mode || 'hash';
  25180. this.fallback = mode === 'history' && !supportsPushState;
  25181. if (this.fallback) {
  25182. mode = 'hash';
  25183. }
  25184. if (!inBrowser) {
  25185. mode = 'abstract';
  25186. }
  25187. this.mode = mode;
  25188. switch (mode) {
  25189. case 'history':
  25190. this.history = new HTML5History(this, options.base);
  25191. break
  25192. case 'hash':
  25193. this.history = new HashHistory(this, options.base, this.fallback);
  25194. break
  25195. case 'abstract':
  25196. this.history = new AbstractHistory(this, options.base);
  25197. break
  25198. default:
  25199. if (process.env.NODE_ENV !== 'production') {
  25200. assert(false, ("invalid mode: " + mode));
  25201. }
  25202. }
  25203. };
  25204. var prototypeAccessors = { currentRoute: {} };
  25205. VueRouter.prototype.match = function match (
  25206. raw,
  25207. current,
  25208. redirectedFrom
  25209. ) {
  25210. return this.matcher.match(raw, current, redirectedFrom)
  25211. };
  25212. prototypeAccessors.currentRoute.get = function () {
  25213. return this.history && this.history.current
  25214. };
  25215. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  25216. var this$1 = this;
  25217. process.env.NODE_ENV !== 'production' && assert(
  25218. install.installed,
  25219. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  25220. "before creating root instance."
  25221. );
  25222. this.apps.push(app);
  25223. // main app already initialized.
  25224. if (this.app) {
  25225. return
  25226. }
  25227. this.app = app;
  25228. var history = this.history;
  25229. if (history instanceof HTML5History) {
  25230. history.transitionTo(history.getCurrentLocation());
  25231. } else if (history instanceof HashHistory) {
  25232. var setupHashListener = function () {
  25233. history.setupListeners();
  25234. };
  25235. history.transitionTo(
  25236. history.getCurrentLocation(),
  25237. setupHashListener,
  25238. setupHashListener
  25239. );
  25240. }
  25241. history.listen(function (route) {
  25242. this$1.apps.forEach(function (app) {
  25243. app._route = route;
  25244. });
  25245. });
  25246. };
  25247. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  25248. this.beforeHooks.push(fn);
  25249. };
  25250. VueRouter.prototype.afterEach = function afterEach (fn) {
  25251. this.afterHooks.push(fn);
  25252. };
  25253. VueRouter.prototype.onReady = function onReady (cb) {
  25254. this.history.onReady(cb);
  25255. };
  25256. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  25257. this.history.push(location, onComplete, onAbort);
  25258. };
  25259. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  25260. this.history.replace(location, onComplete, onAbort);
  25261. };
  25262. VueRouter.prototype.go = function go (n) {
  25263. this.history.go(n);
  25264. };
  25265. VueRouter.prototype.back = function back () {
  25266. this.go(-1);
  25267. };
  25268. VueRouter.prototype.forward = function forward () {
  25269. this.go(1);
  25270. };
  25271. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  25272. var route = to
  25273. ? this.resolve(to).route
  25274. : this.currentRoute;
  25275. if (!route) {
  25276. return []
  25277. }
  25278. return [].concat.apply([], route.matched.map(function (m) {
  25279. return Object.keys(m.components).map(function (key) {
  25280. return m.components[key]
  25281. })
  25282. }))
  25283. };
  25284. VueRouter.prototype.resolve = function resolve (
  25285. to,
  25286. current,
  25287. append
  25288. ) {
  25289. var location = normalizeLocation(to, current || this.history.current, append);
  25290. var route = this.match(location, current);
  25291. var fullPath = route.redirectedFrom || route.fullPath;
  25292. var base = this.history.base;
  25293. var href = createHref(base, fullPath, this.mode);
  25294. return {
  25295. location: location,
  25296. route: route,
  25297. href: href,
  25298. // for backwards compat
  25299. normalizedTo: location,
  25300. resolved: route
  25301. }
  25302. };
  25303. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  25304. this.matcher.addRoutes(routes);
  25305. if (this.history.current !== START) {
  25306. this.history.transitionTo(this.history.getCurrentLocation());
  25307. }
  25308. };
  25309. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  25310. function createHref (base, fullPath, mode) {
  25311. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  25312. return base ? cleanPath(base + '/' + path) : path
  25313. }
  25314. VueRouter.install = install;
  25315. VueRouter.version = '2.2.1';
  25316. if (inBrowser && window.Vue) {
  25317. window.Vue.use(VueRouter);
  25318. }
  25319. module.exports = VueRouter;
  25320. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(113)))
  25321. /***/ }),
  25322. /* 124 */
  25323. /***/ (function(module, exports, __webpack_require__) {
  25324. "use strict";
  25325. /* WEBPACK VAR INJECTION */(function(process, global) {/*!
  25326. * Vue.js v2.1.10
  25327. * (c) 2014-2017 Evan You
  25328. * Released under the MIT License.
  25329. */
  25330. /* */
  25331. /**
  25332. * Convert a value to a string that is actually rendered.
  25333. */
  25334. function _toString (val) {
  25335. return val == null
  25336. ? ''
  25337. : typeof val === 'object'
  25338. ? JSON.stringify(val, null, 2)
  25339. : String(val)
  25340. }
  25341. /**
  25342. * Convert a input value to a number for persistence.
  25343. * If the conversion fails, return original string.
  25344. */
  25345. function toNumber (val) {
  25346. var n = parseFloat(val);
  25347. return isNaN(n) ? val : n
  25348. }
  25349. /**
  25350. * Make a map and return a function for checking if a key
  25351. * is in that map.
  25352. */
  25353. function makeMap (
  25354. str,
  25355. expectsLowerCase
  25356. ) {
  25357. var map = Object.create(null);
  25358. var list = str.split(',');
  25359. for (var i = 0; i < list.length; i++) {
  25360. map[list[i]] = true;
  25361. }
  25362. return expectsLowerCase
  25363. ? function (val) { return map[val.toLowerCase()]; }
  25364. : function (val) { return map[val]; }
  25365. }
  25366. /**
  25367. * Check if a tag is a built-in tag.
  25368. */
  25369. var isBuiltInTag = makeMap('slot,component', true);
  25370. /**
  25371. * Remove an item from an array
  25372. */
  25373. function remove$1 (arr, item) {
  25374. if (arr.length) {
  25375. var index = arr.indexOf(item);
  25376. if (index > -1) {
  25377. return arr.splice(index, 1)
  25378. }
  25379. }
  25380. }
  25381. /**
  25382. * Check whether the object has the property.
  25383. */
  25384. var hasOwnProperty = Object.prototype.hasOwnProperty;
  25385. function hasOwn (obj, key) {
  25386. return hasOwnProperty.call(obj, key)
  25387. }
  25388. /**
  25389. * Check if value is primitive
  25390. */
  25391. function isPrimitive (value) {
  25392. return typeof value === 'string' || typeof value === 'number'
  25393. }
  25394. /**
  25395. * Create a cached version of a pure function.
  25396. */
  25397. function cached (fn) {
  25398. var cache = Object.create(null);
  25399. return (function cachedFn (str) {
  25400. var hit = cache[str];
  25401. return hit || (cache[str] = fn(str))
  25402. })
  25403. }
  25404. /**
  25405. * Camelize a hyphen-delimited string.
  25406. */
  25407. var camelizeRE = /-(\w)/g;
  25408. var camelize = cached(function (str) {
  25409. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  25410. });
  25411. /**
  25412. * Capitalize a string.
  25413. */
  25414. var capitalize = cached(function (str) {
  25415. return str.charAt(0).toUpperCase() + str.slice(1)
  25416. });
  25417. /**
  25418. * Hyphenate a camelCase string.
  25419. */
  25420. var hyphenateRE = /([^-])([A-Z])/g;
  25421. var hyphenate = cached(function (str) {
  25422. return str
  25423. .replace(hyphenateRE, '$1-$2')
  25424. .replace(hyphenateRE, '$1-$2')
  25425. .toLowerCase()
  25426. });
  25427. /**
  25428. * Simple bind, faster than native
  25429. */
  25430. function bind$1 (fn, ctx) {
  25431. function boundFn (a) {
  25432. var l = arguments.length;
  25433. return l
  25434. ? l > 1
  25435. ? fn.apply(ctx, arguments)
  25436. : fn.call(ctx, a)
  25437. : fn.call(ctx)
  25438. }
  25439. // record original fn length
  25440. boundFn._length = fn.length;
  25441. return boundFn
  25442. }
  25443. /**
  25444. * Convert an Array-like object to a real Array.
  25445. */
  25446. function toArray (list, start) {
  25447. start = start || 0;
  25448. var i = list.length - start;
  25449. var ret = new Array(i);
  25450. while (i--) {
  25451. ret[i] = list[i + start];
  25452. }
  25453. return ret
  25454. }
  25455. /**
  25456. * Mix properties into target object.
  25457. */
  25458. function extend (to, _from) {
  25459. for (var key in _from) {
  25460. to[key] = _from[key];
  25461. }
  25462. return to
  25463. }
  25464. /**
  25465. * Quick object check - this is primarily used to tell
  25466. * Objects from primitive values when we know the value
  25467. * is a JSON-compliant type.
  25468. */
  25469. function isObject (obj) {
  25470. return obj !== null && typeof obj === 'object'
  25471. }
  25472. /**
  25473. * Strict object type check. Only returns true
  25474. * for plain JavaScript objects.
  25475. */
  25476. var toString = Object.prototype.toString;
  25477. var OBJECT_STRING = '[object Object]';
  25478. function isPlainObject (obj) {
  25479. return toString.call(obj) === OBJECT_STRING
  25480. }
  25481. /**
  25482. * Merge an Array of Objects into a single Object.
  25483. */
  25484. function toObject (arr) {
  25485. var res = {};
  25486. for (var i = 0; i < arr.length; i++) {
  25487. if (arr[i]) {
  25488. extend(res, arr[i]);
  25489. }
  25490. }
  25491. return res
  25492. }
  25493. /**
  25494. * Perform no operation.
  25495. */
  25496. function noop () {}
  25497. /**
  25498. * Always return false.
  25499. */
  25500. var no = function () { return false; };
  25501. /**
  25502. * Return same value
  25503. */
  25504. var identity = function (_) { return _; };
  25505. /**
  25506. * Generate a static keys string from compiler modules.
  25507. */
  25508. function genStaticKeys (modules) {
  25509. return modules.reduce(function (keys, m) {
  25510. return keys.concat(m.staticKeys || [])
  25511. }, []).join(',')
  25512. }
  25513. /**
  25514. * Check if two values are loosely equal - that is,
  25515. * if they are plain objects, do they have the same shape?
  25516. */
  25517. function looseEqual (a, b) {
  25518. var isObjectA = isObject(a);
  25519. var isObjectB = isObject(b);
  25520. if (isObjectA && isObjectB) {
  25521. return JSON.stringify(a) === JSON.stringify(b)
  25522. } else if (!isObjectA && !isObjectB) {
  25523. return String(a) === String(b)
  25524. } else {
  25525. return false
  25526. }
  25527. }
  25528. function looseIndexOf (arr, val) {
  25529. for (var i = 0; i < arr.length; i++) {
  25530. if (looseEqual(arr[i], val)) { return i }
  25531. }
  25532. return -1
  25533. }
  25534. /* */
  25535. var config = {
  25536. /**
  25537. * Option merge strategies (used in core/util/options)
  25538. */
  25539. optionMergeStrategies: Object.create(null),
  25540. /**
  25541. * Whether to suppress warnings.
  25542. */
  25543. silent: false,
  25544. /**
  25545. * Whether to enable devtools
  25546. */
  25547. devtools: process.env.NODE_ENV !== 'production',
  25548. /**
  25549. * Error handler for watcher errors
  25550. */
  25551. errorHandler: null,
  25552. /**
  25553. * Ignore certain custom elements
  25554. */
  25555. ignoredElements: [],
  25556. /**
  25557. * Custom user key aliases for v-on
  25558. */
  25559. keyCodes: Object.create(null),
  25560. /**
  25561. * Check if a tag is reserved so that it cannot be registered as a
  25562. * component. This is platform-dependent and may be overwritten.
  25563. */
  25564. isReservedTag: no,
  25565. /**
  25566. * Check if a tag is an unknown element.
  25567. * Platform-dependent.
  25568. */
  25569. isUnknownElement: no,
  25570. /**
  25571. * Get the namespace of an element
  25572. */
  25573. getTagNamespace: noop,
  25574. /**
  25575. * Parse the real tag name for the specific platform.
  25576. */
  25577. parsePlatformTagName: identity,
  25578. /**
  25579. * Check if an attribute must be bound using property, e.g. value
  25580. * Platform-dependent.
  25581. */
  25582. mustUseProp: no,
  25583. /**
  25584. * List of asset types that a component can own.
  25585. */
  25586. _assetTypes: [
  25587. 'component',
  25588. 'directive',
  25589. 'filter'
  25590. ],
  25591. /**
  25592. * List of lifecycle hooks.
  25593. */
  25594. _lifecycleHooks: [
  25595. 'beforeCreate',
  25596. 'created',
  25597. 'beforeMount',
  25598. 'mounted',
  25599. 'beforeUpdate',
  25600. 'updated',
  25601. 'beforeDestroy',
  25602. 'destroyed',
  25603. 'activated',
  25604. 'deactivated'
  25605. ],
  25606. /**
  25607. * Max circular updates allowed in a scheduler flush cycle.
  25608. */
  25609. _maxUpdateCount: 100
  25610. };
  25611. /* */
  25612. /**
  25613. * Check if a string starts with $ or _
  25614. */
  25615. function isReserved (str) {
  25616. var c = (str + '').charCodeAt(0);
  25617. return c === 0x24 || c === 0x5F
  25618. }
  25619. /**
  25620. * Define a property.
  25621. */
  25622. function def (obj, key, val, enumerable) {
  25623. Object.defineProperty(obj, key, {
  25624. value: val,
  25625. enumerable: !!enumerable,
  25626. writable: true,
  25627. configurable: true
  25628. });
  25629. }
  25630. /**
  25631. * Parse simple path.
  25632. */
  25633. var bailRE = /[^\w.$]/;
  25634. function parsePath (path) {
  25635. if (bailRE.test(path)) {
  25636. return
  25637. } else {
  25638. var segments = path.split('.');
  25639. return function (obj) {
  25640. for (var i = 0; i < segments.length; i++) {
  25641. if (!obj) { return }
  25642. obj = obj[segments[i]];
  25643. }
  25644. return obj
  25645. }
  25646. }
  25647. }
  25648. /* */
  25649. /* globals MutationObserver */
  25650. // can we use __proto__?
  25651. var hasProto = '__proto__' in {};
  25652. // Browser environment sniffing
  25653. var inBrowser = typeof window !== 'undefined';
  25654. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  25655. var isIE = UA && /msie|trident/.test(UA);
  25656. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  25657. var isEdge = UA && UA.indexOf('edge/') > 0;
  25658. var isAndroid = UA && UA.indexOf('android') > 0;
  25659. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  25660. // this needs to be lazy-evaled because vue may be required before
  25661. // vue-server-renderer can set VUE_ENV
  25662. var _isServer;
  25663. var isServerRendering = function () {
  25664. if (_isServer === undefined) {
  25665. /* istanbul ignore if */
  25666. if (!inBrowser && typeof global !== 'undefined') {
  25667. // detect presence of vue-server-renderer and avoid
  25668. // Webpack shimming the process
  25669. _isServer = global['process'].env.VUE_ENV === 'server';
  25670. } else {
  25671. _isServer = false;
  25672. }
  25673. }
  25674. return _isServer
  25675. };
  25676. // detect devtools
  25677. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  25678. /* istanbul ignore next */
  25679. function isNative (Ctor) {
  25680. return /native code/.test(Ctor.toString())
  25681. }
  25682. /**
  25683. * Defer a task to execute it asynchronously.
  25684. */
  25685. var nextTick = (function () {
  25686. var callbacks = [];
  25687. var pending = false;
  25688. var timerFunc;
  25689. function nextTickHandler () {
  25690. pending = false;
  25691. var copies = callbacks.slice(0);
  25692. callbacks.length = 0;
  25693. for (var i = 0; i < copies.length; i++) {
  25694. copies[i]();
  25695. }
  25696. }
  25697. // the nextTick behavior leverages the microtask queue, which can be accessed
  25698. // via either native Promise.then or MutationObserver.
  25699. // MutationObserver has wider support, however it is seriously bugged in
  25700. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  25701. // completely stops working after triggering a few times... so, if native
  25702. // Promise is available, we will use it:
  25703. /* istanbul ignore if */
  25704. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  25705. var p = Promise.resolve();
  25706. var logError = function (err) { console.error(err); };
  25707. timerFunc = function () {
  25708. p.then(nextTickHandler).catch(logError);
  25709. // in problematic UIWebViews, Promise.then doesn't completely break, but
  25710. // it can get stuck in a weird state where callbacks are pushed into the
  25711. // microtask queue but the queue isn't being flushed, until the browser
  25712. // needs to do some other work, e.g. handle a timer. Therefore we can
  25713. // "force" the microtask queue to be flushed by adding an empty timer.
  25714. if (isIOS) { setTimeout(noop); }
  25715. };
  25716. } else if (typeof MutationObserver !== 'undefined' && (
  25717. isNative(MutationObserver) ||
  25718. // PhantomJS and iOS 7.x
  25719. MutationObserver.toString() === '[object MutationObserverConstructor]'
  25720. )) {
  25721. // use MutationObserver where native Promise is not available,
  25722. // e.g. PhantomJS IE11, iOS7, Android 4.4
  25723. var counter = 1;
  25724. var observer = new MutationObserver(nextTickHandler);
  25725. var textNode = document.createTextNode(String(counter));
  25726. observer.observe(textNode, {
  25727. characterData: true
  25728. });
  25729. timerFunc = function () {
  25730. counter = (counter + 1) % 2;
  25731. textNode.data = String(counter);
  25732. };
  25733. } else {
  25734. // fallback to setTimeout
  25735. /* istanbul ignore next */
  25736. timerFunc = function () {
  25737. setTimeout(nextTickHandler, 0);
  25738. };
  25739. }
  25740. return function queueNextTick (cb, ctx) {
  25741. var _resolve;
  25742. callbacks.push(function () {
  25743. if (cb) { cb.call(ctx); }
  25744. if (_resolve) { _resolve(ctx); }
  25745. });
  25746. if (!pending) {
  25747. pending = true;
  25748. timerFunc();
  25749. }
  25750. if (!cb && typeof Promise !== 'undefined') {
  25751. return new Promise(function (resolve) {
  25752. _resolve = resolve;
  25753. })
  25754. }
  25755. }
  25756. })();
  25757. var _Set;
  25758. /* istanbul ignore if */
  25759. if (typeof Set !== 'undefined' && isNative(Set)) {
  25760. // use native Set when available.
  25761. _Set = Set;
  25762. } else {
  25763. // a non-standard Set polyfill that only works with primitive keys.
  25764. _Set = (function () {
  25765. function Set () {
  25766. this.set = Object.create(null);
  25767. }
  25768. Set.prototype.has = function has (key) {
  25769. return this.set[key] === true
  25770. };
  25771. Set.prototype.add = function add (key) {
  25772. this.set[key] = true;
  25773. };
  25774. Set.prototype.clear = function clear () {
  25775. this.set = Object.create(null);
  25776. };
  25777. return Set;
  25778. }());
  25779. }
  25780. var warn = noop;
  25781. var formatComponentName;
  25782. if (process.env.NODE_ENV !== 'production') {
  25783. var hasConsole = typeof console !== 'undefined';
  25784. warn = function (msg, vm) {
  25785. if (hasConsole && (!config.silent)) {
  25786. console.error("[Vue warn]: " + msg + " " + (
  25787. vm ? formatLocation(formatComponentName(vm)) : ''
  25788. ));
  25789. }
  25790. };
  25791. formatComponentName = function (vm) {
  25792. if (vm.$root === vm) {
  25793. return 'root instance'
  25794. }
  25795. var name = vm._isVue
  25796. ? vm.$options.name || vm.$options._componentTag
  25797. : vm.name;
  25798. return (
  25799. (name ? ("component <" + name + ">") : "anonymous component") +
  25800. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  25801. )
  25802. };
  25803. var formatLocation = function (str) {
  25804. if (str === 'anonymous component') {
  25805. str += " - use the \"name\" option for better debugging messages.";
  25806. }
  25807. return ("\n(found in " + str + ")")
  25808. };
  25809. }
  25810. /* */
  25811. var uid$1 = 0;
  25812. /**
  25813. * A dep is an observable that can have multiple
  25814. * directives subscribing to it.
  25815. */
  25816. var Dep = function Dep () {
  25817. this.id = uid$1++;
  25818. this.subs = [];
  25819. };
  25820. Dep.prototype.addSub = function addSub (sub) {
  25821. this.subs.push(sub);
  25822. };
  25823. Dep.prototype.removeSub = function removeSub (sub) {
  25824. remove$1(this.subs, sub);
  25825. };
  25826. Dep.prototype.depend = function depend () {
  25827. if (Dep.target) {
  25828. Dep.target.addDep(this);
  25829. }
  25830. };
  25831. Dep.prototype.notify = function notify () {
  25832. // stablize the subscriber list first
  25833. var subs = this.subs.slice();
  25834. for (var i = 0, l = subs.length; i < l; i++) {
  25835. subs[i].update();
  25836. }
  25837. };
  25838. // the current target watcher being evaluated.
  25839. // this is globally unique because there could be only one
  25840. // watcher being evaluated at any time.
  25841. Dep.target = null;
  25842. var targetStack = [];
  25843. function pushTarget (_target) {
  25844. if (Dep.target) { targetStack.push(Dep.target); }
  25845. Dep.target = _target;
  25846. }
  25847. function popTarget () {
  25848. Dep.target = targetStack.pop();
  25849. }
  25850. /*
  25851. * not type checking this file because flow doesn't play well with
  25852. * dynamically accessing methods on Array prototype
  25853. */
  25854. var arrayProto = Array.prototype;
  25855. var arrayMethods = Object.create(arrayProto);[
  25856. 'push',
  25857. 'pop',
  25858. 'shift',
  25859. 'unshift',
  25860. 'splice',
  25861. 'sort',
  25862. 'reverse'
  25863. ]
  25864. .forEach(function (method) {
  25865. // cache original method
  25866. var original = arrayProto[method];
  25867. def(arrayMethods, method, function mutator () {
  25868. var arguments$1 = arguments;
  25869. // avoid leaking arguments:
  25870. // http://jsperf.com/closure-with-arguments
  25871. var i = arguments.length;
  25872. var args = new Array(i);
  25873. while (i--) {
  25874. args[i] = arguments$1[i];
  25875. }
  25876. var result = original.apply(this, args);
  25877. var ob = this.__ob__;
  25878. var inserted;
  25879. switch (method) {
  25880. case 'push':
  25881. inserted = args;
  25882. break
  25883. case 'unshift':
  25884. inserted = args;
  25885. break
  25886. case 'splice':
  25887. inserted = args.slice(2);
  25888. break
  25889. }
  25890. if (inserted) { ob.observeArray(inserted); }
  25891. // notify change
  25892. ob.dep.notify();
  25893. return result
  25894. });
  25895. });
  25896. /* */
  25897. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  25898. /**
  25899. * By default, when a reactive property is set, the new value is
  25900. * also converted to become reactive. However when passing down props,
  25901. * we don't want to force conversion because the value may be a nested value
  25902. * under a frozen data structure. Converting it would defeat the optimization.
  25903. */
  25904. var observerState = {
  25905. shouldConvert: true,
  25906. isSettingProps: false
  25907. };
  25908. /**
  25909. * Observer class that are attached to each observed
  25910. * object. Once attached, the observer converts target
  25911. * object's property keys into getter/setters that
  25912. * collect dependencies and dispatches updates.
  25913. */
  25914. var Observer = function Observer (value) {
  25915. this.value = value;
  25916. this.dep = new Dep();
  25917. this.vmCount = 0;
  25918. def(value, '__ob__', this);
  25919. if (Array.isArray(value)) {
  25920. var augment = hasProto
  25921. ? protoAugment
  25922. : copyAugment;
  25923. augment(value, arrayMethods, arrayKeys);
  25924. this.observeArray(value);
  25925. } else {
  25926. this.walk(value);
  25927. }
  25928. };
  25929. /**
  25930. * Walk through each property and convert them into
  25931. * getter/setters. This method should only be called when
  25932. * value type is Object.
  25933. */
  25934. Observer.prototype.walk = function walk (obj) {
  25935. var keys = Object.keys(obj);
  25936. for (var i = 0; i < keys.length; i++) {
  25937. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  25938. }
  25939. };
  25940. /**
  25941. * Observe a list of Array items.
  25942. */
  25943. Observer.prototype.observeArray = function observeArray (items) {
  25944. for (var i = 0, l = items.length; i < l; i++) {
  25945. observe(items[i]);
  25946. }
  25947. };
  25948. // helpers
  25949. /**
  25950. * Augment an target Object or Array by intercepting
  25951. * the prototype chain using __proto__
  25952. */
  25953. function protoAugment (target, src) {
  25954. /* eslint-disable no-proto */
  25955. target.__proto__ = src;
  25956. /* eslint-enable no-proto */
  25957. }
  25958. /**
  25959. * Augment an target Object or Array by defining
  25960. * hidden properties.
  25961. */
  25962. /* istanbul ignore next */
  25963. function copyAugment (target, src, keys) {
  25964. for (var i = 0, l = keys.length; i < l; i++) {
  25965. var key = keys[i];
  25966. def(target, key, src[key]);
  25967. }
  25968. }
  25969. /**
  25970. * Attempt to create an observer instance for a value,
  25971. * returns the new observer if successfully observed,
  25972. * or the existing observer if the value already has one.
  25973. */
  25974. function observe (value, asRootData) {
  25975. if (!isObject(value)) {
  25976. return
  25977. }
  25978. var ob;
  25979. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  25980. ob = value.__ob__;
  25981. } else if (
  25982. observerState.shouldConvert &&
  25983. !isServerRendering() &&
  25984. (Array.isArray(value) || isPlainObject(value)) &&
  25985. Object.isExtensible(value) &&
  25986. !value._isVue
  25987. ) {
  25988. ob = new Observer(value);
  25989. }
  25990. if (asRootData && ob) {
  25991. ob.vmCount++;
  25992. }
  25993. return ob
  25994. }
  25995. /**
  25996. * Define a reactive property on an Object.
  25997. */
  25998. function defineReactive$$1 (
  25999. obj,
  26000. key,
  26001. val,
  26002. customSetter
  26003. ) {
  26004. var dep = new Dep();
  26005. var property = Object.getOwnPropertyDescriptor(obj, key);
  26006. if (property && property.configurable === false) {
  26007. return
  26008. }
  26009. // cater for pre-defined getter/setters
  26010. var getter = property && property.get;
  26011. var setter = property && property.set;
  26012. var childOb = observe(val);
  26013. Object.defineProperty(obj, key, {
  26014. enumerable: true,
  26015. configurable: true,
  26016. get: function reactiveGetter () {
  26017. var value = getter ? getter.call(obj) : val;
  26018. if (Dep.target) {
  26019. dep.depend();
  26020. if (childOb) {
  26021. childOb.dep.depend();
  26022. }
  26023. if (Array.isArray(value)) {
  26024. dependArray(value);
  26025. }
  26026. }
  26027. return value
  26028. },
  26029. set: function reactiveSetter (newVal) {
  26030. var value = getter ? getter.call(obj) : val;
  26031. /* eslint-disable no-self-compare */
  26032. if (newVal === value || (newVal !== newVal && value !== value)) {
  26033. return
  26034. }
  26035. /* eslint-enable no-self-compare */
  26036. if (process.env.NODE_ENV !== 'production' && customSetter) {
  26037. customSetter();
  26038. }
  26039. if (setter) {
  26040. setter.call(obj, newVal);
  26041. } else {
  26042. val = newVal;
  26043. }
  26044. childOb = observe(newVal);
  26045. dep.notify();
  26046. }
  26047. });
  26048. }
  26049. /**
  26050. * Set a property on an object. Adds the new property and
  26051. * triggers change notification if the property doesn't
  26052. * already exist.
  26053. */
  26054. function set$1 (obj, key, val) {
  26055. if (Array.isArray(obj)) {
  26056. obj.length = Math.max(obj.length, key);
  26057. obj.splice(key, 1, val);
  26058. return val
  26059. }
  26060. if (hasOwn(obj, key)) {
  26061. obj[key] = val;
  26062. return
  26063. }
  26064. var ob = obj.__ob__;
  26065. if (obj._isVue || (ob && ob.vmCount)) {
  26066. process.env.NODE_ENV !== 'production' && warn(
  26067. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  26068. 'at runtime - declare it upfront in the data option.'
  26069. );
  26070. return
  26071. }
  26072. if (!ob) {
  26073. obj[key] = val;
  26074. return
  26075. }
  26076. defineReactive$$1(ob.value, key, val);
  26077. ob.dep.notify();
  26078. return val
  26079. }
  26080. /**
  26081. * Delete a property and trigger change if necessary.
  26082. */
  26083. function del (obj, key) {
  26084. var ob = obj.__ob__;
  26085. if (obj._isVue || (ob && ob.vmCount)) {
  26086. process.env.NODE_ENV !== 'production' && warn(
  26087. 'Avoid deleting properties on a Vue instance or its root $data ' +
  26088. '- just set it to null.'
  26089. );
  26090. return
  26091. }
  26092. if (!hasOwn(obj, key)) {
  26093. return
  26094. }
  26095. delete obj[key];
  26096. if (!ob) {
  26097. return
  26098. }
  26099. ob.dep.notify();
  26100. }
  26101. /**
  26102. * Collect dependencies on array elements when the array is touched, since
  26103. * we cannot intercept array element access like property getters.
  26104. */
  26105. function dependArray (value) {
  26106. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  26107. e = value[i];
  26108. e && e.__ob__ && e.__ob__.dep.depend();
  26109. if (Array.isArray(e)) {
  26110. dependArray(e);
  26111. }
  26112. }
  26113. }
  26114. /* */
  26115. /**
  26116. * Option overwriting strategies are functions that handle
  26117. * how to merge a parent option value and a child option
  26118. * value into the final value.
  26119. */
  26120. var strats = config.optionMergeStrategies;
  26121. /**
  26122. * Options with restrictions
  26123. */
  26124. if (process.env.NODE_ENV !== 'production') {
  26125. strats.el = strats.propsData = function (parent, child, vm, key) {
  26126. if (!vm) {
  26127. warn(
  26128. "option \"" + key + "\" can only be used during instance " +
  26129. 'creation with the `new` keyword.'
  26130. );
  26131. }
  26132. return defaultStrat(parent, child)
  26133. };
  26134. }
  26135. /**
  26136. * Helper that recursively merges two data objects together.
  26137. */
  26138. function mergeData (to, from) {
  26139. if (!from) { return to }
  26140. var key, toVal, fromVal;
  26141. var keys = Object.keys(from);
  26142. for (var i = 0; i < keys.length; i++) {
  26143. key = keys[i];
  26144. toVal = to[key];
  26145. fromVal = from[key];
  26146. if (!hasOwn(to, key)) {
  26147. set$1(to, key, fromVal);
  26148. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  26149. mergeData(toVal, fromVal);
  26150. }
  26151. }
  26152. return to
  26153. }
  26154. /**
  26155. * Data
  26156. */
  26157. strats.data = function (
  26158. parentVal,
  26159. childVal,
  26160. vm
  26161. ) {
  26162. if (!vm) {
  26163. // in a Vue.extend merge, both should be functions
  26164. if (!childVal) {
  26165. return parentVal
  26166. }
  26167. if (typeof childVal !== 'function') {
  26168. process.env.NODE_ENV !== 'production' && warn(
  26169. 'The "data" option should be a function ' +
  26170. 'that returns a per-instance value in component ' +
  26171. 'definitions.',
  26172. vm
  26173. );
  26174. return parentVal
  26175. }
  26176. if (!parentVal) {
  26177. return childVal
  26178. }
  26179. // when parentVal & childVal are both present,
  26180. // we need to return a function that returns the
  26181. // merged result of both functions... no need to
  26182. // check if parentVal is a function here because
  26183. // it has to be a function to pass previous merges.
  26184. return function mergedDataFn () {
  26185. return mergeData(
  26186. childVal.call(this),
  26187. parentVal.call(this)
  26188. )
  26189. }
  26190. } else if (parentVal || childVal) {
  26191. return function mergedInstanceDataFn () {
  26192. // instance merge
  26193. var instanceData = typeof childVal === 'function'
  26194. ? childVal.call(vm)
  26195. : childVal;
  26196. var defaultData = typeof parentVal === 'function'
  26197. ? parentVal.call(vm)
  26198. : undefined;
  26199. if (instanceData) {
  26200. return mergeData(instanceData, defaultData)
  26201. } else {
  26202. return defaultData
  26203. }
  26204. }
  26205. }
  26206. };
  26207. /**
  26208. * Hooks and param attributes are merged as arrays.
  26209. */
  26210. function mergeHook (
  26211. parentVal,
  26212. childVal
  26213. ) {
  26214. return childVal
  26215. ? parentVal
  26216. ? parentVal.concat(childVal)
  26217. : Array.isArray(childVal)
  26218. ? childVal
  26219. : [childVal]
  26220. : parentVal
  26221. }
  26222. config._lifecycleHooks.forEach(function (hook) {
  26223. strats[hook] = mergeHook;
  26224. });
  26225. /**
  26226. * Assets
  26227. *
  26228. * When a vm is present (instance creation), we need to do
  26229. * a three-way merge between constructor options, instance
  26230. * options and parent options.
  26231. */
  26232. function mergeAssets (parentVal, childVal) {
  26233. var res = Object.create(parentVal || null);
  26234. return childVal
  26235. ? extend(res, childVal)
  26236. : res
  26237. }
  26238. config._assetTypes.forEach(function (type) {
  26239. strats[type + 's'] = mergeAssets;
  26240. });
  26241. /**
  26242. * Watchers.
  26243. *
  26244. * Watchers hashes should not overwrite one
  26245. * another, so we merge them as arrays.
  26246. */
  26247. strats.watch = function (parentVal, childVal) {
  26248. /* istanbul ignore if */
  26249. if (!childVal) { return parentVal }
  26250. if (!parentVal) { return childVal }
  26251. var ret = {};
  26252. extend(ret, parentVal);
  26253. for (var key in childVal) {
  26254. var parent = ret[key];
  26255. var child = childVal[key];
  26256. if (parent && !Array.isArray(parent)) {
  26257. parent = [parent];
  26258. }
  26259. ret[key] = parent
  26260. ? parent.concat(child)
  26261. : [child];
  26262. }
  26263. return ret
  26264. };
  26265. /**
  26266. * Other object hashes.
  26267. */
  26268. strats.props =
  26269. strats.methods =
  26270. strats.computed = function (parentVal, childVal) {
  26271. if (!childVal) { return parentVal }
  26272. if (!parentVal) { return childVal }
  26273. var ret = Object.create(null);
  26274. extend(ret, parentVal);
  26275. extend(ret, childVal);
  26276. return ret
  26277. };
  26278. /**
  26279. * Default strategy.
  26280. */
  26281. var defaultStrat = function (parentVal, childVal) {
  26282. return childVal === undefined
  26283. ? parentVal
  26284. : childVal
  26285. };
  26286. /**
  26287. * Validate component names
  26288. */
  26289. function checkComponents (options) {
  26290. for (var key in options.components) {
  26291. var lower = key.toLowerCase();
  26292. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  26293. warn(
  26294. 'Do not use built-in or reserved HTML elements as component ' +
  26295. 'id: ' + key
  26296. );
  26297. }
  26298. }
  26299. }
  26300. /**
  26301. * Ensure all props option syntax are normalized into the
  26302. * Object-based format.
  26303. */
  26304. function normalizeProps (options) {
  26305. var props = options.props;
  26306. if (!props) { return }
  26307. var res = {};
  26308. var i, val, name;
  26309. if (Array.isArray(props)) {
  26310. i = props.length;
  26311. while (i--) {
  26312. val = props[i];
  26313. if (typeof val === 'string') {
  26314. name = camelize(val);
  26315. res[name] = { type: null };
  26316. } else if (process.env.NODE_ENV !== 'production') {
  26317. warn('props must be strings when using array syntax.');
  26318. }
  26319. }
  26320. } else if (isPlainObject(props)) {
  26321. for (var key in props) {
  26322. val = props[key];
  26323. name = camelize(key);
  26324. res[name] = isPlainObject(val)
  26325. ? val
  26326. : { type: val };
  26327. }
  26328. }
  26329. options.props = res;
  26330. }
  26331. /**
  26332. * Normalize raw function directives into object format.
  26333. */
  26334. function normalizeDirectives (options) {
  26335. var dirs = options.directives;
  26336. if (dirs) {
  26337. for (var key in dirs) {
  26338. var def = dirs[key];
  26339. if (typeof def === 'function') {
  26340. dirs[key] = { bind: def, update: def };
  26341. }
  26342. }
  26343. }
  26344. }
  26345. /**
  26346. * Merge two option objects into a new one.
  26347. * Core utility used in both instantiation and inheritance.
  26348. */
  26349. function mergeOptions (
  26350. parent,
  26351. child,
  26352. vm
  26353. ) {
  26354. if (process.env.NODE_ENV !== 'production') {
  26355. checkComponents(child);
  26356. }
  26357. normalizeProps(child);
  26358. normalizeDirectives(child);
  26359. var extendsFrom = child.extends;
  26360. if (extendsFrom) {
  26361. parent = typeof extendsFrom === 'function'
  26362. ? mergeOptions(parent, extendsFrom.options, vm)
  26363. : mergeOptions(parent, extendsFrom, vm);
  26364. }
  26365. if (child.mixins) {
  26366. for (var i = 0, l = child.mixins.length; i < l; i++) {
  26367. var mixin = child.mixins[i];
  26368. if (mixin.prototype instanceof Vue$3) {
  26369. mixin = mixin.options;
  26370. }
  26371. parent = mergeOptions(parent, mixin, vm);
  26372. }
  26373. }
  26374. var options = {};
  26375. var key;
  26376. for (key in parent) {
  26377. mergeField(key);
  26378. }
  26379. for (key in child) {
  26380. if (!hasOwn(parent, key)) {
  26381. mergeField(key);
  26382. }
  26383. }
  26384. function mergeField (key) {
  26385. var strat = strats[key] || defaultStrat;
  26386. options[key] = strat(parent[key], child[key], vm, key);
  26387. }
  26388. return options
  26389. }
  26390. /**
  26391. * Resolve an asset.
  26392. * This function is used because child instances need access
  26393. * to assets defined in its ancestor chain.
  26394. */
  26395. function resolveAsset (
  26396. options,
  26397. type,
  26398. id,
  26399. warnMissing
  26400. ) {
  26401. /* istanbul ignore if */
  26402. if (typeof id !== 'string') {
  26403. return
  26404. }
  26405. var assets = options[type];
  26406. // check local registration variations first
  26407. if (hasOwn(assets, id)) { return assets[id] }
  26408. var camelizedId = camelize(id);
  26409. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  26410. var PascalCaseId = capitalize(camelizedId);
  26411. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  26412. // fallback to prototype chain
  26413. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  26414. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  26415. warn(
  26416. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  26417. options
  26418. );
  26419. }
  26420. return res
  26421. }
  26422. /* */
  26423. function validateProp (
  26424. key,
  26425. propOptions,
  26426. propsData,
  26427. vm
  26428. ) {
  26429. var prop = propOptions[key];
  26430. var absent = !hasOwn(propsData, key);
  26431. var value = propsData[key];
  26432. // handle boolean props
  26433. if (isType(Boolean, prop.type)) {
  26434. if (absent && !hasOwn(prop, 'default')) {
  26435. value = false;
  26436. } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
  26437. value = true;
  26438. }
  26439. }
  26440. // check default value
  26441. if (value === undefined) {
  26442. value = getPropDefaultValue(vm, prop, key);
  26443. // since the default value is a fresh copy,
  26444. // make sure to observe it.
  26445. var prevShouldConvert = observerState.shouldConvert;
  26446. observerState.shouldConvert = true;
  26447. observe(value);
  26448. observerState.shouldConvert = prevShouldConvert;
  26449. }
  26450. if (process.env.NODE_ENV !== 'production') {
  26451. assertProp(prop, key, value, vm, absent);
  26452. }
  26453. return value
  26454. }
  26455. /**
  26456. * Get the default value of a prop.
  26457. */
  26458. function getPropDefaultValue (vm, prop, key) {
  26459. // no default, return undefined
  26460. if (!hasOwn(prop, 'default')) {
  26461. return undefined
  26462. }
  26463. var def = prop.default;
  26464. // warn against non-factory defaults for Object & Array
  26465. if (isObject(def)) {
  26466. process.env.NODE_ENV !== 'production' && warn(
  26467. 'Invalid default value for prop "' + key + '": ' +
  26468. 'Props with type Object/Array must use a factory function ' +
  26469. 'to return the default value.',
  26470. vm
  26471. );
  26472. }
  26473. // the raw prop value was also undefined from previous render,
  26474. // return previous default value to avoid unnecessary watcher trigger
  26475. if (vm && vm.$options.propsData &&
  26476. vm.$options.propsData[key] === undefined &&
  26477. vm[key] !== undefined) {
  26478. return vm[key]
  26479. }
  26480. // call factory function for non-Function types
  26481. return typeof def === 'function' && prop.type !== Function
  26482. ? def.call(vm)
  26483. : def
  26484. }
  26485. /**
  26486. * Assert whether a prop is valid.
  26487. */
  26488. function assertProp (
  26489. prop,
  26490. name,
  26491. value,
  26492. vm,
  26493. absent
  26494. ) {
  26495. if (prop.required && absent) {
  26496. warn(
  26497. 'Missing required prop: "' + name + '"',
  26498. vm
  26499. );
  26500. return
  26501. }
  26502. if (value == null && !prop.required) {
  26503. return
  26504. }
  26505. var type = prop.type;
  26506. var valid = !type || type === true;
  26507. var expectedTypes = [];
  26508. if (type) {
  26509. if (!Array.isArray(type)) {
  26510. type = [type];
  26511. }
  26512. for (var i = 0; i < type.length && !valid; i++) {
  26513. var assertedType = assertType(value, type[i]);
  26514. expectedTypes.push(assertedType.expectedType || '');
  26515. valid = assertedType.valid;
  26516. }
  26517. }
  26518. if (!valid) {
  26519. warn(
  26520. 'Invalid prop: type check failed for prop "' + name + '".' +
  26521. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  26522. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  26523. vm
  26524. );
  26525. return
  26526. }
  26527. var validator = prop.validator;
  26528. if (validator) {
  26529. if (!validator(value)) {
  26530. warn(
  26531. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  26532. vm
  26533. );
  26534. }
  26535. }
  26536. }
  26537. /**
  26538. * Assert the type of a value
  26539. */
  26540. function assertType (value, type) {
  26541. var valid;
  26542. var expectedType = getType(type);
  26543. if (expectedType === 'String') {
  26544. valid = typeof value === (expectedType = 'string');
  26545. } else if (expectedType === 'Number') {
  26546. valid = typeof value === (expectedType = 'number');
  26547. } else if (expectedType === 'Boolean') {
  26548. valid = typeof value === (expectedType = 'boolean');
  26549. } else if (expectedType === 'Function') {
  26550. valid = typeof value === (expectedType = 'function');
  26551. } else if (expectedType === 'Object') {
  26552. valid = isPlainObject(value);
  26553. } else if (expectedType === 'Array') {
  26554. valid = Array.isArray(value);
  26555. } else {
  26556. valid = value instanceof type;
  26557. }
  26558. return {
  26559. valid: valid,
  26560. expectedType: expectedType
  26561. }
  26562. }
  26563. /**
  26564. * Use function string name to check built-in types,
  26565. * because a simple equality check will fail when running
  26566. * across different vms / iframes.
  26567. */
  26568. function getType (fn) {
  26569. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  26570. return match && match[1]
  26571. }
  26572. function isType (type, fn) {
  26573. if (!Array.isArray(fn)) {
  26574. return getType(fn) === getType(type)
  26575. }
  26576. for (var i = 0, len = fn.length; i < len; i++) {
  26577. if (getType(fn[i]) === getType(type)) {
  26578. return true
  26579. }
  26580. }
  26581. /* istanbul ignore next */
  26582. return false
  26583. }
  26584. var util = Object.freeze({
  26585. defineReactive: defineReactive$$1,
  26586. _toString: _toString,
  26587. toNumber: toNumber,
  26588. makeMap: makeMap,
  26589. isBuiltInTag: isBuiltInTag,
  26590. remove: remove$1,
  26591. hasOwn: hasOwn,
  26592. isPrimitive: isPrimitive,
  26593. cached: cached,
  26594. camelize: camelize,
  26595. capitalize: capitalize,
  26596. hyphenate: hyphenate,
  26597. bind: bind$1,
  26598. toArray: toArray,
  26599. extend: extend,
  26600. isObject: isObject,
  26601. isPlainObject: isPlainObject,
  26602. toObject: toObject,
  26603. noop: noop,
  26604. no: no,
  26605. identity: identity,
  26606. genStaticKeys: genStaticKeys,
  26607. looseEqual: looseEqual,
  26608. looseIndexOf: looseIndexOf,
  26609. isReserved: isReserved,
  26610. def: def,
  26611. parsePath: parsePath,
  26612. hasProto: hasProto,
  26613. inBrowser: inBrowser,
  26614. UA: UA,
  26615. isIE: isIE,
  26616. isIE9: isIE9,
  26617. isEdge: isEdge,
  26618. isAndroid: isAndroid,
  26619. isIOS: isIOS,
  26620. isServerRendering: isServerRendering,
  26621. devtools: devtools,
  26622. nextTick: nextTick,
  26623. get _Set () { return _Set; },
  26624. mergeOptions: mergeOptions,
  26625. resolveAsset: resolveAsset,
  26626. get warn () { return warn; },
  26627. get formatComponentName () { return formatComponentName; },
  26628. validateProp: validateProp
  26629. });
  26630. /* not type checking this file because flow doesn't play well with Proxy */
  26631. var initProxy;
  26632. if (process.env.NODE_ENV !== 'production') {
  26633. var allowedGlobals = makeMap(
  26634. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  26635. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  26636. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  26637. 'require' // for Webpack/Browserify
  26638. );
  26639. var warnNonPresent = function (target, key) {
  26640. warn(
  26641. "Property or method \"" + key + "\" is not defined on the instance but " +
  26642. "referenced during render. Make sure to declare reactive data " +
  26643. "properties in the data option.",
  26644. target
  26645. );
  26646. };
  26647. var hasProxy =
  26648. typeof Proxy !== 'undefined' &&
  26649. Proxy.toString().match(/native code/);
  26650. if (hasProxy) {
  26651. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
  26652. config.keyCodes = new Proxy(config.keyCodes, {
  26653. set: function set (target, key, value) {
  26654. if (isBuiltInModifier(key)) {
  26655. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  26656. return false
  26657. } else {
  26658. target[key] = value;
  26659. return true
  26660. }
  26661. }
  26662. });
  26663. }
  26664. var hasHandler = {
  26665. has: function has (target, key) {
  26666. var has = key in target;
  26667. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  26668. if (!has && !isAllowed) {
  26669. warnNonPresent(target, key);
  26670. }
  26671. return has || !isAllowed
  26672. }
  26673. };
  26674. var getHandler = {
  26675. get: function get (target, key) {
  26676. if (typeof key === 'string' && !(key in target)) {
  26677. warnNonPresent(target, key);
  26678. }
  26679. return target[key]
  26680. }
  26681. };
  26682. initProxy = function initProxy (vm) {
  26683. if (hasProxy) {
  26684. // determine which proxy handler to use
  26685. var options = vm.$options;
  26686. var handlers = options.render && options.render._withStripped
  26687. ? getHandler
  26688. : hasHandler;
  26689. vm._renderProxy = new Proxy(vm, handlers);
  26690. } else {
  26691. vm._renderProxy = vm;
  26692. }
  26693. };
  26694. }
  26695. /* */
  26696. var VNode = function VNode (
  26697. tag,
  26698. data,
  26699. children,
  26700. text,
  26701. elm,
  26702. context,
  26703. componentOptions
  26704. ) {
  26705. this.tag = tag;
  26706. this.data = data;
  26707. this.children = children;
  26708. this.text = text;
  26709. this.elm = elm;
  26710. this.ns = undefined;
  26711. this.context = context;
  26712. this.functionalContext = undefined;
  26713. this.key = data && data.key;
  26714. this.componentOptions = componentOptions;
  26715. this.componentInstance = undefined;
  26716. this.parent = undefined;
  26717. this.raw = false;
  26718. this.isStatic = false;
  26719. this.isRootInsert = true;
  26720. this.isComment = false;
  26721. this.isCloned = false;
  26722. this.isOnce = false;
  26723. };
  26724. var prototypeAccessors = { child: {} };
  26725. // DEPRECATED: alias for componentInstance for backwards compat.
  26726. /* istanbul ignore next */
  26727. prototypeAccessors.child.get = function () {
  26728. return this.componentInstance
  26729. };
  26730. Object.defineProperties( VNode.prototype, prototypeAccessors );
  26731. var createEmptyVNode = function () {
  26732. var node = new VNode();
  26733. node.text = '';
  26734. node.isComment = true;
  26735. return node
  26736. };
  26737. function createTextVNode (val) {
  26738. return new VNode(undefined, undefined, undefined, String(val))
  26739. }
  26740. // optimized shallow clone
  26741. // used for static nodes and slot nodes because they may be reused across
  26742. // multiple renders, cloning them avoids errors when DOM manipulations rely
  26743. // on their elm reference.
  26744. function cloneVNode (vnode) {
  26745. var cloned = new VNode(
  26746. vnode.tag,
  26747. vnode.data,
  26748. vnode.children,
  26749. vnode.text,
  26750. vnode.elm,
  26751. vnode.context,
  26752. vnode.componentOptions
  26753. );
  26754. cloned.ns = vnode.ns;
  26755. cloned.isStatic = vnode.isStatic;
  26756. cloned.key = vnode.key;
  26757. cloned.isCloned = true;
  26758. return cloned
  26759. }
  26760. function cloneVNodes (vnodes) {
  26761. var res = new Array(vnodes.length);
  26762. for (var i = 0; i < vnodes.length; i++) {
  26763. res[i] = cloneVNode(vnodes[i]);
  26764. }
  26765. return res
  26766. }
  26767. /* */
  26768. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  26769. var hooksToMerge = Object.keys(hooks);
  26770. function createComponent (
  26771. Ctor,
  26772. data,
  26773. context,
  26774. children,
  26775. tag
  26776. ) {
  26777. if (!Ctor) {
  26778. return
  26779. }
  26780. var baseCtor = context.$options._base;
  26781. if (isObject(Ctor)) {
  26782. Ctor = baseCtor.extend(Ctor);
  26783. }
  26784. if (typeof Ctor !== 'function') {
  26785. if (process.env.NODE_ENV !== 'production') {
  26786. warn(("Invalid Component definition: " + (String(Ctor))), context);
  26787. }
  26788. return
  26789. }
  26790. // async component
  26791. if (!Ctor.cid) {
  26792. if (Ctor.resolved) {
  26793. Ctor = Ctor.resolved;
  26794. } else {
  26795. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  26796. // it's ok to queue this on every render because
  26797. // $forceUpdate is buffered by the scheduler.
  26798. context.$forceUpdate();
  26799. });
  26800. if (!Ctor) {
  26801. // return nothing if this is indeed an async component
  26802. // wait for the callback to trigger parent update.
  26803. return
  26804. }
  26805. }
  26806. }
  26807. // resolve constructor options in case global mixins are applied after
  26808. // component constructor creation
  26809. resolveConstructorOptions(Ctor);
  26810. data = data || {};
  26811. // extract props
  26812. var propsData = extractProps(data, Ctor);
  26813. // functional component
  26814. if (Ctor.options.functional) {
  26815. return createFunctionalComponent(Ctor, propsData, data, context, children)
  26816. }
  26817. // extract listeners, since these needs to be treated as
  26818. // child component listeners instead of DOM listeners
  26819. var listeners = data.on;
  26820. // replace with listeners with .native modifier
  26821. data.on = data.nativeOn;
  26822. if (Ctor.options.abstract) {
  26823. // abstract components do not keep anything
  26824. // other than props & listeners
  26825. data = {};
  26826. }
  26827. // merge component management hooks onto the placeholder node
  26828. mergeHooks(data);
  26829. // return a placeholder vnode
  26830. var name = Ctor.options.name || tag;
  26831. var vnode = new VNode(
  26832. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  26833. data, undefined, undefined, undefined, context,
  26834. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  26835. );
  26836. return vnode
  26837. }
  26838. function createFunctionalComponent (
  26839. Ctor,
  26840. propsData,
  26841. data,
  26842. context,
  26843. children
  26844. ) {
  26845. var props = {};
  26846. var propOptions = Ctor.options.props;
  26847. if (propOptions) {
  26848. for (var key in propOptions) {
  26849. props[key] = validateProp(key, propOptions, propsData);
  26850. }
  26851. }
  26852. // ensure the createElement function in functional components
  26853. // gets a unique context - this is necessary for correct named slot check
  26854. var _context = Object.create(context);
  26855. var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
  26856. var vnode = Ctor.options.render.call(null, h, {
  26857. props: props,
  26858. data: data,
  26859. parent: context,
  26860. children: children,
  26861. slots: function () { return resolveSlots(children, context); }
  26862. });
  26863. if (vnode instanceof VNode) {
  26864. vnode.functionalContext = context;
  26865. if (data.slot) {
  26866. (vnode.data || (vnode.data = {})).slot = data.slot;
  26867. }
  26868. }
  26869. return vnode
  26870. }
  26871. function createComponentInstanceForVnode (
  26872. vnode, // we know it's MountedComponentVNode but flow doesn't
  26873. parent, // activeInstance in lifecycle state
  26874. parentElm,
  26875. refElm
  26876. ) {
  26877. var vnodeComponentOptions = vnode.componentOptions;
  26878. var options = {
  26879. _isComponent: true,
  26880. parent: parent,
  26881. propsData: vnodeComponentOptions.propsData,
  26882. _componentTag: vnodeComponentOptions.tag,
  26883. _parentVnode: vnode,
  26884. _parentListeners: vnodeComponentOptions.listeners,
  26885. _renderChildren: vnodeComponentOptions.children,
  26886. _parentElm: parentElm || null,
  26887. _refElm: refElm || null
  26888. };
  26889. // check inline-template render functions
  26890. var inlineTemplate = vnode.data.inlineTemplate;
  26891. if (inlineTemplate) {
  26892. options.render = inlineTemplate.render;
  26893. options.staticRenderFns = inlineTemplate.staticRenderFns;
  26894. }
  26895. return new vnodeComponentOptions.Ctor(options)
  26896. }
  26897. function init (
  26898. vnode,
  26899. hydrating,
  26900. parentElm,
  26901. refElm
  26902. ) {
  26903. if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
  26904. var child = vnode.componentInstance = createComponentInstanceForVnode(
  26905. vnode,
  26906. activeInstance,
  26907. parentElm,
  26908. refElm
  26909. );
  26910. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  26911. } else if (vnode.data.keepAlive) {
  26912. // kept-alive components, treat as a patch
  26913. var mountedNode = vnode; // work around flow
  26914. prepatch(mountedNode, mountedNode);
  26915. }
  26916. }
  26917. function prepatch (
  26918. oldVnode,
  26919. vnode
  26920. ) {
  26921. var options = vnode.componentOptions;
  26922. var child = vnode.componentInstance = oldVnode.componentInstance;
  26923. child._updateFromParent(
  26924. options.propsData, // updated props
  26925. options.listeners, // updated listeners
  26926. vnode, // new parent vnode
  26927. options.children // new children
  26928. );
  26929. }
  26930. function insert (vnode) {
  26931. if (!vnode.componentInstance._isMounted) {
  26932. vnode.componentInstance._isMounted = true;
  26933. callHook(vnode.componentInstance, 'mounted');
  26934. }
  26935. if (vnode.data.keepAlive) {
  26936. vnode.componentInstance._inactive = false;
  26937. callHook(vnode.componentInstance, 'activated');
  26938. }
  26939. }
  26940. function destroy$1 (vnode) {
  26941. if (!vnode.componentInstance._isDestroyed) {
  26942. if (!vnode.data.keepAlive) {
  26943. vnode.componentInstance.$destroy();
  26944. } else {
  26945. vnode.componentInstance._inactive = true;
  26946. callHook(vnode.componentInstance, 'deactivated');
  26947. }
  26948. }
  26949. }
  26950. function resolveAsyncComponent (
  26951. factory,
  26952. baseCtor,
  26953. cb
  26954. ) {
  26955. if (factory.requested) {
  26956. // pool callbacks
  26957. factory.pendingCallbacks.push(cb);
  26958. } else {
  26959. factory.requested = true;
  26960. var cbs = factory.pendingCallbacks = [cb];
  26961. var sync = true;
  26962. var resolve = function (res) {
  26963. if (isObject(res)) {
  26964. res = baseCtor.extend(res);
  26965. }
  26966. // cache resolved
  26967. factory.resolved = res;
  26968. // invoke callbacks only if this is not a synchronous resolve
  26969. // (async resolves are shimmed as synchronous during SSR)
  26970. if (!sync) {
  26971. for (var i = 0, l = cbs.length; i < l; i++) {
  26972. cbs[i](res);
  26973. }
  26974. }
  26975. };
  26976. var reject = function (reason) {
  26977. process.env.NODE_ENV !== 'production' && warn(
  26978. "Failed to resolve async component: " + (String(factory)) +
  26979. (reason ? ("\nReason: " + reason) : '')
  26980. );
  26981. };
  26982. var res = factory(resolve, reject);
  26983. // handle promise
  26984. if (res && typeof res.then === 'function' && !factory.resolved) {
  26985. res.then(resolve, reject);
  26986. }
  26987. sync = false;
  26988. // return in case resolved synchronously
  26989. return factory.resolved
  26990. }
  26991. }
  26992. function extractProps (data, Ctor) {
  26993. // we are only extracting raw values here.
  26994. // validation and default values are handled in the child
  26995. // component itself.
  26996. var propOptions = Ctor.options.props;
  26997. if (!propOptions) {
  26998. return
  26999. }
  27000. var res = {};
  27001. var attrs = data.attrs;
  27002. var props = data.props;
  27003. var domProps = data.domProps;
  27004. if (attrs || props || domProps) {
  27005. for (var key in propOptions) {
  27006. var altKey = hyphenate(key);
  27007. checkProp(res, props, key, altKey, true) ||
  27008. checkProp(res, attrs, key, altKey) ||
  27009. checkProp(res, domProps, key, altKey);
  27010. }
  27011. }
  27012. return res
  27013. }
  27014. function checkProp (
  27015. res,
  27016. hash,
  27017. key,
  27018. altKey,
  27019. preserve
  27020. ) {
  27021. if (hash) {
  27022. if (hasOwn(hash, key)) {
  27023. res[key] = hash[key];
  27024. if (!preserve) {
  27025. delete hash[key];
  27026. }
  27027. return true
  27028. } else if (hasOwn(hash, altKey)) {
  27029. res[key] = hash[altKey];
  27030. if (!preserve) {
  27031. delete hash[altKey];
  27032. }
  27033. return true
  27034. }
  27035. }
  27036. return false
  27037. }
  27038. function mergeHooks (data) {
  27039. if (!data.hook) {
  27040. data.hook = {};
  27041. }
  27042. for (var i = 0; i < hooksToMerge.length; i++) {
  27043. var key = hooksToMerge[i];
  27044. var fromParent = data.hook[key];
  27045. var ours = hooks[key];
  27046. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  27047. }
  27048. }
  27049. function mergeHook$1 (one, two) {
  27050. return function (a, b, c, d) {
  27051. one(a, b, c, d);
  27052. two(a, b, c, d);
  27053. }
  27054. }
  27055. /* */
  27056. function mergeVNodeHook (def, hookKey, hook, key) {
  27057. key = key + hookKey;
  27058. var injectedHash = def.__injected || (def.__injected = {});
  27059. if (!injectedHash[key]) {
  27060. injectedHash[key] = true;
  27061. var oldHook = def[hookKey];
  27062. if (oldHook) {
  27063. def[hookKey] = function () {
  27064. oldHook.apply(this, arguments);
  27065. hook.apply(this, arguments);
  27066. };
  27067. } else {
  27068. def[hookKey] = hook;
  27069. }
  27070. }
  27071. }
  27072. /* */
  27073. var normalizeEvent = cached(function (name) {
  27074. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  27075. name = once ? name.slice(1) : name;
  27076. var capture = name.charAt(0) === '!';
  27077. name = capture ? name.slice(1) : name;
  27078. return {
  27079. name: name,
  27080. once: once,
  27081. capture: capture
  27082. }
  27083. });
  27084. function createEventHandle (fn) {
  27085. var handle = {
  27086. fn: fn,
  27087. invoker: function () {
  27088. var arguments$1 = arguments;
  27089. var fn = handle.fn;
  27090. if (Array.isArray(fn)) {
  27091. for (var i = 0; i < fn.length; i++) {
  27092. fn[i].apply(null, arguments$1);
  27093. }
  27094. } else {
  27095. fn.apply(null, arguments);
  27096. }
  27097. }
  27098. };
  27099. return handle
  27100. }
  27101. function updateListeners (
  27102. on,
  27103. oldOn,
  27104. add,
  27105. remove$$1,
  27106. vm
  27107. ) {
  27108. var name, cur, old, event;
  27109. for (name in on) {
  27110. cur = on[name];
  27111. old = oldOn[name];
  27112. event = normalizeEvent(name);
  27113. if (!cur) {
  27114. process.env.NODE_ENV !== 'production' && warn(
  27115. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  27116. vm
  27117. );
  27118. } else if (!old) {
  27119. if (!cur.invoker) {
  27120. cur = on[name] = createEventHandle(cur);
  27121. }
  27122. add(event.name, cur.invoker, event.once, event.capture);
  27123. } else if (cur !== old) {
  27124. old.fn = cur;
  27125. on[name] = old;
  27126. }
  27127. }
  27128. for (name in oldOn) {
  27129. if (!on[name]) {
  27130. event = normalizeEvent(name);
  27131. remove$$1(event.name, oldOn[name].invoker, event.capture);
  27132. }
  27133. }
  27134. }
  27135. /* */
  27136. // The template compiler attempts to minimize the need for normalization by
  27137. // statically analyzing the template at compile time.
  27138. //
  27139. // For plain HTML markup, normalization can be completely skipped because the
  27140. // generated render function is guaranteed to return Array<VNode>. There are
  27141. // two cases where extra normalization is needed:
  27142. // 1. When the children contains components - because a functional component
  27143. // may return an Array instead of a single root. In this case, just a simple
  27144. // nomralization is needed - if any child is an Array, we flatten the whole
  27145. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  27146. // because functional components already normalize their own children.
  27147. function simpleNormalizeChildren (children) {
  27148. for (var i = 0; i < children.length; i++) {
  27149. if (Array.isArray(children[i])) {
  27150. return Array.prototype.concat.apply([], children)
  27151. }
  27152. }
  27153. return children
  27154. }
  27155. // 2. When the children contains constrcuts that always generated nested Arrays,
  27156. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  27157. // with hand-written render functions / JSX. In such cases a full normalization
  27158. // is needed to cater to all possible types of children values.
  27159. function normalizeChildren (children) {
  27160. return isPrimitive(children)
  27161. ? [createTextVNode(children)]
  27162. : Array.isArray(children)
  27163. ? normalizeArrayChildren(children)
  27164. : undefined
  27165. }
  27166. function normalizeArrayChildren (children, nestedIndex) {
  27167. var res = [];
  27168. var i, c, last;
  27169. for (i = 0; i < children.length; i++) {
  27170. c = children[i];
  27171. if (c == null || typeof c === 'boolean') { continue }
  27172. last = res[res.length - 1];
  27173. // nested
  27174. if (Array.isArray(c)) {
  27175. res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
  27176. } else if (isPrimitive(c)) {
  27177. if (last && last.text) {
  27178. last.text += String(c);
  27179. } else if (c !== '') {
  27180. // convert primitive to vnode
  27181. res.push(createTextVNode(c));
  27182. }
  27183. } else {
  27184. if (c.text && last && last.text) {
  27185. res[res.length - 1] = createTextVNode(last.text + c.text);
  27186. } else {
  27187. // default key for nested array children (likely generated by v-for)
  27188. if (c.tag && c.key == null && nestedIndex != null) {
  27189. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  27190. }
  27191. res.push(c);
  27192. }
  27193. }
  27194. }
  27195. return res
  27196. }
  27197. /* */
  27198. function getFirstComponentChild (children) {
  27199. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  27200. }
  27201. /* */
  27202. var SIMPLE_NORMALIZE = 1;
  27203. var ALWAYS_NORMALIZE = 2;
  27204. // wrapper function for providing a more flexible interface
  27205. // without getting yelled at by flow
  27206. function createElement (
  27207. context,
  27208. tag,
  27209. data,
  27210. children,
  27211. normalizationType,
  27212. alwaysNormalize
  27213. ) {
  27214. if (Array.isArray(data) || isPrimitive(data)) {
  27215. normalizationType = children;
  27216. children = data;
  27217. data = undefined;
  27218. }
  27219. if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  27220. return _createElement(context, tag, data, children, normalizationType)
  27221. }
  27222. function _createElement (
  27223. context,
  27224. tag,
  27225. data,
  27226. children,
  27227. normalizationType
  27228. ) {
  27229. if (data && data.__ob__) {
  27230. process.env.NODE_ENV !== 'production' && warn(
  27231. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  27232. 'Always create fresh vnode data objects in each render!',
  27233. context
  27234. );
  27235. return createEmptyVNode()
  27236. }
  27237. if (!tag) {
  27238. // in case of component :is set to falsy value
  27239. return createEmptyVNode()
  27240. }
  27241. // support single function children as default scoped slot
  27242. if (Array.isArray(children) &&
  27243. typeof children[0] === 'function') {
  27244. data = data || {};
  27245. data.scopedSlots = { default: children[0] };
  27246. children.length = 0;
  27247. }
  27248. if (normalizationType === ALWAYS_NORMALIZE) {
  27249. children = normalizeChildren(children);
  27250. } else if (normalizationType === SIMPLE_NORMALIZE) {
  27251. children = simpleNormalizeChildren(children);
  27252. }
  27253. var vnode, ns;
  27254. if (typeof tag === 'string') {
  27255. var Ctor;
  27256. ns = config.getTagNamespace(tag);
  27257. if (config.isReservedTag(tag)) {
  27258. // platform built-in elements
  27259. vnode = new VNode(
  27260. config.parsePlatformTagName(tag), data, children,
  27261. undefined, undefined, context
  27262. );
  27263. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  27264. // component
  27265. vnode = createComponent(Ctor, data, context, children, tag);
  27266. } else {
  27267. // unknown or unlisted namespaced elements
  27268. // check at runtime because it may get assigned a namespace when its
  27269. // parent normalizes children
  27270. vnode = new VNode(
  27271. tag, data, children,
  27272. undefined, undefined, context
  27273. );
  27274. }
  27275. } else {
  27276. // direct component options / constructor
  27277. vnode = createComponent(tag, data, context, children);
  27278. }
  27279. if (vnode) {
  27280. if (ns) { applyNS(vnode, ns); }
  27281. return vnode
  27282. } else {
  27283. return createEmptyVNode()
  27284. }
  27285. }
  27286. function applyNS (vnode, ns) {
  27287. vnode.ns = ns;
  27288. if (vnode.tag === 'foreignObject') {
  27289. // use default namespace inside foreignObject
  27290. return
  27291. }
  27292. if (vnode.children) {
  27293. for (var i = 0, l = vnode.children.length; i < l; i++) {
  27294. var child = vnode.children[i];
  27295. if (child.tag && !child.ns) {
  27296. applyNS(child, ns);
  27297. }
  27298. }
  27299. }
  27300. }
  27301. /* */
  27302. function initRender (vm) {
  27303. vm.$vnode = null; // the placeholder node in parent tree
  27304. vm._vnode = null; // the root of the child tree
  27305. vm._staticTrees = null;
  27306. var parentVnode = vm.$options._parentVnode;
  27307. var renderContext = parentVnode && parentVnode.context;
  27308. vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
  27309. vm.$scopedSlots = {};
  27310. // bind the createElement fn to this instance
  27311. // so that we get proper render context inside it.
  27312. // args order: tag, data, children, normalizationType, alwaysNormalize
  27313. // internal version is used by render functions compiled from templates
  27314. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  27315. // normalization is always applied for the public version, used in
  27316. // user-written render functions.
  27317. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  27318. }
  27319. function renderMixin (Vue) {
  27320. Vue.prototype.$nextTick = function (fn) {
  27321. return nextTick(fn, this)
  27322. };
  27323. Vue.prototype._render = function () {
  27324. var vm = this;
  27325. var ref = vm.$options;
  27326. var render = ref.render;
  27327. var staticRenderFns = ref.staticRenderFns;
  27328. var _parentVnode = ref._parentVnode;
  27329. if (vm._isMounted) {
  27330. // clone slot nodes on re-renders
  27331. for (var key in vm.$slots) {
  27332. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  27333. }
  27334. }
  27335. if (_parentVnode && _parentVnode.data.scopedSlots) {
  27336. vm.$scopedSlots = _parentVnode.data.scopedSlots;
  27337. }
  27338. if (staticRenderFns && !vm._staticTrees) {
  27339. vm._staticTrees = [];
  27340. }
  27341. // set parent vnode. this allows render functions to have access
  27342. // to the data on the placeholder node.
  27343. vm.$vnode = _parentVnode;
  27344. // render self
  27345. var vnode;
  27346. try {
  27347. vnode = render.call(vm._renderProxy, vm.$createElement);
  27348. } catch (e) {
  27349. /* istanbul ignore else */
  27350. if (config.errorHandler) {
  27351. config.errorHandler.call(null, e, vm);
  27352. } else {
  27353. if (process.env.NODE_ENV !== 'production') {
  27354. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  27355. }
  27356. throw e
  27357. }
  27358. // return previous vnode to prevent render error causing blank component
  27359. vnode = vm._vnode;
  27360. }
  27361. // return empty vnode in case the render function errored out
  27362. if (!(vnode instanceof VNode)) {
  27363. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  27364. warn(
  27365. 'Multiple root nodes returned from render function. Render function ' +
  27366. 'should return a single root node.',
  27367. vm
  27368. );
  27369. }
  27370. vnode = createEmptyVNode();
  27371. }
  27372. // set parent
  27373. vnode.parent = _parentVnode;
  27374. return vnode
  27375. };
  27376. // toString for mustaches
  27377. Vue.prototype._s = _toString;
  27378. // convert text to vnode
  27379. Vue.prototype._v = createTextVNode;
  27380. // number conversion
  27381. Vue.prototype._n = toNumber;
  27382. // empty vnode
  27383. Vue.prototype._e = createEmptyVNode;
  27384. // loose equal
  27385. Vue.prototype._q = looseEqual;
  27386. // loose indexOf
  27387. Vue.prototype._i = looseIndexOf;
  27388. // render static tree by index
  27389. Vue.prototype._m = function renderStatic (
  27390. index,
  27391. isInFor
  27392. ) {
  27393. var tree = this._staticTrees[index];
  27394. // if has already-rendered static tree and not inside v-for,
  27395. // we can reuse the same tree by doing a shallow clone.
  27396. if (tree && !isInFor) {
  27397. return Array.isArray(tree)
  27398. ? cloneVNodes(tree)
  27399. : cloneVNode(tree)
  27400. }
  27401. // otherwise, render a fresh tree.
  27402. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  27403. markStatic(tree, ("__static__" + index), false);
  27404. return tree
  27405. };
  27406. // mark node as static (v-once)
  27407. Vue.prototype._o = function markOnce (
  27408. tree,
  27409. index,
  27410. key
  27411. ) {
  27412. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  27413. return tree
  27414. };
  27415. function markStatic (tree, key, isOnce) {
  27416. if (Array.isArray(tree)) {
  27417. for (var i = 0; i < tree.length; i++) {
  27418. if (tree[i] && typeof tree[i] !== 'string') {
  27419. markStaticNode(tree[i], (key + "_" + i), isOnce);
  27420. }
  27421. }
  27422. } else {
  27423. markStaticNode(tree, key, isOnce);
  27424. }
  27425. }
  27426. function markStaticNode (node, key, isOnce) {
  27427. node.isStatic = true;
  27428. node.key = key;
  27429. node.isOnce = isOnce;
  27430. }
  27431. // filter resolution helper
  27432. Vue.prototype._f = function resolveFilter (id) {
  27433. return resolveAsset(this.$options, 'filters', id, true) || identity
  27434. };
  27435. // render v-for
  27436. Vue.prototype._l = function renderList (
  27437. val,
  27438. render
  27439. ) {
  27440. var ret, i, l, keys, key;
  27441. if (Array.isArray(val) || typeof val === 'string') {
  27442. ret = new Array(val.length);
  27443. for (i = 0, l = val.length; i < l; i++) {
  27444. ret[i] = render(val[i], i);
  27445. }
  27446. } else if (typeof val === 'number') {
  27447. ret = new Array(val);
  27448. for (i = 0; i < val; i++) {
  27449. ret[i] = render(i + 1, i);
  27450. }
  27451. } else if (isObject(val)) {
  27452. keys = Object.keys(val);
  27453. ret = new Array(keys.length);
  27454. for (i = 0, l = keys.length; i < l; i++) {
  27455. key = keys[i];
  27456. ret[i] = render(val[key], key, i);
  27457. }
  27458. }
  27459. return ret
  27460. };
  27461. // renderSlot
  27462. Vue.prototype._t = function (
  27463. name,
  27464. fallback,
  27465. props,
  27466. bindObject
  27467. ) {
  27468. var scopedSlotFn = this.$scopedSlots[name];
  27469. if (scopedSlotFn) { // scoped slot
  27470. props = props || {};
  27471. if (bindObject) {
  27472. extend(props, bindObject);
  27473. }
  27474. return scopedSlotFn(props) || fallback
  27475. } else {
  27476. var slotNodes = this.$slots[name];
  27477. // warn duplicate slot usage
  27478. if (slotNodes && process.env.NODE_ENV !== 'production') {
  27479. slotNodes._rendered && warn(
  27480. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  27481. "- this will likely cause render errors.",
  27482. this
  27483. );
  27484. slotNodes._rendered = true;
  27485. }
  27486. return slotNodes || fallback
  27487. }
  27488. };
  27489. // apply v-bind object
  27490. Vue.prototype._b = function bindProps (
  27491. data,
  27492. tag,
  27493. value,
  27494. asProp
  27495. ) {
  27496. if (value) {
  27497. if (!isObject(value)) {
  27498. process.env.NODE_ENV !== 'production' && warn(
  27499. 'v-bind without argument expects an Object or Array value',
  27500. this
  27501. );
  27502. } else {
  27503. if (Array.isArray(value)) {
  27504. value = toObject(value);
  27505. }
  27506. for (var key in value) {
  27507. if (key === 'class' || key === 'style') {
  27508. data[key] = value[key];
  27509. } else {
  27510. var type = data.attrs && data.attrs.type;
  27511. var hash = asProp || config.mustUseProp(tag, type, key)
  27512. ? data.domProps || (data.domProps = {})
  27513. : data.attrs || (data.attrs = {});
  27514. hash[key] = value[key];
  27515. }
  27516. }
  27517. }
  27518. }
  27519. return data
  27520. };
  27521. // check v-on keyCodes
  27522. Vue.prototype._k = function checkKeyCodes (
  27523. eventKeyCode,
  27524. key,
  27525. builtInAlias
  27526. ) {
  27527. var keyCodes = config.keyCodes[key] || builtInAlias;
  27528. if (Array.isArray(keyCodes)) {
  27529. return keyCodes.indexOf(eventKeyCode) === -1
  27530. } else {
  27531. return keyCodes !== eventKeyCode
  27532. }
  27533. };
  27534. }
  27535. function resolveSlots (
  27536. children,
  27537. context
  27538. ) {
  27539. var slots = {};
  27540. if (!children) {
  27541. return slots
  27542. }
  27543. var defaultSlot = [];
  27544. var name, child;
  27545. for (var i = 0, l = children.length; i < l; i++) {
  27546. child = children[i];
  27547. // named slots should only be respected if the vnode was rendered in the
  27548. // same context.
  27549. if ((child.context === context || child.functionalContext === context) &&
  27550. child.data && (name = child.data.slot)) {
  27551. var slot = (slots[name] || (slots[name] = []));
  27552. if (child.tag === 'template') {
  27553. slot.push.apply(slot, child.children);
  27554. } else {
  27555. slot.push(child);
  27556. }
  27557. } else {
  27558. defaultSlot.push(child);
  27559. }
  27560. }
  27561. // ignore single whitespace
  27562. if (defaultSlot.length && !(
  27563. defaultSlot.length === 1 &&
  27564. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  27565. )) {
  27566. slots.default = defaultSlot;
  27567. }
  27568. return slots
  27569. }
  27570. /* */
  27571. function initEvents (vm) {
  27572. vm._events = Object.create(null);
  27573. vm._hasHookEvent = false;
  27574. // init parent attached events
  27575. var listeners = vm.$options._parentListeners;
  27576. if (listeners) {
  27577. updateComponentListeners(vm, listeners);
  27578. }
  27579. }
  27580. var target;
  27581. function add$1 (event, fn, once) {
  27582. if (once) {
  27583. target.$once(event, fn);
  27584. } else {
  27585. target.$on(event, fn);
  27586. }
  27587. }
  27588. function remove$2 (event, fn) {
  27589. target.$off(event, fn);
  27590. }
  27591. function updateComponentListeners (
  27592. vm,
  27593. listeners,
  27594. oldListeners
  27595. ) {
  27596. target = vm;
  27597. updateListeners(listeners, oldListeners || {}, add$1, remove$2, vm);
  27598. }
  27599. function eventsMixin (Vue) {
  27600. var hookRE = /^hook:/;
  27601. Vue.prototype.$on = function (event, fn) {
  27602. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  27603. // optimize hook:event cost by using a boolean flag marked at registration
  27604. // instead of a hash lookup
  27605. if (hookRE.test(event)) {
  27606. vm._hasHookEvent = true;
  27607. }
  27608. return vm
  27609. };
  27610. Vue.prototype.$once = function (event, fn) {
  27611. var vm = this;
  27612. function on () {
  27613. vm.$off(event, on);
  27614. fn.apply(vm, arguments);
  27615. }
  27616. on.fn = fn;
  27617. vm.$on(event, on);
  27618. return vm
  27619. };
  27620. Vue.prototype.$off = function (event, fn) {
  27621. var vm = this;
  27622. // all
  27623. if (!arguments.length) {
  27624. vm._events = Object.create(null);
  27625. return vm
  27626. }
  27627. // specific event
  27628. var cbs = vm._events[event];
  27629. if (!cbs) {
  27630. return vm
  27631. }
  27632. if (arguments.length === 1) {
  27633. vm._events[event] = null;
  27634. return vm
  27635. }
  27636. // specific handler
  27637. var cb;
  27638. var i = cbs.length;
  27639. while (i--) {
  27640. cb = cbs[i];
  27641. if (cb === fn || cb.fn === fn) {
  27642. cbs.splice(i, 1);
  27643. break
  27644. }
  27645. }
  27646. return vm
  27647. };
  27648. Vue.prototype.$emit = function (event) {
  27649. var vm = this;
  27650. var cbs = vm._events[event];
  27651. if (cbs) {
  27652. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  27653. var args = toArray(arguments, 1);
  27654. for (var i = 0, l = cbs.length; i < l; i++) {
  27655. cbs[i].apply(vm, args);
  27656. }
  27657. }
  27658. return vm
  27659. };
  27660. }
  27661. /* */
  27662. var activeInstance = null;
  27663. function initLifecycle (vm) {
  27664. var options = vm.$options;
  27665. // locate first non-abstract parent
  27666. var parent = options.parent;
  27667. if (parent && !options.abstract) {
  27668. while (parent.$options.abstract && parent.$parent) {
  27669. parent = parent.$parent;
  27670. }
  27671. parent.$children.push(vm);
  27672. }
  27673. vm.$parent = parent;
  27674. vm.$root = parent ? parent.$root : vm;
  27675. vm.$children = [];
  27676. vm.$refs = {};
  27677. vm._watcher = null;
  27678. vm._inactive = false;
  27679. vm._isMounted = false;
  27680. vm._isDestroyed = false;
  27681. vm._isBeingDestroyed = false;
  27682. }
  27683. function lifecycleMixin (Vue) {
  27684. Vue.prototype._mount = function (
  27685. el,
  27686. hydrating
  27687. ) {
  27688. var vm = this;
  27689. vm.$el = el;
  27690. if (!vm.$options.render) {
  27691. vm.$options.render = createEmptyVNode;
  27692. if (process.env.NODE_ENV !== 'production') {
  27693. /* istanbul ignore if */
  27694. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  27695. warn(
  27696. 'You are using the runtime-only build of Vue where the template ' +
  27697. 'option is not available. Either pre-compile the templates into ' +
  27698. 'render functions, or use the compiler-included build.',
  27699. vm
  27700. );
  27701. } else {
  27702. warn(
  27703. 'Failed to mount component: template or render function not defined.',
  27704. vm
  27705. );
  27706. }
  27707. }
  27708. }
  27709. callHook(vm, 'beforeMount');
  27710. vm._watcher = new Watcher(vm, function updateComponent () {
  27711. vm._update(vm._render(), hydrating);
  27712. }, noop);
  27713. hydrating = false;
  27714. // manually mounted instance, call mounted on self
  27715. // mounted is called for render-created child components in its inserted hook
  27716. if (vm.$vnode == null) {
  27717. vm._isMounted = true;
  27718. callHook(vm, 'mounted');
  27719. }
  27720. return vm
  27721. };
  27722. Vue.prototype._update = function (vnode, hydrating) {
  27723. var vm = this;
  27724. if (vm._isMounted) {
  27725. callHook(vm, 'beforeUpdate');
  27726. }
  27727. var prevEl = vm.$el;
  27728. var prevVnode = vm._vnode;
  27729. var prevActiveInstance = activeInstance;
  27730. activeInstance = vm;
  27731. vm._vnode = vnode;
  27732. // Vue.prototype.__patch__ is injected in entry points
  27733. // based on the rendering backend used.
  27734. if (!prevVnode) {
  27735. // initial render
  27736. vm.$el = vm.__patch__(
  27737. vm.$el, vnode, hydrating, false /* removeOnly */,
  27738. vm.$options._parentElm,
  27739. vm.$options._refElm
  27740. );
  27741. } else {
  27742. // updates
  27743. vm.$el = vm.__patch__(prevVnode, vnode);
  27744. }
  27745. activeInstance = prevActiveInstance;
  27746. // update __vue__ reference
  27747. if (prevEl) {
  27748. prevEl.__vue__ = null;
  27749. }
  27750. if (vm.$el) {
  27751. vm.$el.__vue__ = vm;
  27752. }
  27753. // if parent is an HOC, update its $el as well
  27754. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  27755. vm.$parent.$el = vm.$el;
  27756. }
  27757. // updated hook is called by the scheduler to ensure that children are
  27758. // updated in a parent's updated hook.
  27759. };
  27760. Vue.prototype._updateFromParent = function (
  27761. propsData,
  27762. listeners,
  27763. parentVnode,
  27764. renderChildren
  27765. ) {
  27766. var vm = this;
  27767. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  27768. vm.$options._parentVnode = parentVnode;
  27769. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  27770. if (vm._vnode) { // update child tree's parent
  27771. vm._vnode.parent = parentVnode;
  27772. }
  27773. vm.$options._renderChildren = renderChildren;
  27774. // update props
  27775. if (propsData && vm.$options.props) {
  27776. observerState.shouldConvert = false;
  27777. if (process.env.NODE_ENV !== 'production') {
  27778. observerState.isSettingProps = true;
  27779. }
  27780. var propKeys = vm.$options._propKeys || [];
  27781. for (var i = 0; i < propKeys.length; i++) {
  27782. var key = propKeys[i];
  27783. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  27784. }
  27785. observerState.shouldConvert = true;
  27786. if (process.env.NODE_ENV !== 'production') {
  27787. observerState.isSettingProps = false;
  27788. }
  27789. vm.$options.propsData = propsData;
  27790. }
  27791. // update listeners
  27792. if (listeners) {
  27793. var oldListeners = vm.$options._parentListeners;
  27794. vm.$options._parentListeners = listeners;
  27795. updateComponentListeners(vm, listeners, oldListeners);
  27796. }
  27797. // resolve slots + force update if has children
  27798. if (hasChildren) {
  27799. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  27800. vm.$forceUpdate();
  27801. }
  27802. };
  27803. Vue.prototype.$forceUpdate = function () {
  27804. var vm = this;
  27805. if (vm._watcher) {
  27806. vm._watcher.update();
  27807. }
  27808. };
  27809. Vue.prototype.$destroy = function () {
  27810. var vm = this;
  27811. if (vm._isBeingDestroyed) {
  27812. return
  27813. }
  27814. callHook(vm, 'beforeDestroy');
  27815. vm._isBeingDestroyed = true;
  27816. // remove self from parent
  27817. var parent = vm.$parent;
  27818. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  27819. remove$1(parent.$children, vm);
  27820. }
  27821. // teardown watchers
  27822. if (vm._watcher) {
  27823. vm._watcher.teardown();
  27824. }
  27825. var i = vm._watchers.length;
  27826. while (i--) {
  27827. vm._watchers[i].teardown();
  27828. }
  27829. // remove reference from data ob
  27830. // frozen object may not have observer.
  27831. if (vm._data.__ob__) {
  27832. vm._data.__ob__.vmCount--;
  27833. }
  27834. // call the last hook...
  27835. vm._isDestroyed = true;
  27836. callHook(vm, 'destroyed');
  27837. // turn off all instance listeners.
  27838. vm.$off();
  27839. // remove __vue__ reference
  27840. if (vm.$el) {
  27841. vm.$el.__vue__ = null;
  27842. }
  27843. // invoke destroy hooks on current rendered tree
  27844. vm.__patch__(vm._vnode, null);
  27845. };
  27846. }
  27847. function callHook (vm, hook) {
  27848. var handlers = vm.$options[hook];
  27849. if (handlers) {
  27850. for (var i = 0, j = handlers.length; i < j; i++) {
  27851. handlers[i].call(vm);
  27852. }
  27853. }
  27854. if (vm._hasHookEvent) {
  27855. vm.$emit('hook:' + hook);
  27856. }
  27857. }
  27858. /* */
  27859. var queue = [];
  27860. var has$1 = {};
  27861. var circular = {};
  27862. var waiting = false;
  27863. var flushing = false;
  27864. var index = 0;
  27865. /**
  27866. * Reset the scheduler's state.
  27867. */
  27868. function resetSchedulerState () {
  27869. queue.length = 0;
  27870. has$1 = {};
  27871. if (process.env.NODE_ENV !== 'production') {
  27872. circular = {};
  27873. }
  27874. waiting = flushing = false;
  27875. }
  27876. /**
  27877. * Flush both queues and run the watchers.
  27878. */
  27879. function flushSchedulerQueue () {
  27880. flushing = true;
  27881. var watcher, id, vm;
  27882. // Sort queue before flush.
  27883. // This ensures that:
  27884. // 1. Components are updated from parent to child. (because parent is always
  27885. // created before the child)
  27886. // 2. A component's user watchers are run before its render watcher (because
  27887. // user watchers are created before the render watcher)
  27888. // 3. If a component is destroyed during a parent component's watcher run,
  27889. // its watchers can be skipped.
  27890. queue.sort(function (a, b) { return a.id - b.id; });
  27891. // do not cache length because more watchers might be pushed
  27892. // as we run existing watchers
  27893. for (index = 0; index < queue.length; index++) {
  27894. watcher = queue[index];
  27895. id = watcher.id;
  27896. has$1[id] = null;
  27897. watcher.run();
  27898. // in dev build, check and stop circular updates.
  27899. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  27900. circular[id] = (circular[id] || 0) + 1;
  27901. if (circular[id] > config._maxUpdateCount) {
  27902. warn(
  27903. 'You may have an infinite update loop ' + (
  27904. watcher.user
  27905. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  27906. : "in a component render function."
  27907. ),
  27908. watcher.vm
  27909. );
  27910. break
  27911. }
  27912. }
  27913. }
  27914. // call updated hooks
  27915. index = queue.length;
  27916. while (index--) {
  27917. watcher = queue[index];
  27918. vm = watcher.vm;
  27919. if (vm._watcher === watcher && vm._isMounted) {
  27920. callHook(vm, 'updated');
  27921. }
  27922. }
  27923. // devtool hook
  27924. /* istanbul ignore if */
  27925. if (devtools && config.devtools) {
  27926. devtools.emit('flush');
  27927. }
  27928. resetSchedulerState();
  27929. }
  27930. /**
  27931. * Push a watcher into the watcher queue.
  27932. * Jobs with duplicate IDs will be skipped unless it's
  27933. * pushed when the queue is being flushed.
  27934. */
  27935. function queueWatcher (watcher) {
  27936. var id = watcher.id;
  27937. if (has$1[id] == null) {
  27938. has$1[id] = true;
  27939. if (!flushing) {
  27940. queue.push(watcher);
  27941. } else {
  27942. // if already flushing, splice the watcher based on its id
  27943. // if already past its id, it will be run next immediately.
  27944. var i = queue.length - 1;
  27945. while (i >= 0 && queue[i].id > watcher.id) {
  27946. i--;
  27947. }
  27948. queue.splice(Math.max(i, index) + 1, 0, watcher);
  27949. }
  27950. // queue the flush
  27951. if (!waiting) {
  27952. waiting = true;
  27953. nextTick(flushSchedulerQueue);
  27954. }
  27955. }
  27956. }
  27957. /* */
  27958. var uid$2 = 0;
  27959. /**
  27960. * A watcher parses an expression, collects dependencies,
  27961. * and fires callback when the expression value changes.
  27962. * This is used for both the $watch() api and directives.
  27963. */
  27964. var Watcher = function Watcher (
  27965. vm,
  27966. expOrFn,
  27967. cb,
  27968. options
  27969. ) {
  27970. this.vm = vm;
  27971. vm._watchers.push(this);
  27972. // options
  27973. if (options) {
  27974. this.deep = !!options.deep;
  27975. this.user = !!options.user;
  27976. this.lazy = !!options.lazy;
  27977. this.sync = !!options.sync;
  27978. } else {
  27979. this.deep = this.user = this.lazy = this.sync = false;
  27980. }
  27981. this.cb = cb;
  27982. this.id = ++uid$2; // uid for batching
  27983. this.active = true;
  27984. this.dirty = this.lazy; // for lazy watchers
  27985. this.deps = [];
  27986. this.newDeps = [];
  27987. this.depIds = new _Set();
  27988. this.newDepIds = new _Set();
  27989. this.expression = process.env.NODE_ENV !== 'production'
  27990. ? expOrFn.toString()
  27991. : '';
  27992. // parse expression for getter
  27993. if (typeof expOrFn === 'function') {
  27994. this.getter = expOrFn;
  27995. } else {
  27996. this.getter = parsePath(expOrFn);
  27997. if (!this.getter) {
  27998. this.getter = function () {};
  27999. process.env.NODE_ENV !== 'production' && warn(
  28000. "Failed watching path: \"" + expOrFn + "\" " +
  28001. 'Watcher only accepts simple dot-delimited paths. ' +
  28002. 'For full control, use a function instead.',
  28003. vm
  28004. );
  28005. }
  28006. }
  28007. this.value = this.lazy
  28008. ? undefined
  28009. : this.get();
  28010. };
  28011. /**
  28012. * Evaluate the getter, and re-collect dependencies.
  28013. */
  28014. Watcher.prototype.get = function get () {
  28015. pushTarget(this);
  28016. var value = this.getter.call(this.vm, this.vm);
  28017. // "touch" every property so they are all tracked as
  28018. // dependencies for deep watching
  28019. if (this.deep) {
  28020. traverse(value);
  28021. }
  28022. popTarget();
  28023. this.cleanupDeps();
  28024. return value
  28025. };
  28026. /**
  28027. * Add a dependency to this directive.
  28028. */
  28029. Watcher.prototype.addDep = function addDep (dep) {
  28030. var id = dep.id;
  28031. if (!this.newDepIds.has(id)) {
  28032. this.newDepIds.add(id);
  28033. this.newDeps.push(dep);
  28034. if (!this.depIds.has(id)) {
  28035. dep.addSub(this);
  28036. }
  28037. }
  28038. };
  28039. /**
  28040. * Clean up for dependency collection.
  28041. */
  28042. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  28043. var this$1 = this;
  28044. var i = this.deps.length;
  28045. while (i--) {
  28046. var dep = this$1.deps[i];
  28047. if (!this$1.newDepIds.has(dep.id)) {
  28048. dep.removeSub(this$1);
  28049. }
  28050. }
  28051. var tmp = this.depIds;
  28052. this.depIds = this.newDepIds;
  28053. this.newDepIds = tmp;
  28054. this.newDepIds.clear();
  28055. tmp = this.deps;
  28056. this.deps = this.newDeps;
  28057. this.newDeps = tmp;
  28058. this.newDeps.length = 0;
  28059. };
  28060. /**
  28061. * Subscriber interface.
  28062. * Will be called when a dependency changes.
  28063. */
  28064. Watcher.prototype.update = function update () {
  28065. /* istanbul ignore else */
  28066. if (this.lazy) {
  28067. this.dirty = true;
  28068. } else if (this.sync) {
  28069. this.run();
  28070. } else {
  28071. queueWatcher(this);
  28072. }
  28073. };
  28074. /**
  28075. * Scheduler job interface.
  28076. * Will be called by the scheduler.
  28077. */
  28078. Watcher.prototype.run = function run () {
  28079. if (this.active) {
  28080. var value = this.get();
  28081. if (
  28082. value !== this.value ||
  28083. // Deep watchers and watchers on Object/Arrays should fire even
  28084. // when the value is the same, because the value may
  28085. // have mutated.
  28086. isObject(value) ||
  28087. this.deep
  28088. ) {
  28089. // set new value
  28090. var oldValue = this.value;
  28091. this.value = value;
  28092. if (this.user) {
  28093. try {
  28094. this.cb.call(this.vm, value, oldValue);
  28095. } catch (e) {
  28096. /* istanbul ignore else */
  28097. if (config.errorHandler) {
  28098. config.errorHandler.call(null, e, this.vm);
  28099. } else {
  28100. process.env.NODE_ENV !== 'production' && warn(
  28101. ("Error in watcher \"" + (this.expression) + "\""),
  28102. this.vm
  28103. );
  28104. throw e
  28105. }
  28106. }
  28107. } else {
  28108. this.cb.call(this.vm, value, oldValue);
  28109. }
  28110. }
  28111. }
  28112. };
  28113. /**
  28114. * Evaluate the value of the watcher.
  28115. * This only gets called for lazy watchers.
  28116. */
  28117. Watcher.prototype.evaluate = function evaluate () {
  28118. this.value = this.get();
  28119. this.dirty = false;
  28120. };
  28121. /**
  28122. * Depend on all deps collected by this watcher.
  28123. */
  28124. Watcher.prototype.depend = function depend () {
  28125. var this$1 = this;
  28126. var i = this.deps.length;
  28127. while (i--) {
  28128. this$1.deps[i].depend();
  28129. }
  28130. };
  28131. /**
  28132. * Remove self from all dependencies' subscriber list.
  28133. */
  28134. Watcher.prototype.teardown = function teardown () {
  28135. var this$1 = this;
  28136. if (this.active) {
  28137. // remove self from vm's watcher list
  28138. // this is a somewhat expensive operation so we skip it
  28139. // if the vm is being destroyed.
  28140. if (!this.vm._isBeingDestroyed) {
  28141. remove$1(this.vm._watchers, this);
  28142. }
  28143. var i = this.deps.length;
  28144. while (i--) {
  28145. this$1.deps[i].removeSub(this$1);
  28146. }
  28147. this.active = false;
  28148. }
  28149. };
  28150. /**
  28151. * Recursively traverse an object to evoke all converted
  28152. * getters, so that every nested property inside the object
  28153. * is collected as a "deep" dependency.
  28154. */
  28155. var seenObjects = new _Set();
  28156. function traverse (val) {
  28157. seenObjects.clear();
  28158. _traverse(val, seenObjects);
  28159. }
  28160. function _traverse (val, seen) {
  28161. var i, keys;
  28162. var isA = Array.isArray(val);
  28163. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  28164. return
  28165. }
  28166. if (val.__ob__) {
  28167. var depId = val.__ob__.dep.id;
  28168. if (seen.has(depId)) {
  28169. return
  28170. }
  28171. seen.add(depId);
  28172. }
  28173. if (isA) {
  28174. i = val.length;
  28175. while (i--) { _traverse(val[i], seen); }
  28176. } else {
  28177. keys = Object.keys(val);
  28178. i = keys.length;
  28179. while (i--) { _traverse(val[keys[i]], seen); }
  28180. }
  28181. }
  28182. /* */
  28183. function initState (vm) {
  28184. vm._watchers = [];
  28185. var opts = vm.$options;
  28186. if (opts.props) { initProps(vm, opts.props); }
  28187. if (opts.methods) { initMethods(vm, opts.methods); }
  28188. if (opts.data) {
  28189. initData(vm);
  28190. } else {
  28191. observe(vm._data = {}, true /* asRootData */);
  28192. }
  28193. if (opts.computed) { initComputed(vm, opts.computed); }
  28194. if (opts.watch) { initWatch(vm, opts.watch); }
  28195. }
  28196. var isReservedProp = { key: 1, ref: 1, slot: 1 };
  28197. function initProps (vm, props) {
  28198. var propsData = vm.$options.propsData || {};
  28199. var keys = vm.$options._propKeys = Object.keys(props);
  28200. var isRoot = !vm.$parent;
  28201. // root instance props should be converted
  28202. observerState.shouldConvert = isRoot;
  28203. var loop = function ( i ) {
  28204. var key = keys[i];
  28205. /* istanbul ignore else */
  28206. if (process.env.NODE_ENV !== 'production') {
  28207. if (isReservedProp[key]) {
  28208. warn(
  28209. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  28210. vm
  28211. );
  28212. }
  28213. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  28214. if (vm.$parent && !observerState.isSettingProps) {
  28215. warn(
  28216. "Avoid mutating a prop directly since the value will be " +
  28217. "overwritten whenever the parent component re-renders. " +
  28218. "Instead, use a data or computed property based on the prop's " +
  28219. "value. Prop being mutated: \"" + key + "\"",
  28220. vm
  28221. );
  28222. }
  28223. });
  28224. } else {
  28225. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  28226. }
  28227. };
  28228. for (var i = 0; i < keys.length; i++) loop( i );
  28229. observerState.shouldConvert = true;
  28230. }
  28231. function initData (vm) {
  28232. var data = vm.$options.data;
  28233. data = vm._data = typeof data === 'function'
  28234. ? data.call(vm)
  28235. : data || {};
  28236. if (!isPlainObject(data)) {
  28237. data = {};
  28238. process.env.NODE_ENV !== 'production' && warn(
  28239. 'data functions should return an object:\n' +
  28240. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  28241. vm
  28242. );
  28243. }
  28244. // proxy data on instance
  28245. var keys = Object.keys(data);
  28246. var props = vm.$options.props;
  28247. var i = keys.length;
  28248. while (i--) {
  28249. if (props && hasOwn(props, keys[i])) {
  28250. process.env.NODE_ENV !== 'production' && warn(
  28251. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  28252. "Use prop default value instead.",
  28253. vm
  28254. );
  28255. } else {
  28256. proxy(vm, keys[i]);
  28257. }
  28258. }
  28259. // observe data
  28260. observe(data, true /* asRootData */);
  28261. }
  28262. var computedSharedDefinition = {
  28263. enumerable: true,
  28264. configurable: true,
  28265. get: noop,
  28266. set: noop
  28267. };
  28268. function initComputed (vm, computed) {
  28269. for (var key in computed) {
  28270. /* istanbul ignore if */
  28271. if (process.env.NODE_ENV !== 'production' && key in vm) {
  28272. warn(
  28273. "existing instance property \"" + key + "\" will be " +
  28274. "overwritten by a computed property with the same name.",
  28275. vm
  28276. );
  28277. }
  28278. var userDef = computed[key];
  28279. if (typeof userDef === 'function') {
  28280. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  28281. computedSharedDefinition.set = noop;
  28282. } else {
  28283. computedSharedDefinition.get = userDef.get
  28284. ? userDef.cache !== false
  28285. ? makeComputedGetter(userDef.get, vm)
  28286. : bind$1(userDef.get, vm)
  28287. : noop;
  28288. computedSharedDefinition.set = userDef.set
  28289. ? bind$1(userDef.set, vm)
  28290. : noop;
  28291. }
  28292. Object.defineProperty(vm, key, computedSharedDefinition);
  28293. }
  28294. }
  28295. function makeComputedGetter (getter, owner) {
  28296. var watcher = new Watcher(owner, getter, noop, {
  28297. lazy: true
  28298. });
  28299. return function computedGetter () {
  28300. if (watcher.dirty) {
  28301. watcher.evaluate();
  28302. }
  28303. if (Dep.target) {
  28304. watcher.depend();
  28305. }
  28306. return watcher.value
  28307. }
  28308. }
  28309. function initMethods (vm, methods) {
  28310. for (var key in methods) {
  28311. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  28312. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  28313. warn(
  28314. "method \"" + key + "\" has an undefined value in the component definition. " +
  28315. "Did you reference the function correctly?",
  28316. vm
  28317. );
  28318. }
  28319. }
  28320. }
  28321. function initWatch (vm, watch) {
  28322. for (var key in watch) {
  28323. var handler = watch[key];
  28324. if (Array.isArray(handler)) {
  28325. for (var i = 0; i < handler.length; i++) {
  28326. createWatcher(vm, key, handler[i]);
  28327. }
  28328. } else {
  28329. createWatcher(vm, key, handler);
  28330. }
  28331. }
  28332. }
  28333. function createWatcher (vm, key, handler) {
  28334. var options;
  28335. if (isPlainObject(handler)) {
  28336. options = handler;
  28337. handler = handler.handler;
  28338. }
  28339. if (typeof handler === 'string') {
  28340. handler = vm[handler];
  28341. }
  28342. vm.$watch(key, handler, options);
  28343. }
  28344. function stateMixin (Vue) {
  28345. // flow somehow has problems with directly declared definition object
  28346. // when using Object.defineProperty, so we have to procedurally build up
  28347. // the object here.
  28348. var dataDef = {};
  28349. dataDef.get = function () {
  28350. return this._data
  28351. };
  28352. if (process.env.NODE_ENV !== 'production') {
  28353. dataDef.set = function (newData) {
  28354. warn(
  28355. 'Avoid replacing instance root $data. ' +
  28356. 'Use nested data properties instead.',
  28357. this
  28358. );
  28359. };
  28360. }
  28361. Object.defineProperty(Vue.prototype, '$data', dataDef);
  28362. Vue.prototype.$set = set$1;
  28363. Vue.prototype.$delete = del;
  28364. Vue.prototype.$watch = function (
  28365. expOrFn,
  28366. cb,
  28367. options
  28368. ) {
  28369. var vm = this;
  28370. options = options || {};
  28371. options.user = true;
  28372. var watcher = new Watcher(vm, expOrFn, cb, options);
  28373. if (options.immediate) {
  28374. cb.call(vm, watcher.value);
  28375. }
  28376. return function unwatchFn () {
  28377. watcher.teardown();
  28378. }
  28379. };
  28380. }
  28381. function proxy (vm, key) {
  28382. if (!isReserved(key)) {
  28383. Object.defineProperty(vm, key, {
  28384. configurable: true,
  28385. enumerable: true,
  28386. get: function proxyGetter () {
  28387. return vm._data[key]
  28388. },
  28389. set: function proxySetter (val) {
  28390. vm._data[key] = val;
  28391. }
  28392. });
  28393. }
  28394. }
  28395. /* */
  28396. var uid = 0;
  28397. function initMixin (Vue) {
  28398. Vue.prototype._init = function (options) {
  28399. var vm = this;
  28400. // a uid
  28401. vm._uid = uid++;
  28402. // a flag to avoid this being observed
  28403. vm._isVue = true;
  28404. // merge options
  28405. if (options && options._isComponent) {
  28406. // optimize internal component instantiation
  28407. // since dynamic options merging is pretty slow, and none of the
  28408. // internal component options needs special treatment.
  28409. initInternalComponent(vm, options);
  28410. } else {
  28411. vm.$options = mergeOptions(
  28412. resolveConstructorOptions(vm.constructor),
  28413. options || {},
  28414. vm
  28415. );
  28416. }
  28417. /* istanbul ignore else */
  28418. if (process.env.NODE_ENV !== 'production') {
  28419. initProxy(vm);
  28420. } else {
  28421. vm._renderProxy = vm;
  28422. }
  28423. // expose real self
  28424. vm._self = vm;
  28425. initLifecycle(vm);
  28426. initEvents(vm);
  28427. initRender(vm);
  28428. callHook(vm, 'beforeCreate');
  28429. initState(vm);
  28430. callHook(vm, 'created');
  28431. if (vm.$options.el) {
  28432. vm.$mount(vm.$options.el);
  28433. }
  28434. };
  28435. }
  28436. function initInternalComponent (vm, options) {
  28437. var opts = vm.$options = Object.create(vm.constructor.options);
  28438. // doing this because it's faster than dynamic enumeration.
  28439. opts.parent = options.parent;
  28440. opts.propsData = options.propsData;
  28441. opts._parentVnode = options._parentVnode;
  28442. opts._parentListeners = options._parentListeners;
  28443. opts._renderChildren = options._renderChildren;
  28444. opts._componentTag = options._componentTag;
  28445. opts._parentElm = options._parentElm;
  28446. opts._refElm = options._refElm;
  28447. if (options.render) {
  28448. opts.render = options.render;
  28449. opts.staticRenderFns = options.staticRenderFns;
  28450. }
  28451. }
  28452. function resolveConstructorOptions (Ctor) {
  28453. var options = Ctor.options;
  28454. if (Ctor.super) {
  28455. var superOptions = Ctor.super.options;
  28456. var cachedSuperOptions = Ctor.superOptions;
  28457. var extendOptions = Ctor.extendOptions;
  28458. if (superOptions !== cachedSuperOptions) {
  28459. // super option changed
  28460. Ctor.superOptions = superOptions;
  28461. extendOptions.render = options.render;
  28462. extendOptions.staticRenderFns = options.staticRenderFns;
  28463. extendOptions._scopeId = options._scopeId;
  28464. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  28465. if (options.name) {
  28466. options.components[options.name] = Ctor;
  28467. }
  28468. }
  28469. }
  28470. return options
  28471. }
  28472. function Vue$3 (options) {
  28473. if (process.env.NODE_ENV !== 'production' &&
  28474. !(this instanceof Vue$3)) {
  28475. warn('Vue is a constructor and should be called with the `new` keyword');
  28476. }
  28477. this._init(options);
  28478. }
  28479. initMixin(Vue$3);
  28480. stateMixin(Vue$3);
  28481. eventsMixin(Vue$3);
  28482. lifecycleMixin(Vue$3);
  28483. renderMixin(Vue$3);
  28484. /* */
  28485. function initUse (Vue) {
  28486. Vue.use = function (plugin) {
  28487. /* istanbul ignore if */
  28488. if (plugin.installed) {
  28489. return
  28490. }
  28491. // additional parameters
  28492. var args = toArray(arguments, 1);
  28493. args.unshift(this);
  28494. if (typeof plugin.install === 'function') {
  28495. plugin.install.apply(plugin, args);
  28496. } else {
  28497. plugin.apply(null, args);
  28498. }
  28499. plugin.installed = true;
  28500. return this
  28501. };
  28502. }
  28503. /* */
  28504. function initMixin$1 (Vue) {
  28505. Vue.mixin = function (mixin) {
  28506. this.options = mergeOptions(this.options, mixin);
  28507. };
  28508. }
  28509. /* */
  28510. function initExtend (Vue) {
  28511. /**
  28512. * Each instance constructor, including Vue, has a unique
  28513. * cid. This enables us to create wrapped "child
  28514. * constructors" for prototypal inheritance and cache them.
  28515. */
  28516. Vue.cid = 0;
  28517. var cid = 1;
  28518. /**
  28519. * Class inheritance
  28520. */
  28521. Vue.extend = function (extendOptions) {
  28522. extendOptions = extendOptions || {};
  28523. var Super = this;
  28524. var SuperId = Super.cid;
  28525. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  28526. if (cachedCtors[SuperId]) {
  28527. return cachedCtors[SuperId]
  28528. }
  28529. var name = extendOptions.name || Super.options.name;
  28530. if (process.env.NODE_ENV !== 'production') {
  28531. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  28532. warn(
  28533. 'Invalid component name: "' + name + '". Component names ' +
  28534. 'can only contain alphanumeric characters and the hyphen, ' +
  28535. 'and must start with a letter.'
  28536. );
  28537. }
  28538. }
  28539. var Sub = function VueComponent (options) {
  28540. this._init(options);
  28541. };
  28542. Sub.prototype = Object.create(Super.prototype);
  28543. Sub.prototype.constructor = Sub;
  28544. Sub.cid = cid++;
  28545. Sub.options = mergeOptions(
  28546. Super.options,
  28547. extendOptions
  28548. );
  28549. Sub['super'] = Super;
  28550. // allow further extension/mixin/plugin usage
  28551. Sub.extend = Super.extend;
  28552. Sub.mixin = Super.mixin;
  28553. Sub.use = Super.use;
  28554. // create asset registers, so extended classes
  28555. // can have their private assets too.
  28556. config._assetTypes.forEach(function (type) {
  28557. Sub[type] = Super[type];
  28558. });
  28559. // enable recursive self-lookup
  28560. if (name) {
  28561. Sub.options.components[name] = Sub;
  28562. }
  28563. // keep a reference to the super options at extension time.
  28564. // later at instantiation we can check if Super's options have
  28565. // been updated.
  28566. Sub.superOptions = Super.options;
  28567. Sub.extendOptions = extendOptions;
  28568. // cache constructor
  28569. cachedCtors[SuperId] = Sub;
  28570. return Sub
  28571. };
  28572. }
  28573. /* */
  28574. function initAssetRegisters (Vue) {
  28575. /**
  28576. * Create asset registration methods.
  28577. */
  28578. config._assetTypes.forEach(function (type) {
  28579. Vue[type] = function (
  28580. id,
  28581. definition
  28582. ) {
  28583. if (!definition) {
  28584. return this.options[type + 's'][id]
  28585. } else {
  28586. /* istanbul ignore if */
  28587. if (process.env.NODE_ENV !== 'production') {
  28588. if (type === 'component' && config.isReservedTag(id)) {
  28589. warn(
  28590. 'Do not use built-in or reserved HTML elements as component ' +
  28591. 'id: ' + id
  28592. );
  28593. }
  28594. }
  28595. if (type === 'component' && isPlainObject(definition)) {
  28596. definition.name = definition.name || id;
  28597. definition = this.options._base.extend(definition);
  28598. }
  28599. if (type === 'directive' && typeof definition === 'function') {
  28600. definition = { bind: definition, update: definition };
  28601. }
  28602. this.options[type + 's'][id] = definition;
  28603. return definition
  28604. }
  28605. };
  28606. });
  28607. }
  28608. /* */
  28609. var patternTypes = [String, RegExp];
  28610. function getComponentName (opts) {
  28611. return opts && (opts.Ctor.options.name || opts.tag)
  28612. }
  28613. function matches (pattern, name) {
  28614. if (typeof pattern === 'string') {
  28615. return pattern.split(',').indexOf(name) > -1
  28616. } else {
  28617. return pattern.test(name)
  28618. }
  28619. }
  28620. function pruneCache (cache, filter) {
  28621. for (var key in cache) {
  28622. var cachedNode = cache[key];
  28623. if (cachedNode) {
  28624. var name = getComponentName(cachedNode.componentOptions);
  28625. if (name && !filter(name)) {
  28626. pruneCacheEntry(cachedNode);
  28627. cache[key] = null;
  28628. }
  28629. }
  28630. }
  28631. }
  28632. function pruneCacheEntry (vnode) {
  28633. if (vnode) {
  28634. if (!vnode.componentInstance._inactive) {
  28635. callHook(vnode.componentInstance, 'deactivated');
  28636. }
  28637. vnode.componentInstance.$destroy();
  28638. }
  28639. }
  28640. var KeepAlive = {
  28641. name: 'keep-alive',
  28642. abstract: true,
  28643. props: {
  28644. include: patternTypes,
  28645. exclude: patternTypes
  28646. },
  28647. created: function created () {
  28648. this.cache = Object.create(null);
  28649. },
  28650. destroyed: function destroyed () {
  28651. var this$1 = this;
  28652. for (var key in this.cache) {
  28653. pruneCacheEntry(this$1.cache[key]);
  28654. }
  28655. },
  28656. watch: {
  28657. include: function include (val) {
  28658. pruneCache(this.cache, function (name) { return matches(val, name); });
  28659. },
  28660. exclude: function exclude (val) {
  28661. pruneCache(this.cache, function (name) { return !matches(val, name); });
  28662. }
  28663. },
  28664. render: function render () {
  28665. var vnode = getFirstComponentChild(this.$slots.default);
  28666. var componentOptions = vnode && vnode.componentOptions;
  28667. if (componentOptions) {
  28668. // check pattern
  28669. var name = getComponentName(componentOptions);
  28670. if (name && (
  28671. (this.include && !matches(this.include, name)) ||
  28672. (this.exclude && matches(this.exclude, name))
  28673. )) {
  28674. return vnode
  28675. }
  28676. var key = vnode.key == null
  28677. // same constructor may get registered as different local components
  28678. // so cid alone is not enough (#3269)
  28679. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  28680. : vnode.key;
  28681. if (this.cache[key]) {
  28682. vnode.componentInstance = this.cache[key].componentInstance;
  28683. } else {
  28684. this.cache[key] = vnode;
  28685. }
  28686. vnode.data.keepAlive = true;
  28687. }
  28688. return vnode
  28689. }
  28690. };
  28691. var builtInComponents = {
  28692. KeepAlive: KeepAlive
  28693. };
  28694. /* */
  28695. function initGlobalAPI (Vue) {
  28696. // config
  28697. var configDef = {};
  28698. configDef.get = function () { return config; };
  28699. if (process.env.NODE_ENV !== 'production') {
  28700. configDef.set = function () {
  28701. warn(
  28702. 'Do not replace the Vue.config object, set individual fields instead.'
  28703. );
  28704. };
  28705. }
  28706. Object.defineProperty(Vue, 'config', configDef);
  28707. Vue.util = util;
  28708. Vue.set = set$1;
  28709. Vue.delete = del;
  28710. Vue.nextTick = nextTick;
  28711. Vue.options = Object.create(null);
  28712. config._assetTypes.forEach(function (type) {
  28713. Vue.options[type + 's'] = Object.create(null);
  28714. });
  28715. // this is used to identify the "base" constructor to extend all plain-object
  28716. // components with in Weex's multi-instance scenarios.
  28717. Vue.options._base = Vue;
  28718. extend(Vue.options.components, builtInComponents);
  28719. initUse(Vue);
  28720. initMixin$1(Vue);
  28721. initExtend(Vue);
  28722. initAssetRegisters(Vue);
  28723. }
  28724. initGlobalAPI(Vue$3);
  28725. Object.defineProperty(Vue$3.prototype, '$isServer', {
  28726. get: isServerRendering
  28727. });
  28728. Vue$3.version = '2.1.10';
  28729. /* */
  28730. // attributes that should be using props for binding
  28731. var acceptValue = makeMap('input,textarea,option,select');
  28732. var mustUseProp = function (tag, type, attr) {
  28733. return (
  28734. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  28735. (attr === 'selected' && tag === 'option') ||
  28736. (attr === 'checked' && tag === 'input') ||
  28737. (attr === 'muted' && tag === 'video')
  28738. )
  28739. };
  28740. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  28741. var isBooleanAttr = makeMap(
  28742. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  28743. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  28744. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  28745. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  28746. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  28747. 'truespeed,typemustmatch,visible'
  28748. );
  28749. var xlinkNS = 'http://www.w3.org/1999/xlink';
  28750. var isXlink = function (name) {
  28751. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  28752. };
  28753. var getXlinkProp = function (name) {
  28754. return isXlink(name) ? name.slice(6, name.length) : ''
  28755. };
  28756. var isFalsyAttrValue = function (val) {
  28757. return val == null || val === false
  28758. };
  28759. /* */
  28760. function genClassForVnode (vnode) {
  28761. var data = vnode.data;
  28762. var parentNode = vnode;
  28763. var childNode = vnode;
  28764. while (childNode.componentInstance) {
  28765. childNode = childNode.componentInstance._vnode;
  28766. if (childNode.data) {
  28767. data = mergeClassData(childNode.data, data);
  28768. }
  28769. }
  28770. while ((parentNode = parentNode.parent)) {
  28771. if (parentNode.data) {
  28772. data = mergeClassData(data, parentNode.data);
  28773. }
  28774. }
  28775. return genClassFromData(data)
  28776. }
  28777. function mergeClassData (child, parent) {
  28778. return {
  28779. staticClass: concat(child.staticClass, parent.staticClass),
  28780. class: child.class
  28781. ? [child.class, parent.class]
  28782. : parent.class
  28783. }
  28784. }
  28785. function genClassFromData (data) {
  28786. var dynamicClass = data.class;
  28787. var staticClass = data.staticClass;
  28788. if (staticClass || dynamicClass) {
  28789. return concat(staticClass, stringifyClass(dynamicClass))
  28790. }
  28791. /* istanbul ignore next */
  28792. return ''
  28793. }
  28794. function concat (a, b) {
  28795. return a ? b ? (a + ' ' + b) : a : (b || '')
  28796. }
  28797. function stringifyClass (value) {
  28798. var res = '';
  28799. if (!value) {
  28800. return res
  28801. }
  28802. if (typeof value === 'string') {
  28803. return value
  28804. }
  28805. if (Array.isArray(value)) {
  28806. var stringified;
  28807. for (var i = 0, l = value.length; i < l; i++) {
  28808. if (value[i]) {
  28809. if ((stringified = stringifyClass(value[i]))) {
  28810. res += stringified + ' ';
  28811. }
  28812. }
  28813. }
  28814. return res.slice(0, -1)
  28815. }
  28816. if (isObject(value)) {
  28817. for (var key in value) {
  28818. if (value[key]) { res += key + ' '; }
  28819. }
  28820. return res.slice(0, -1)
  28821. }
  28822. /* istanbul ignore next */
  28823. return res
  28824. }
  28825. /* */
  28826. var namespaceMap = {
  28827. svg: 'http://www.w3.org/2000/svg',
  28828. math: 'http://www.w3.org/1998/Math/MathML'
  28829. };
  28830. var isHTMLTag = makeMap(
  28831. 'html,body,base,head,link,meta,style,title,' +
  28832. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  28833. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  28834. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  28835. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  28836. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  28837. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  28838. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  28839. 'output,progress,select,textarea,' +
  28840. 'details,dialog,menu,menuitem,summary,' +
  28841. 'content,element,shadow,template'
  28842. );
  28843. // this map is intentionally selective, only covering SVG elements that may
  28844. // contain child elements.
  28845. var isSVG = makeMap(
  28846. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' +
  28847. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  28848. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  28849. true
  28850. );
  28851. var isPreTag = function (tag) { return tag === 'pre'; };
  28852. var isReservedTag = function (tag) {
  28853. return isHTMLTag(tag) || isSVG(tag)
  28854. };
  28855. function getTagNamespace (tag) {
  28856. if (isSVG(tag)) {
  28857. return 'svg'
  28858. }
  28859. // basic support for MathML
  28860. // note it doesn't support other MathML elements being component roots
  28861. if (tag === 'math') {
  28862. return 'math'
  28863. }
  28864. }
  28865. var unknownElementCache = Object.create(null);
  28866. function isUnknownElement (tag) {
  28867. /* istanbul ignore if */
  28868. if (!inBrowser) {
  28869. return true
  28870. }
  28871. if (isReservedTag(tag)) {
  28872. return false
  28873. }
  28874. tag = tag.toLowerCase();
  28875. /* istanbul ignore if */
  28876. if (unknownElementCache[tag] != null) {
  28877. return unknownElementCache[tag]
  28878. }
  28879. var el = document.createElement(tag);
  28880. if (tag.indexOf('-') > -1) {
  28881. // http://stackoverflow.com/a/28210364/1070244
  28882. return (unknownElementCache[tag] = (
  28883. el.constructor === window.HTMLUnknownElement ||
  28884. el.constructor === window.HTMLElement
  28885. ))
  28886. } else {
  28887. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  28888. }
  28889. }
  28890. /* */
  28891. /**
  28892. * Query an element selector if it's not an element already.
  28893. */
  28894. function query (el) {
  28895. if (typeof el === 'string') {
  28896. var selector = el;
  28897. el = document.querySelector(el);
  28898. if (!el) {
  28899. process.env.NODE_ENV !== 'production' && warn(
  28900. 'Cannot find element: ' + selector
  28901. );
  28902. return document.createElement('div')
  28903. }
  28904. }
  28905. return el
  28906. }
  28907. /* */
  28908. function createElement$1 (tagName, vnode) {
  28909. var elm = document.createElement(tagName);
  28910. if (tagName !== 'select') {
  28911. return elm
  28912. }
  28913. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  28914. elm.setAttribute('multiple', 'multiple');
  28915. }
  28916. return elm
  28917. }
  28918. function createElementNS (namespace, tagName) {
  28919. return document.createElementNS(namespaceMap[namespace], tagName)
  28920. }
  28921. function createTextNode (text) {
  28922. return document.createTextNode(text)
  28923. }
  28924. function createComment (text) {
  28925. return document.createComment(text)
  28926. }
  28927. function insertBefore (parentNode, newNode, referenceNode) {
  28928. parentNode.insertBefore(newNode, referenceNode);
  28929. }
  28930. function removeChild (node, child) {
  28931. node.removeChild(child);
  28932. }
  28933. function appendChild (node, child) {
  28934. node.appendChild(child);
  28935. }
  28936. function parentNode (node) {
  28937. return node.parentNode
  28938. }
  28939. function nextSibling (node) {
  28940. return node.nextSibling
  28941. }
  28942. function tagName (node) {
  28943. return node.tagName
  28944. }
  28945. function setTextContent (node, text) {
  28946. node.textContent = text;
  28947. }
  28948. function setAttribute (node, key, val) {
  28949. node.setAttribute(key, val);
  28950. }
  28951. var nodeOps = Object.freeze({
  28952. createElement: createElement$1,
  28953. createElementNS: createElementNS,
  28954. createTextNode: createTextNode,
  28955. createComment: createComment,
  28956. insertBefore: insertBefore,
  28957. removeChild: removeChild,
  28958. appendChild: appendChild,
  28959. parentNode: parentNode,
  28960. nextSibling: nextSibling,
  28961. tagName: tagName,
  28962. setTextContent: setTextContent,
  28963. setAttribute: setAttribute
  28964. });
  28965. /* */
  28966. var ref = {
  28967. create: function create (_, vnode) {
  28968. registerRef(vnode);
  28969. },
  28970. update: function update (oldVnode, vnode) {
  28971. if (oldVnode.data.ref !== vnode.data.ref) {
  28972. registerRef(oldVnode, true);
  28973. registerRef(vnode);
  28974. }
  28975. },
  28976. destroy: function destroy (vnode) {
  28977. registerRef(vnode, true);
  28978. }
  28979. };
  28980. function registerRef (vnode, isRemoval) {
  28981. var key = vnode.data.ref;
  28982. if (!key) { return }
  28983. var vm = vnode.context;
  28984. var ref = vnode.componentInstance || vnode.elm;
  28985. var refs = vm.$refs;
  28986. if (isRemoval) {
  28987. if (Array.isArray(refs[key])) {
  28988. remove$1(refs[key], ref);
  28989. } else if (refs[key] === ref) {
  28990. refs[key] = undefined;
  28991. }
  28992. } else {
  28993. if (vnode.data.refInFor) {
  28994. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  28995. refs[key].push(ref);
  28996. } else {
  28997. refs[key] = [ref];
  28998. }
  28999. } else {
  29000. refs[key] = ref;
  29001. }
  29002. }
  29003. }
  29004. /**
  29005. * Virtual DOM patching algorithm based on Snabbdom by
  29006. * Simon Friis Vindum (@paldepind)
  29007. * Licensed under the MIT License
  29008. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  29009. *
  29010. * modified by Evan You (@yyx990803)
  29011. *
  29012. /*
  29013. * Not type-checking this because this file is perf-critical and the cost
  29014. * of making flow understand it is not worth it.
  29015. */
  29016. var emptyNode = new VNode('', {}, []);
  29017. var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy'];
  29018. function isUndef (s) {
  29019. return s == null
  29020. }
  29021. function isDef (s) {
  29022. return s != null
  29023. }
  29024. function sameVnode (vnode1, vnode2) {
  29025. return (
  29026. vnode1.key === vnode2.key &&
  29027. vnode1.tag === vnode2.tag &&
  29028. vnode1.isComment === vnode2.isComment &&
  29029. !vnode1.data === !vnode2.data
  29030. )
  29031. }
  29032. function createKeyToOldIdx (children, beginIdx, endIdx) {
  29033. var i, key;
  29034. var map = {};
  29035. for (i = beginIdx; i <= endIdx; ++i) {
  29036. key = children[i].key;
  29037. if (isDef(key)) { map[key] = i; }
  29038. }
  29039. return map
  29040. }
  29041. function createPatchFunction (backend) {
  29042. var i, j;
  29043. var cbs = {};
  29044. var modules = backend.modules;
  29045. var nodeOps = backend.nodeOps;
  29046. for (i = 0; i < hooks$1.length; ++i) {
  29047. cbs[hooks$1[i]] = [];
  29048. for (j = 0; j < modules.length; ++j) {
  29049. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  29050. }
  29051. }
  29052. function emptyNodeAt (elm) {
  29053. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  29054. }
  29055. function createRmCb (childElm, listeners) {
  29056. function remove$$1 () {
  29057. if (--remove$$1.listeners === 0) {
  29058. removeNode(childElm);
  29059. }
  29060. }
  29061. remove$$1.listeners = listeners;
  29062. return remove$$1
  29063. }
  29064. function removeNode (el) {
  29065. var parent = nodeOps.parentNode(el);
  29066. // element may have already been removed due to v-html / v-text
  29067. if (parent) {
  29068. nodeOps.removeChild(parent, el);
  29069. }
  29070. }
  29071. var inPre = 0;
  29072. function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
  29073. vnode.isRootInsert = !nested; // for transition enter check
  29074. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  29075. return
  29076. }
  29077. var data = vnode.data;
  29078. var children = vnode.children;
  29079. var tag = vnode.tag;
  29080. if (isDef(tag)) {
  29081. if (process.env.NODE_ENV !== 'production') {
  29082. if (data && data.pre) {
  29083. inPre++;
  29084. }
  29085. if (
  29086. !inPre &&
  29087. !vnode.ns &&
  29088. !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
  29089. config.isUnknownElement(tag)
  29090. ) {
  29091. warn(
  29092. 'Unknown custom element: <' + tag + '> - did you ' +
  29093. 'register the component correctly? For recursive components, ' +
  29094. 'make sure to provide the "name" option.',
  29095. vnode.context
  29096. );
  29097. }
  29098. }
  29099. vnode.elm = vnode.ns
  29100. ? nodeOps.createElementNS(vnode.ns, tag)
  29101. : nodeOps.createElement(tag, vnode);
  29102. setScope(vnode);
  29103. /* istanbul ignore if */
  29104. {
  29105. createChildren(vnode, children, insertedVnodeQueue);
  29106. if (isDef(data)) {
  29107. invokeCreateHooks(vnode, insertedVnodeQueue);
  29108. }
  29109. insert(parentElm, vnode.elm, refElm);
  29110. }
  29111. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  29112. inPre--;
  29113. }
  29114. } else if (vnode.isComment) {
  29115. vnode.elm = nodeOps.createComment(vnode.text);
  29116. insert(parentElm, vnode.elm, refElm);
  29117. } else {
  29118. vnode.elm = nodeOps.createTextNode(vnode.text);
  29119. insert(parentElm, vnode.elm, refElm);
  29120. }
  29121. }
  29122. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  29123. var i = vnode.data;
  29124. if (isDef(i)) {
  29125. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  29126. if (isDef(i = i.hook) && isDef(i = i.init)) {
  29127. i(vnode, false /* hydrating */, parentElm, refElm);
  29128. }
  29129. // after calling the init hook, if the vnode is a child component
  29130. // it should've created a child instance and mounted it. the child
  29131. // component also has set the placeholder vnode's elm.
  29132. // in that case we can just return the element and be done.
  29133. if (isDef(vnode.componentInstance)) {
  29134. initComponent(vnode, insertedVnodeQueue);
  29135. if (isReactivated) {
  29136. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  29137. }
  29138. return true
  29139. }
  29140. }
  29141. }
  29142. function initComponent (vnode, insertedVnodeQueue) {
  29143. if (vnode.data.pendingInsert) {
  29144. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  29145. }
  29146. vnode.elm = vnode.componentInstance.$el;
  29147. if (isPatchable(vnode)) {
  29148. invokeCreateHooks(vnode, insertedVnodeQueue);
  29149. setScope(vnode);
  29150. } else {
  29151. // empty component root.
  29152. // skip all element-related modules except for ref (#3455)
  29153. registerRef(vnode);
  29154. // make sure to invoke the insert hook
  29155. insertedVnodeQueue.push(vnode);
  29156. }
  29157. }
  29158. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  29159. var i;
  29160. // hack for #4339: a reactivated component with inner transition
  29161. // does not trigger because the inner node's created hooks are not called
  29162. // again. It's not ideal to involve module-specific logic in here but
  29163. // there doesn't seem to be a better way to do it.
  29164. var innerNode = vnode;
  29165. while (innerNode.componentInstance) {
  29166. innerNode = innerNode.componentInstance._vnode;
  29167. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  29168. for (i = 0; i < cbs.activate.length; ++i) {
  29169. cbs.activate[i](emptyNode, innerNode);
  29170. }
  29171. insertedVnodeQueue.push(innerNode);
  29172. break
  29173. }
  29174. }
  29175. // unlike a newly created component,
  29176. // a reactivated keep-alive component doesn't insert itself
  29177. insert(parentElm, vnode.elm, refElm);
  29178. }
  29179. function insert (parent, elm, ref) {
  29180. if (parent) {
  29181. if (ref) {
  29182. nodeOps.insertBefore(parent, elm, ref);
  29183. } else {
  29184. nodeOps.appendChild(parent, elm);
  29185. }
  29186. }
  29187. }
  29188. function createChildren (vnode, children, insertedVnodeQueue) {
  29189. if (Array.isArray(children)) {
  29190. for (var i = 0; i < children.length; ++i) {
  29191. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
  29192. }
  29193. } else if (isPrimitive(vnode.text)) {
  29194. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  29195. }
  29196. }
  29197. function isPatchable (vnode) {
  29198. while (vnode.componentInstance) {
  29199. vnode = vnode.componentInstance._vnode;
  29200. }
  29201. return isDef(vnode.tag)
  29202. }
  29203. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  29204. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  29205. cbs.create[i$1](emptyNode, vnode);
  29206. }
  29207. i = vnode.data.hook; // Reuse variable
  29208. if (isDef(i)) {
  29209. if (i.create) { i.create(emptyNode, vnode); }
  29210. if (i.insert) { insertedVnodeQueue.push(vnode); }
  29211. }
  29212. }
  29213. // set scope id attribute for scoped CSS.
  29214. // this is implemented as a special case to avoid the overhead
  29215. // of going through the normal attribute patching process.
  29216. function setScope (vnode) {
  29217. var i;
  29218. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  29219. nodeOps.setAttribute(vnode.elm, i, '');
  29220. }
  29221. if (isDef(i = activeInstance) &&
  29222. i !== vnode.context &&
  29223. isDef(i = i.$options._scopeId)) {
  29224. nodeOps.setAttribute(vnode.elm, i, '');
  29225. }
  29226. }
  29227. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  29228. for (; startIdx <= endIdx; ++startIdx) {
  29229. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
  29230. }
  29231. }
  29232. function invokeDestroyHook (vnode) {
  29233. var i, j;
  29234. var data = vnode.data;
  29235. if (isDef(data)) {
  29236. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  29237. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  29238. }
  29239. if (isDef(i = vnode.children)) {
  29240. for (j = 0; j < vnode.children.length; ++j) {
  29241. invokeDestroyHook(vnode.children[j]);
  29242. }
  29243. }
  29244. }
  29245. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  29246. for (; startIdx <= endIdx; ++startIdx) {
  29247. var ch = vnodes[startIdx];
  29248. if (isDef(ch)) {
  29249. if (isDef(ch.tag)) {
  29250. removeAndInvokeRemoveHook(ch);
  29251. invokeDestroyHook(ch);
  29252. } else { // Text node
  29253. removeNode(ch.elm);
  29254. }
  29255. }
  29256. }
  29257. }
  29258. function removeAndInvokeRemoveHook (vnode, rm) {
  29259. if (rm || isDef(vnode.data)) {
  29260. var listeners = cbs.remove.length + 1;
  29261. if (!rm) {
  29262. // directly removing
  29263. rm = createRmCb(vnode.elm, listeners);
  29264. } else {
  29265. // we have a recursively passed down rm callback
  29266. // increase the listeners count
  29267. rm.listeners += listeners;
  29268. }
  29269. // recursively invoke hooks on child component root node
  29270. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  29271. removeAndInvokeRemoveHook(i, rm);
  29272. }
  29273. for (i = 0; i < cbs.remove.length; ++i) {
  29274. cbs.remove[i](vnode, rm);
  29275. }
  29276. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  29277. i(vnode, rm);
  29278. } else {
  29279. rm();
  29280. }
  29281. } else {
  29282. removeNode(vnode.elm);
  29283. }
  29284. }
  29285. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  29286. var oldStartIdx = 0;
  29287. var newStartIdx = 0;
  29288. var oldEndIdx = oldCh.length - 1;
  29289. var oldStartVnode = oldCh[0];
  29290. var oldEndVnode = oldCh[oldEndIdx];
  29291. var newEndIdx = newCh.length - 1;
  29292. var newStartVnode = newCh[0];
  29293. var newEndVnode = newCh[newEndIdx];
  29294. var oldKeyToIdx, idxInOld, elmToMove, refElm;
  29295. // removeOnly is a special flag used only by <transition-group>
  29296. // to ensure removed elements stay in correct relative positions
  29297. // during leaving transitions
  29298. var canMove = !removeOnly;
  29299. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  29300. if (isUndef(oldStartVnode)) {
  29301. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  29302. } else if (isUndef(oldEndVnode)) {
  29303. oldEndVnode = oldCh[--oldEndIdx];
  29304. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  29305. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  29306. oldStartVnode = oldCh[++oldStartIdx];
  29307. newStartVnode = newCh[++newStartIdx];
  29308. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  29309. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  29310. oldEndVnode = oldCh[--oldEndIdx];
  29311. newEndVnode = newCh[--newEndIdx];
  29312. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  29313. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  29314. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  29315. oldStartVnode = oldCh[++oldStartIdx];
  29316. newEndVnode = newCh[--newEndIdx];
  29317. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  29318. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  29319. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  29320. oldEndVnode = oldCh[--oldEndIdx];
  29321. newStartVnode = newCh[++newStartIdx];
  29322. } else {
  29323. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  29324. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  29325. if (isUndef(idxInOld)) { // New element
  29326. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29327. newStartVnode = newCh[++newStartIdx];
  29328. } else {
  29329. elmToMove = oldCh[idxInOld];
  29330. /* istanbul ignore if */
  29331. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  29332. warn(
  29333. 'It seems there are duplicate keys that is causing an update error. ' +
  29334. 'Make sure each v-for item has a unique key.'
  29335. );
  29336. }
  29337. if (sameVnode(elmToMove, newStartVnode)) {
  29338. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  29339. oldCh[idxInOld] = undefined;
  29340. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  29341. newStartVnode = newCh[++newStartIdx];
  29342. } else {
  29343. // same key but different element. treat as new element
  29344. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  29345. newStartVnode = newCh[++newStartIdx];
  29346. }
  29347. }
  29348. }
  29349. }
  29350. if (oldStartIdx > oldEndIdx) {
  29351. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  29352. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  29353. } else if (newStartIdx > newEndIdx) {
  29354. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  29355. }
  29356. }
  29357. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  29358. if (oldVnode === vnode) {
  29359. return
  29360. }
  29361. // reuse element for static trees.
  29362. // note we only do this if the vnode is cloned -
  29363. // if the new node is not cloned it means the render functions have been
  29364. // reset by the hot-reload-api and we need to do a proper re-render.
  29365. if (vnode.isStatic &&
  29366. oldVnode.isStatic &&
  29367. vnode.key === oldVnode.key &&
  29368. (vnode.isCloned || vnode.isOnce)) {
  29369. vnode.elm = oldVnode.elm;
  29370. vnode.componentInstance = oldVnode.componentInstance;
  29371. return
  29372. }
  29373. var i;
  29374. var data = vnode.data;
  29375. var hasData = isDef(data);
  29376. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  29377. i(oldVnode, vnode);
  29378. }
  29379. var elm = vnode.elm = oldVnode.elm;
  29380. var oldCh = oldVnode.children;
  29381. var ch = vnode.children;
  29382. if (hasData && isPatchable(vnode)) {
  29383. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  29384. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  29385. }
  29386. if (isUndef(vnode.text)) {
  29387. if (isDef(oldCh) && isDef(ch)) {
  29388. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  29389. } else if (isDef(ch)) {
  29390. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  29391. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  29392. } else if (isDef(oldCh)) {
  29393. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  29394. } else if (isDef(oldVnode.text)) {
  29395. nodeOps.setTextContent(elm, '');
  29396. }
  29397. } else if (oldVnode.text !== vnode.text) {
  29398. nodeOps.setTextContent(elm, vnode.text);
  29399. }
  29400. if (hasData) {
  29401. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  29402. }
  29403. }
  29404. function invokeInsertHook (vnode, queue, initial) {
  29405. // delay insert hooks for component root nodes, invoke them after the
  29406. // element is really inserted
  29407. if (initial && vnode.parent) {
  29408. vnode.parent.data.pendingInsert = queue;
  29409. } else {
  29410. for (var i = 0; i < queue.length; ++i) {
  29411. queue[i].data.hook.insert(queue[i]);
  29412. }
  29413. }
  29414. }
  29415. var bailed = false;
  29416. // list of modules that can skip create hook during hydration because they
  29417. // are already rendered on the client or has no need for initialization
  29418. var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
  29419. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  29420. function hydrate (elm, vnode, insertedVnodeQueue) {
  29421. if (process.env.NODE_ENV !== 'production') {
  29422. if (!assertNodeMatch(elm, vnode)) {
  29423. return false
  29424. }
  29425. }
  29426. vnode.elm = elm;
  29427. var tag = vnode.tag;
  29428. var data = vnode.data;
  29429. var children = vnode.children;
  29430. if (isDef(data)) {
  29431. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  29432. if (isDef(i = vnode.componentInstance)) {
  29433. // child component. it should have hydrated its own tree.
  29434. initComponent(vnode, insertedVnodeQueue);
  29435. return true
  29436. }
  29437. }
  29438. if (isDef(tag)) {
  29439. if (isDef(children)) {
  29440. // empty element, allow client to pick up and populate children
  29441. if (!elm.hasChildNodes()) {
  29442. createChildren(vnode, children, insertedVnodeQueue);
  29443. } else {
  29444. var childrenMatch = true;
  29445. var childNode = elm.firstChild;
  29446. for (var i$1 = 0; i$1 < children.length; i$1++) {
  29447. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
  29448. childrenMatch = false;
  29449. break
  29450. }
  29451. childNode = childNode.nextSibling;
  29452. }
  29453. // if childNode is not null, it means the actual childNodes list is
  29454. // longer than the virtual children list.
  29455. if (!childrenMatch || childNode) {
  29456. if (process.env.NODE_ENV !== 'production' &&
  29457. typeof console !== 'undefined' &&
  29458. !bailed) {
  29459. bailed = true;
  29460. console.warn('Parent: ', elm);
  29461. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  29462. }
  29463. return false
  29464. }
  29465. }
  29466. }
  29467. if (isDef(data)) {
  29468. for (var key in data) {
  29469. if (!isRenderedModule(key)) {
  29470. invokeCreateHooks(vnode, insertedVnodeQueue);
  29471. break
  29472. }
  29473. }
  29474. }
  29475. } else if (elm.data !== vnode.text) {
  29476. elm.data = vnode.text;
  29477. }
  29478. return true
  29479. }
  29480. function assertNodeMatch (node, vnode) {
  29481. if (vnode.tag) {
  29482. return (
  29483. vnode.tag.indexOf('vue-component') === 0 ||
  29484. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  29485. )
  29486. } else {
  29487. return node.nodeType === (vnode.isComment ? 8 : 3)
  29488. }
  29489. }
  29490. return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
  29491. if (!vnode) {
  29492. if (oldVnode) { invokeDestroyHook(oldVnode); }
  29493. return
  29494. }
  29495. var isInitialPatch = false;
  29496. var insertedVnodeQueue = [];
  29497. if (!oldVnode) {
  29498. // empty mount (likely as component), create new root element
  29499. isInitialPatch = true;
  29500. createElm(vnode, insertedVnodeQueue, parentElm, refElm);
  29501. } else {
  29502. var isRealElement = isDef(oldVnode.nodeType);
  29503. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  29504. // patch existing root node
  29505. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  29506. } else {
  29507. if (isRealElement) {
  29508. // mounting to a real element
  29509. // check if this is server-rendered content and if we can perform
  29510. // a successful hydration.
  29511. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  29512. oldVnode.removeAttribute('server-rendered');
  29513. hydrating = true;
  29514. }
  29515. if (hydrating) {
  29516. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  29517. invokeInsertHook(vnode, insertedVnodeQueue, true);
  29518. return oldVnode
  29519. } else if (process.env.NODE_ENV !== 'production') {
  29520. warn(
  29521. 'The client-side rendered virtual DOM tree is not matching ' +
  29522. 'server-rendered content. This is likely caused by incorrect ' +
  29523. 'HTML markup, for example nesting block-level elements inside ' +
  29524. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  29525. 'full client-side render.'
  29526. );
  29527. }
  29528. }
  29529. // either not server-rendered, or hydration failed.
  29530. // create an empty node and replace it
  29531. oldVnode = emptyNodeAt(oldVnode);
  29532. }
  29533. // replacing existing element
  29534. var oldElm = oldVnode.elm;
  29535. var parentElm$1 = nodeOps.parentNode(oldElm);
  29536. createElm(
  29537. vnode,
  29538. insertedVnodeQueue,
  29539. // extremely rare edge case: do not insert if old element is in a
  29540. // leaving transition. Only happens when combining transition +
  29541. // keep-alive + HOCs. (#4590)
  29542. oldElm._leaveCb ? null : parentElm$1,
  29543. nodeOps.nextSibling(oldElm)
  29544. );
  29545. if (vnode.parent) {
  29546. // component root element replaced.
  29547. // update parent placeholder node element, recursively
  29548. var ancestor = vnode.parent;
  29549. while (ancestor) {
  29550. ancestor.elm = vnode.elm;
  29551. ancestor = ancestor.parent;
  29552. }
  29553. if (isPatchable(vnode)) {
  29554. for (var i = 0; i < cbs.create.length; ++i) {
  29555. cbs.create[i](emptyNode, vnode.parent);
  29556. }
  29557. }
  29558. }
  29559. if (parentElm$1 !== null) {
  29560. removeVnodes(parentElm$1, [oldVnode], 0, 0);
  29561. } else if (isDef(oldVnode.tag)) {
  29562. invokeDestroyHook(oldVnode);
  29563. }
  29564. }
  29565. }
  29566. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  29567. return vnode.elm
  29568. }
  29569. }
  29570. /* */
  29571. var directives = {
  29572. create: updateDirectives,
  29573. update: updateDirectives,
  29574. destroy: function unbindDirectives (vnode) {
  29575. updateDirectives(vnode, emptyNode);
  29576. }
  29577. };
  29578. function updateDirectives (oldVnode, vnode) {
  29579. if (oldVnode.data.directives || vnode.data.directives) {
  29580. _update(oldVnode, vnode);
  29581. }
  29582. }
  29583. function _update (oldVnode, vnode) {
  29584. var isCreate = oldVnode === emptyNode;
  29585. var isDestroy = vnode === emptyNode;
  29586. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  29587. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  29588. var dirsWithInsert = [];
  29589. var dirsWithPostpatch = [];
  29590. var key, oldDir, dir;
  29591. for (key in newDirs) {
  29592. oldDir = oldDirs[key];
  29593. dir = newDirs[key];
  29594. if (!oldDir) {
  29595. // new directive, bind
  29596. callHook$1(dir, 'bind', vnode, oldVnode);
  29597. if (dir.def && dir.def.inserted) {
  29598. dirsWithInsert.push(dir);
  29599. }
  29600. } else {
  29601. // existing directive, update
  29602. dir.oldValue = oldDir.value;
  29603. callHook$1(dir, 'update', vnode, oldVnode);
  29604. if (dir.def && dir.def.componentUpdated) {
  29605. dirsWithPostpatch.push(dir);
  29606. }
  29607. }
  29608. }
  29609. if (dirsWithInsert.length) {
  29610. var callInsert = function () {
  29611. for (var i = 0; i < dirsWithInsert.length; i++) {
  29612. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  29613. }
  29614. };
  29615. if (isCreate) {
  29616. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  29617. } else {
  29618. callInsert();
  29619. }
  29620. }
  29621. if (dirsWithPostpatch.length) {
  29622. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  29623. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  29624. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  29625. }
  29626. }, 'dir-postpatch');
  29627. }
  29628. if (!isCreate) {
  29629. for (key in oldDirs) {
  29630. if (!newDirs[key]) {
  29631. // no longer present, unbind
  29632. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  29633. }
  29634. }
  29635. }
  29636. }
  29637. var emptyModifiers = Object.create(null);
  29638. function normalizeDirectives$1 (
  29639. dirs,
  29640. vm
  29641. ) {
  29642. var res = Object.create(null);
  29643. if (!dirs) {
  29644. return res
  29645. }
  29646. var i, dir;
  29647. for (i = 0; i < dirs.length; i++) {
  29648. dir = dirs[i];
  29649. if (!dir.modifiers) {
  29650. dir.modifiers = emptyModifiers;
  29651. }
  29652. res[getRawDirName(dir)] = dir;
  29653. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  29654. }
  29655. return res
  29656. }
  29657. function getRawDirName (dir) {
  29658. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  29659. }
  29660. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  29661. var fn = dir.def && dir.def[hook];
  29662. if (fn) {
  29663. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  29664. }
  29665. }
  29666. var baseModules = [
  29667. ref,
  29668. directives
  29669. ];
  29670. /* */
  29671. function updateAttrs (oldVnode, vnode) {
  29672. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  29673. return
  29674. }
  29675. var key, cur, old;
  29676. var elm = vnode.elm;
  29677. var oldAttrs = oldVnode.data.attrs || {};
  29678. var attrs = vnode.data.attrs || {};
  29679. // clone observed objects, as the user probably wants to mutate it
  29680. if (attrs.__ob__) {
  29681. attrs = vnode.data.attrs = extend({}, attrs);
  29682. }
  29683. for (key in attrs) {
  29684. cur = attrs[key];
  29685. old = oldAttrs[key];
  29686. if (old !== cur) {
  29687. setAttr(elm, key, cur);
  29688. }
  29689. }
  29690. // #4391: in IE9, setting type can reset value for input[type=radio]
  29691. /* istanbul ignore if */
  29692. if (isIE9 && attrs.value !== oldAttrs.value) {
  29693. setAttr(elm, 'value', attrs.value);
  29694. }
  29695. for (key in oldAttrs) {
  29696. if (attrs[key] == null) {
  29697. if (isXlink(key)) {
  29698. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29699. } else if (!isEnumeratedAttr(key)) {
  29700. elm.removeAttribute(key);
  29701. }
  29702. }
  29703. }
  29704. }
  29705. function setAttr (el, key, value) {
  29706. if (isBooleanAttr(key)) {
  29707. // set attribute for blank value
  29708. // e.g. <option disabled>Select one</option>
  29709. if (isFalsyAttrValue(value)) {
  29710. el.removeAttribute(key);
  29711. } else {
  29712. el.setAttribute(key, key);
  29713. }
  29714. } else if (isEnumeratedAttr(key)) {
  29715. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  29716. } else if (isXlink(key)) {
  29717. if (isFalsyAttrValue(value)) {
  29718. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  29719. } else {
  29720. el.setAttributeNS(xlinkNS, key, value);
  29721. }
  29722. } else {
  29723. if (isFalsyAttrValue(value)) {
  29724. el.removeAttribute(key);
  29725. } else {
  29726. el.setAttribute(key, value);
  29727. }
  29728. }
  29729. }
  29730. var attrs = {
  29731. create: updateAttrs,
  29732. update: updateAttrs
  29733. };
  29734. /* */
  29735. function updateClass (oldVnode, vnode) {
  29736. var el = vnode.elm;
  29737. var data = vnode.data;
  29738. var oldData = oldVnode.data;
  29739. if (!data.staticClass && !data.class &&
  29740. (!oldData || (!oldData.staticClass && !oldData.class))) {
  29741. return
  29742. }
  29743. var cls = genClassForVnode(vnode);
  29744. // handle transition classes
  29745. var transitionClass = el._transitionClasses;
  29746. if (transitionClass) {
  29747. cls = concat(cls, stringifyClass(transitionClass));
  29748. }
  29749. // set the class
  29750. if (cls !== el._prevClass) {
  29751. el.setAttribute('class', cls);
  29752. el._prevClass = cls;
  29753. }
  29754. }
  29755. var klass = {
  29756. create: updateClass,
  29757. update: updateClass
  29758. };
  29759. /* */
  29760. var target$1;
  29761. function add$2 (
  29762. event,
  29763. handler,
  29764. once,
  29765. capture
  29766. ) {
  29767. if (once) {
  29768. var oldHandler = handler;
  29769. var _target = target$1; // save current target element in closure
  29770. handler = function (ev) {
  29771. remove$3(event, handler, capture, _target);
  29772. arguments.length === 1
  29773. ? oldHandler(ev)
  29774. : oldHandler.apply(null, arguments);
  29775. };
  29776. }
  29777. target$1.addEventListener(event, handler, capture);
  29778. }
  29779. function remove$3 (
  29780. event,
  29781. handler,
  29782. capture,
  29783. _target
  29784. ) {
  29785. (_target || target$1).removeEventListener(event, handler, capture);
  29786. }
  29787. function updateDOMListeners (oldVnode, vnode) {
  29788. if (!oldVnode.data.on && !vnode.data.on) {
  29789. return
  29790. }
  29791. var on = vnode.data.on || {};
  29792. var oldOn = oldVnode.data.on || {};
  29793. target$1 = vnode.elm;
  29794. updateListeners(on, oldOn, add$2, remove$3, vnode.context);
  29795. }
  29796. var events = {
  29797. create: updateDOMListeners,
  29798. update: updateDOMListeners
  29799. };
  29800. /* */
  29801. function updateDOMProps (oldVnode, vnode) {
  29802. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  29803. return
  29804. }
  29805. var key, cur;
  29806. var elm = vnode.elm;
  29807. var oldProps = oldVnode.data.domProps || {};
  29808. var props = vnode.data.domProps || {};
  29809. // clone observed objects, as the user probably wants to mutate it
  29810. if (props.__ob__) {
  29811. props = vnode.data.domProps = extend({}, props);
  29812. }
  29813. for (key in oldProps) {
  29814. if (props[key] == null) {
  29815. elm[key] = '';
  29816. }
  29817. }
  29818. for (key in props) {
  29819. cur = props[key];
  29820. // ignore children if the node has textContent or innerHTML,
  29821. // as these will throw away existing DOM nodes and cause removal errors
  29822. // on subsequent patches (#3360)
  29823. if (key === 'textContent' || key === 'innerHTML') {
  29824. if (vnode.children) { vnode.children.length = 0; }
  29825. if (cur === oldProps[key]) { continue }
  29826. }
  29827. if (key === 'value') {
  29828. // store value as _value as well since
  29829. // non-string values will be stringified
  29830. elm._value = cur;
  29831. // avoid resetting cursor position when value is the same
  29832. var strCur = cur == null ? '' : String(cur);
  29833. if (shouldUpdateValue(elm, vnode, strCur)) {
  29834. elm.value = strCur;
  29835. }
  29836. } else {
  29837. elm[key] = cur;
  29838. }
  29839. }
  29840. }
  29841. // check platforms/web/util/attrs.js acceptValue
  29842. function shouldUpdateValue (
  29843. elm,
  29844. vnode,
  29845. checkVal
  29846. ) {
  29847. return (!elm.composing && (
  29848. vnode.tag === 'option' ||
  29849. isDirty(elm, checkVal) ||
  29850. isInputChanged(vnode, checkVal)
  29851. ))
  29852. }
  29853. function isDirty (elm, checkVal) {
  29854. // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
  29855. return document.activeElement !== elm && elm.value !== checkVal
  29856. }
  29857. function isInputChanged (vnode, newVal) {
  29858. var value = vnode.elm.value;
  29859. var modifiers = vnode.elm._vModifiers; // injected by v-model runtime
  29860. if ((modifiers && modifiers.number) || vnode.elm.type === 'number') {
  29861. return toNumber(value) !== toNumber(newVal)
  29862. }
  29863. if (modifiers && modifiers.trim) {
  29864. return value.trim() !== newVal.trim()
  29865. }
  29866. return value !== newVal
  29867. }
  29868. var domProps = {
  29869. create: updateDOMProps,
  29870. update: updateDOMProps
  29871. };
  29872. /* */
  29873. var parseStyleText = cached(function (cssText) {
  29874. var res = {};
  29875. var listDelimiter = /;(?![^(]*\))/g;
  29876. var propertyDelimiter = /:(.+)/;
  29877. cssText.split(listDelimiter).forEach(function (item) {
  29878. if (item) {
  29879. var tmp = item.split(propertyDelimiter);
  29880. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  29881. }
  29882. });
  29883. return res
  29884. });
  29885. // merge static and dynamic style data on the same vnode
  29886. function normalizeStyleData (data) {
  29887. var style = normalizeStyleBinding(data.style);
  29888. // static style is pre-processed into an object during compilation
  29889. // and is always a fresh object, so it's safe to merge into it
  29890. return data.staticStyle
  29891. ? extend(data.staticStyle, style)
  29892. : style
  29893. }
  29894. // normalize possible array / string values into Object
  29895. function normalizeStyleBinding (bindingStyle) {
  29896. if (Array.isArray(bindingStyle)) {
  29897. return toObject(bindingStyle)
  29898. }
  29899. if (typeof bindingStyle === 'string') {
  29900. return parseStyleText(bindingStyle)
  29901. }
  29902. return bindingStyle
  29903. }
  29904. /**
  29905. * parent component style should be after child's
  29906. * so that parent component's style could override it
  29907. */
  29908. function getStyle (vnode, checkChild) {
  29909. var res = {};
  29910. var styleData;
  29911. if (checkChild) {
  29912. var childNode = vnode;
  29913. while (childNode.componentInstance) {
  29914. childNode = childNode.componentInstance._vnode;
  29915. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  29916. extend(res, styleData);
  29917. }
  29918. }
  29919. }
  29920. if ((styleData = normalizeStyleData(vnode.data))) {
  29921. extend(res, styleData);
  29922. }
  29923. var parentNode = vnode;
  29924. while ((parentNode = parentNode.parent)) {
  29925. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  29926. extend(res, styleData);
  29927. }
  29928. }
  29929. return res
  29930. }
  29931. /* */
  29932. var cssVarRE = /^--/;
  29933. var importantRE = /\s*!important$/;
  29934. var setProp = function (el, name, val) {
  29935. /* istanbul ignore if */
  29936. if (cssVarRE.test(name)) {
  29937. el.style.setProperty(name, val);
  29938. } else if (importantRE.test(val)) {
  29939. el.style.setProperty(name, val.replace(importantRE, ''), 'important');
  29940. } else {
  29941. el.style[normalize(name)] = val;
  29942. }
  29943. };
  29944. var prefixes = ['Webkit', 'Moz', 'ms'];
  29945. var testEl;
  29946. var normalize = cached(function (prop) {
  29947. testEl = testEl || document.createElement('div');
  29948. prop = camelize(prop);
  29949. if (prop !== 'filter' && (prop in testEl.style)) {
  29950. return prop
  29951. }
  29952. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  29953. for (var i = 0; i < prefixes.length; i++) {
  29954. var prefixed = prefixes[i] + upper;
  29955. if (prefixed in testEl.style) {
  29956. return prefixed
  29957. }
  29958. }
  29959. });
  29960. function updateStyle (oldVnode, vnode) {
  29961. var data = vnode.data;
  29962. var oldData = oldVnode.data;
  29963. if (!data.staticStyle && !data.style &&
  29964. !oldData.staticStyle && !oldData.style) {
  29965. return
  29966. }
  29967. var cur, name;
  29968. var el = vnode.elm;
  29969. var oldStaticStyle = oldVnode.data.staticStyle;
  29970. var oldStyleBinding = oldVnode.data.style || {};
  29971. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  29972. var oldStyle = oldStaticStyle || oldStyleBinding;
  29973. var style = normalizeStyleBinding(vnode.data.style) || {};
  29974. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  29975. var newStyle = getStyle(vnode, true);
  29976. for (name in oldStyle) {
  29977. if (newStyle[name] == null) {
  29978. setProp(el, name, '');
  29979. }
  29980. }
  29981. for (name in newStyle) {
  29982. cur = newStyle[name];
  29983. if (cur !== oldStyle[name]) {
  29984. // ie9 setting to null has no effect, must use empty string
  29985. setProp(el, name, cur == null ? '' : cur);
  29986. }
  29987. }
  29988. }
  29989. var style = {
  29990. create: updateStyle,
  29991. update: updateStyle
  29992. };
  29993. /* */
  29994. /**
  29995. * Add class with compatibility for SVG since classList is not supported on
  29996. * SVG elements in IE
  29997. */
  29998. function addClass (el, cls) {
  29999. /* istanbul ignore if */
  30000. if (!cls || !cls.trim()) {
  30001. return
  30002. }
  30003. /* istanbul ignore else */
  30004. if (el.classList) {
  30005. if (cls.indexOf(' ') > -1) {
  30006. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  30007. } else {
  30008. el.classList.add(cls);
  30009. }
  30010. } else {
  30011. var cur = ' ' + el.getAttribute('class') + ' ';
  30012. if (cur.indexOf(' ' + cls + ' ') < 0) {
  30013. el.setAttribute('class', (cur + cls).trim());
  30014. }
  30015. }
  30016. }
  30017. /**
  30018. * Remove class with compatibility for SVG since classList is not supported on
  30019. * SVG elements in IE
  30020. */
  30021. function removeClass (el, cls) {
  30022. /* istanbul ignore if */
  30023. if (!cls || !cls.trim()) {
  30024. return
  30025. }
  30026. /* istanbul ignore else */
  30027. if (el.classList) {
  30028. if (cls.indexOf(' ') > -1) {
  30029. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  30030. } else {
  30031. el.classList.remove(cls);
  30032. }
  30033. } else {
  30034. var cur = ' ' + el.getAttribute('class') + ' ';
  30035. var tar = ' ' + cls + ' ';
  30036. while (cur.indexOf(tar) >= 0) {
  30037. cur = cur.replace(tar, ' ');
  30038. }
  30039. el.setAttribute('class', cur.trim());
  30040. }
  30041. }
  30042. /* */
  30043. var hasTransition = inBrowser && !isIE9;
  30044. var TRANSITION = 'transition';
  30045. var ANIMATION = 'animation';
  30046. // Transition property/event sniffing
  30047. var transitionProp = 'transition';
  30048. var transitionEndEvent = 'transitionend';
  30049. var animationProp = 'animation';
  30050. var animationEndEvent = 'animationend';
  30051. if (hasTransition) {
  30052. /* istanbul ignore if */
  30053. if (window.ontransitionend === undefined &&
  30054. window.onwebkittransitionend !== undefined) {
  30055. transitionProp = 'WebkitTransition';
  30056. transitionEndEvent = 'webkitTransitionEnd';
  30057. }
  30058. if (window.onanimationend === undefined &&
  30059. window.onwebkitanimationend !== undefined) {
  30060. animationProp = 'WebkitAnimation';
  30061. animationEndEvent = 'webkitAnimationEnd';
  30062. }
  30063. }
  30064. // binding to window is necessary to make hot reload work in IE in strict mode
  30065. var raf = inBrowser && window.requestAnimationFrame
  30066. ? window.requestAnimationFrame.bind(window)
  30067. : setTimeout;
  30068. function nextFrame (fn) {
  30069. raf(function () {
  30070. raf(fn);
  30071. });
  30072. }
  30073. function addTransitionClass (el, cls) {
  30074. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  30075. addClass(el, cls);
  30076. }
  30077. function removeTransitionClass (el, cls) {
  30078. if (el._transitionClasses) {
  30079. remove$1(el._transitionClasses, cls);
  30080. }
  30081. removeClass(el, cls);
  30082. }
  30083. function whenTransitionEnds (
  30084. el,
  30085. expectedType,
  30086. cb
  30087. ) {
  30088. var ref = getTransitionInfo(el, expectedType);
  30089. var type = ref.type;
  30090. var timeout = ref.timeout;
  30091. var propCount = ref.propCount;
  30092. if (!type) { return cb() }
  30093. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  30094. var ended = 0;
  30095. var end = function () {
  30096. el.removeEventListener(event, onEnd);
  30097. cb();
  30098. };
  30099. var onEnd = function (e) {
  30100. if (e.target === el) {
  30101. if (++ended >= propCount) {
  30102. end();
  30103. }
  30104. }
  30105. };
  30106. setTimeout(function () {
  30107. if (ended < propCount) {
  30108. end();
  30109. }
  30110. }, timeout + 1);
  30111. el.addEventListener(event, onEnd);
  30112. }
  30113. var transformRE = /\b(transform|all)(,|$)/;
  30114. function getTransitionInfo (el, expectedType) {
  30115. var styles = window.getComputedStyle(el);
  30116. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  30117. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  30118. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  30119. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  30120. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  30121. var animationTimeout = getTimeout(animationDelays, animationDurations);
  30122. var type;
  30123. var timeout = 0;
  30124. var propCount = 0;
  30125. /* istanbul ignore if */
  30126. if (expectedType === TRANSITION) {
  30127. if (transitionTimeout > 0) {
  30128. type = TRANSITION;
  30129. timeout = transitionTimeout;
  30130. propCount = transitionDurations.length;
  30131. }
  30132. } else if (expectedType === ANIMATION) {
  30133. if (animationTimeout > 0) {
  30134. type = ANIMATION;
  30135. timeout = animationTimeout;
  30136. propCount = animationDurations.length;
  30137. }
  30138. } else {
  30139. timeout = Math.max(transitionTimeout, animationTimeout);
  30140. type = timeout > 0
  30141. ? transitionTimeout > animationTimeout
  30142. ? TRANSITION
  30143. : ANIMATION
  30144. : null;
  30145. propCount = type
  30146. ? type === TRANSITION
  30147. ? transitionDurations.length
  30148. : animationDurations.length
  30149. : 0;
  30150. }
  30151. var hasTransform =
  30152. type === TRANSITION &&
  30153. transformRE.test(styles[transitionProp + 'Property']);
  30154. return {
  30155. type: type,
  30156. timeout: timeout,
  30157. propCount: propCount,
  30158. hasTransform: hasTransform
  30159. }
  30160. }
  30161. function getTimeout (delays, durations) {
  30162. /* istanbul ignore next */
  30163. while (delays.length < durations.length) {
  30164. delays = delays.concat(delays);
  30165. }
  30166. return Math.max.apply(null, durations.map(function (d, i) {
  30167. return toMs(d) + toMs(delays[i])
  30168. }))
  30169. }
  30170. function toMs (s) {
  30171. return Number(s.slice(0, -1)) * 1000
  30172. }
  30173. /* */
  30174. function enter (vnode, toggleDisplay) {
  30175. var el = vnode.elm;
  30176. // call leave callback now
  30177. if (el._leaveCb) {
  30178. el._leaveCb.cancelled = true;
  30179. el._leaveCb();
  30180. }
  30181. var data = resolveTransition(vnode.data.transition);
  30182. if (!data) {
  30183. return
  30184. }
  30185. /* istanbul ignore if */
  30186. if (el._enterCb || el.nodeType !== 1) {
  30187. return
  30188. }
  30189. var css = data.css;
  30190. var type = data.type;
  30191. var enterClass = data.enterClass;
  30192. var enterToClass = data.enterToClass;
  30193. var enterActiveClass = data.enterActiveClass;
  30194. var appearClass = data.appearClass;
  30195. var appearToClass = data.appearToClass;
  30196. var appearActiveClass = data.appearActiveClass;
  30197. var beforeEnter = data.beforeEnter;
  30198. var enter = data.enter;
  30199. var afterEnter = data.afterEnter;
  30200. var enterCancelled = data.enterCancelled;
  30201. var beforeAppear = data.beforeAppear;
  30202. var appear = data.appear;
  30203. var afterAppear = data.afterAppear;
  30204. var appearCancelled = data.appearCancelled;
  30205. // activeInstance will always be the <transition> component managing this
  30206. // transition. One edge case to check is when the <transition> is placed
  30207. // as the root node of a child component. In that case we need to check
  30208. // <transition>'s parent for appear check.
  30209. var context = activeInstance;
  30210. var transitionNode = activeInstance.$vnode;
  30211. while (transitionNode && transitionNode.parent) {
  30212. transitionNode = transitionNode.parent;
  30213. context = transitionNode.context;
  30214. }
  30215. var isAppear = !context._isMounted || !vnode.isRootInsert;
  30216. if (isAppear && !appear && appear !== '') {
  30217. return
  30218. }
  30219. var startClass = isAppear ? appearClass : enterClass;
  30220. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  30221. var toClass = isAppear ? appearToClass : enterToClass;
  30222. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  30223. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  30224. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  30225. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  30226. var expectsCSS = css !== false && !isIE9;
  30227. var userWantsControl =
  30228. enterHook &&
  30229. // enterHook may be a bound method which exposes
  30230. // the length of original fn as _length
  30231. (enterHook._length || enterHook.length) > 1;
  30232. var cb = el._enterCb = once(function () {
  30233. if (expectsCSS) {
  30234. removeTransitionClass(el, toClass);
  30235. removeTransitionClass(el, activeClass);
  30236. }
  30237. if (cb.cancelled) {
  30238. if (expectsCSS) {
  30239. removeTransitionClass(el, startClass);
  30240. }
  30241. enterCancelledHook && enterCancelledHook(el);
  30242. } else {
  30243. afterEnterHook && afterEnterHook(el);
  30244. }
  30245. el._enterCb = null;
  30246. });
  30247. if (!vnode.data.show) {
  30248. // remove pending leave element on enter by injecting an insert hook
  30249. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  30250. var parent = el.parentNode;
  30251. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  30252. if (pendingNode &&
  30253. pendingNode.tag === vnode.tag &&
  30254. pendingNode.elm._leaveCb) {
  30255. pendingNode.elm._leaveCb();
  30256. }
  30257. enterHook && enterHook(el, cb);
  30258. }, 'transition-insert');
  30259. }
  30260. // start enter transition
  30261. beforeEnterHook && beforeEnterHook(el);
  30262. if (expectsCSS) {
  30263. addTransitionClass(el, startClass);
  30264. addTransitionClass(el, activeClass);
  30265. nextFrame(function () {
  30266. addTransitionClass(el, toClass);
  30267. removeTransitionClass(el, startClass);
  30268. if (!cb.cancelled && !userWantsControl) {
  30269. whenTransitionEnds(el, type, cb);
  30270. }
  30271. });
  30272. }
  30273. if (vnode.data.show) {
  30274. toggleDisplay && toggleDisplay();
  30275. enterHook && enterHook(el, cb);
  30276. }
  30277. if (!expectsCSS && !userWantsControl) {
  30278. cb();
  30279. }
  30280. }
  30281. function leave (vnode, rm) {
  30282. var el = vnode.elm;
  30283. // call enter callback now
  30284. if (el._enterCb) {
  30285. el._enterCb.cancelled = true;
  30286. el._enterCb();
  30287. }
  30288. var data = resolveTransition(vnode.data.transition);
  30289. if (!data) {
  30290. return rm()
  30291. }
  30292. /* istanbul ignore if */
  30293. if (el._leaveCb || el.nodeType !== 1) {
  30294. return
  30295. }
  30296. var css = data.css;
  30297. var type = data.type;
  30298. var leaveClass = data.leaveClass;
  30299. var leaveToClass = data.leaveToClass;
  30300. var leaveActiveClass = data.leaveActiveClass;
  30301. var beforeLeave = data.beforeLeave;
  30302. var leave = data.leave;
  30303. var afterLeave = data.afterLeave;
  30304. var leaveCancelled = data.leaveCancelled;
  30305. var delayLeave = data.delayLeave;
  30306. var expectsCSS = css !== false && !isIE9;
  30307. var userWantsControl =
  30308. leave &&
  30309. // leave hook may be a bound method which exposes
  30310. // the length of original fn as _length
  30311. (leave._length || leave.length) > 1;
  30312. var cb = el._leaveCb = once(function () {
  30313. if (el.parentNode && el.parentNode._pending) {
  30314. el.parentNode._pending[vnode.key] = null;
  30315. }
  30316. if (expectsCSS) {
  30317. removeTransitionClass(el, leaveToClass);
  30318. removeTransitionClass(el, leaveActiveClass);
  30319. }
  30320. if (cb.cancelled) {
  30321. if (expectsCSS) {
  30322. removeTransitionClass(el, leaveClass);
  30323. }
  30324. leaveCancelled && leaveCancelled(el);
  30325. } else {
  30326. rm();
  30327. afterLeave && afterLeave(el);
  30328. }
  30329. el._leaveCb = null;
  30330. });
  30331. if (delayLeave) {
  30332. delayLeave(performLeave);
  30333. } else {
  30334. performLeave();
  30335. }
  30336. function performLeave () {
  30337. // the delayed leave may have already been cancelled
  30338. if (cb.cancelled) {
  30339. return
  30340. }
  30341. // record leaving element
  30342. if (!vnode.data.show) {
  30343. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  30344. }
  30345. beforeLeave && beforeLeave(el);
  30346. if (expectsCSS) {
  30347. addTransitionClass(el, leaveClass);
  30348. addTransitionClass(el, leaveActiveClass);
  30349. nextFrame(function () {
  30350. addTransitionClass(el, leaveToClass);
  30351. removeTransitionClass(el, leaveClass);
  30352. if (!cb.cancelled && !userWantsControl) {
  30353. whenTransitionEnds(el, type, cb);
  30354. }
  30355. });
  30356. }
  30357. leave && leave(el, cb);
  30358. if (!expectsCSS && !userWantsControl) {
  30359. cb();
  30360. }
  30361. }
  30362. }
  30363. function resolveTransition (def$$1) {
  30364. if (!def$$1) {
  30365. return
  30366. }
  30367. /* istanbul ignore else */
  30368. if (typeof def$$1 === 'object') {
  30369. var res = {};
  30370. if (def$$1.css !== false) {
  30371. extend(res, autoCssTransition(def$$1.name || 'v'));
  30372. }
  30373. extend(res, def$$1);
  30374. return res
  30375. } else if (typeof def$$1 === 'string') {
  30376. return autoCssTransition(def$$1)
  30377. }
  30378. }
  30379. var autoCssTransition = cached(function (name) {
  30380. return {
  30381. enterClass: (name + "-enter"),
  30382. leaveClass: (name + "-leave"),
  30383. appearClass: (name + "-enter"),
  30384. enterToClass: (name + "-enter-to"),
  30385. leaveToClass: (name + "-leave-to"),
  30386. appearToClass: (name + "-enter-to"),
  30387. enterActiveClass: (name + "-enter-active"),
  30388. leaveActiveClass: (name + "-leave-active"),
  30389. appearActiveClass: (name + "-enter-active")
  30390. }
  30391. });
  30392. function once (fn) {
  30393. var called = false;
  30394. return function () {
  30395. if (!called) {
  30396. called = true;
  30397. fn();
  30398. }
  30399. }
  30400. }
  30401. function _enter (_, vnode) {
  30402. if (!vnode.data.show) {
  30403. enter(vnode);
  30404. }
  30405. }
  30406. var transition = inBrowser ? {
  30407. create: _enter,
  30408. activate: _enter,
  30409. remove: function remove (vnode, rm) {
  30410. /* istanbul ignore else */
  30411. if (!vnode.data.show) {
  30412. leave(vnode, rm);
  30413. } else {
  30414. rm();
  30415. }
  30416. }
  30417. } : {};
  30418. var platformModules = [
  30419. attrs,
  30420. klass,
  30421. events,
  30422. domProps,
  30423. style,
  30424. transition
  30425. ];
  30426. /* */
  30427. // the directive module should be applied last, after all
  30428. // built-in modules have been applied.
  30429. var modules = platformModules.concat(baseModules);
  30430. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  30431. /**
  30432. * Not type checking this file because flow doesn't like attaching
  30433. * properties to Elements.
  30434. */
  30435. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  30436. /* istanbul ignore if */
  30437. if (isIE9) {
  30438. // http://www.matts411.com/post/internet-explorer-9-oninput/
  30439. document.addEventListener('selectionchange', function () {
  30440. var el = document.activeElement;
  30441. if (el && el.vmodel) {
  30442. trigger(el, 'input');
  30443. }
  30444. });
  30445. }
  30446. var model = {
  30447. inserted: function inserted (el, binding, vnode) {
  30448. if (process.env.NODE_ENV !== 'production') {
  30449. if (!modelableTagRE.test(vnode.tag)) {
  30450. warn(
  30451. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  30452. 'If you are working with contenteditable, it\'s recommended to ' +
  30453. 'wrap a library dedicated for that purpose inside a custom component.',
  30454. vnode.context
  30455. );
  30456. }
  30457. }
  30458. if (vnode.tag === 'select') {
  30459. var cb = function () {
  30460. setSelected(el, binding, vnode.context);
  30461. };
  30462. cb();
  30463. /* istanbul ignore if */
  30464. if (isIE || isEdge) {
  30465. setTimeout(cb, 0);
  30466. }
  30467. } else if (vnode.tag === 'textarea' || el.type === 'text') {
  30468. el._vModifiers = binding.modifiers;
  30469. if (!binding.modifiers.lazy) {
  30470. if (!isAndroid) {
  30471. el.addEventListener('compositionstart', onCompositionStart);
  30472. el.addEventListener('compositionend', onCompositionEnd);
  30473. }
  30474. /* istanbul ignore if */
  30475. if (isIE9) {
  30476. el.vmodel = true;
  30477. }
  30478. }
  30479. }
  30480. },
  30481. componentUpdated: function componentUpdated (el, binding, vnode) {
  30482. if (vnode.tag === 'select') {
  30483. setSelected(el, binding, vnode.context);
  30484. // in case the options rendered by v-for have changed,
  30485. // it's possible that the value is out-of-sync with the rendered options.
  30486. // detect such cases and filter out values that no longer has a matching
  30487. // option in the DOM.
  30488. var needReset = el.multiple
  30489. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  30490. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  30491. if (needReset) {
  30492. trigger(el, 'change');
  30493. }
  30494. }
  30495. }
  30496. };
  30497. function setSelected (el, binding, vm) {
  30498. var value = binding.value;
  30499. var isMultiple = el.multiple;
  30500. if (isMultiple && !Array.isArray(value)) {
  30501. process.env.NODE_ENV !== 'production' && warn(
  30502. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  30503. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  30504. vm
  30505. );
  30506. return
  30507. }
  30508. var selected, option;
  30509. for (var i = 0, l = el.options.length; i < l; i++) {
  30510. option = el.options[i];
  30511. if (isMultiple) {
  30512. selected = looseIndexOf(value, getValue(option)) > -1;
  30513. if (option.selected !== selected) {
  30514. option.selected = selected;
  30515. }
  30516. } else {
  30517. if (looseEqual(getValue(option), value)) {
  30518. if (el.selectedIndex !== i) {
  30519. el.selectedIndex = i;
  30520. }
  30521. return
  30522. }
  30523. }
  30524. }
  30525. if (!isMultiple) {
  30526. el.selectedIndex = -1;
  30527. }
  30528. }
  30529. function hasNoMatchingOption (value, options) {
  30530. for (var i = 0, l = options.length; i < l; i++) {
  30531. if (looseEqual(getValue(options[i]), value)) {
  30532. return false
  30533. }
  30534. }
  30535. return true
  30536. }
  30537. function getValue (option) {
  30538. return '_value' in option
  30539. ? option._value
  30540. : option.value
  30541. }
  30542. function onCompositionStart (e) {
  30543. e.target.composing = true;
  30544. }
  30545. function onCompositionEnd (e) {
  30546. e.target.composing = false;
  30547. trigger(e.target, 'input');
  30548. }
  30549. function trigger (el, type) {
  30550. var e = document.createEvent('HTMLEvents');
  30551. e.initEvent(type, true, true);
  30552. el.dispatchEvent(e);
  30553. }
  30554. /* */
  30555. // recursively search for possible transition defined inside the component root
  30556. function locateNode (vnode) {
  30557. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  30558. ? locateNode(vnode.componentInstance._vnode)
  30559. : vnode
  30560. }
  30561. var show = {
  30562. bind: function bind (el, ref, vnode) {
  30563. var value = ref.value;
  30564. vnode = locateNode(vnode);
  30565. var transition = vnode.data && vnode.data.transition;
  30566. var originalDisplay = el.__vOriginalDisplay =
  30567. el.style.display === 'none' ? '' : el.style.display;
  30568. if (value && transition && !isIE9) {
  30569. vnode.data.show = true;
  30570. enter(vnode, function () {
  30571. el.style.display = originalDisplay;
  30572. });
  30573. } else {
  30574. el.style.display = value ? originalDisplay : 'none';
  30575. }
  30576. },
  30577. update: function update (el, ref, vnode) {
  30578. var value = ref.value;
  30579. var oldValue = ref.oldValue;
  30580. /* istanbul ignore if */
  30581. if (value === oldValue) { return }
  30582. vnode = locateNode(vnode);
  30583. var transition = vnode.data && vnode.data.transition;
  30584. if (transition && !isIE9) {
  30585. vnode.data.show = true;
  30586. if (value) {
  30587. enter(vnode, function () {
  30588. el.style.display = el.__vOriginalDisplay;
  30589. });
  30590. } else {
  30591. leave(vnode, function () {
  30592. el.style.display = 'none';
  30593. });
  30594. }
  30595. } else {
  30596. el.style.display = value ? el.__vOriginalDisplay : 'none';
  30597. }
  30598. },
  30599. unbind: function unbind (
  30600. el,
  30601. binding,
  30602. vnode,
  30603. oldVnode,
  30604. isDestroy
  30605. ) {
  30606. if (!isDestroy) {
  30607. el.style.display = el.__vOriginalDisplay;
  30608. }
  30609. }
  30610. };
  30611. var platformDirectives = {
  30612. model: model,
  30613. show: show
  30614. };
  30615. /* */
  30616. // Provides transition support for a single element/component.
  30617. // supports transition mode (out-in / in-out)
  30618. var transitionProps = {
  30619. name: String,
  30620. appear: Boolean,
  30621. css: Boolean,
  30622. mode: String,
  30623. type: String,
  30624. enterClass: String,
  30625. leaveClass: String,
  30626. enterToClass: String,
  30627. leaveToClass: String,
  30628. enterActiveClass: String,
  30629. leaveActiveClass: String,
  30630. appearClass: String,
  30631. appearActiveClass: String,
  30632. appearToClass: String
  30633. };
  30634. // in case the child is also an abstract component, e.g. <keep-alive>
  30635. // we want to recursively retrieve the real component to be rendered
  30636. function getRealChild (vnode) {
  30637. var compOptions = vnode && vnode.componentOptions;
  30638. if (compOptions && compOptions.Ctor.options.abstract) {
  30639. return getRealChild(getFirstComponentChild(compOptions.children))
  30640. } else {
  30641. return vnode
  30642. }
  30643. }
  30644. function extractTransitionData (comp) {
  30645. var data = {};
  30646. var options = comp.$options;
  30647. // props
  30648. for (var key in options.propsData) {
  30649. data[key] = comp[key];
  30650. }
  30651. // events.
  30652. // extract listeners and pass them directly to the transition methods
  30653. var listeners = options._parentListeners;
  30654. for (var key$1 in listeners) {
  30655. data[camelize(key$1)] = listeners[key$1].fn;
  30656. }
  30657. return data
  30658. }
  30659. function placeholder (h, rawChild) {
  30660. return /\d-keep-alive$/.test(rawChild.tag)
  30661. ? h('keep-alive')
  30662. : null
  30663. }
  30664. function hasParentTransition (vnode) {
  30665. while ((vnode = vnode.parent)) {
  30666. if (vnode.data.transition) {
  30667. return true
  30668. }
  30669. }
  30670. }
  30671. function isSameChild (child, oldChild) {
  30672. return oldChild.key === child.key && oldChild.tag === child.tag
  30673. }
  30674. var Transition = {
  30675. name: 'transition',
  30676. props: transitionProps,
  30677. abstract: true,
  30678. render: function render (h) {
  30679. var this$1 = this;
  30680. var children = this.$slots.default;
  30681. if (!children) {
  30682. return
  30683. }
  30684. // filter out text nodes (possible whitespaces)
  30685. children = children.filter(function (c) { return c.tag; });
  30686. /* istanbul ignore if */
  30687. if (!children.length) {
  30688. return
  30689. }
  30690. // warn multiple elements
  30691. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  30692. warn(
  30693. '<transition> can only be used on a single element. Use ' +
  30694. '<transition-group> for lists.',
  30695. this.$parent
  30696. );
  30697. }
  30698. var mode = this.mode;
  30699. // warn invalid mode
  30700. if (process.env.NODE_ENV !== 'production' &&
  30701. mode && mode !== 'in-out' && mode !== 'out-in') {
  30702. warn(
  30703. 'invalid <transition> mode: ' + mode,
  30704. this.$parent
  30705. );
  30706. }
  30707. var rawChild = children[0];
  30708. // if this is a component root node and the component's
  30709. // parent container node also has transition, skip.
  30710. if (hasParentTransition(this.$vnode)) {
  30711. return rawChild
  30712. }
  30713. // apply transition data to child
  30714. // use getRealChild() to ignore abstract components e.g. keep-alive
  30715. var child = getRealChild(rawChild);
  30716. /* istanbul ignore if */
  30717. if (!child) {
  30718. return rawChild
  30719. }
  30720. if (this._leaving) {
  30721. return placeholder(h, rawChild)
  30722. }
  30723. // ensure a key that is unique to the vnode type and to this transition
  30724. // component instance. This key will be used to remove pending leaving nodes
  30725. // during entering.
  30726. var id = "__transition-" + (this._uid) + "-";
  30727. var key = child.key = child.key == null
  30728. ? id + child.tag
  30729. : isPrimitive(child.key)
  30730. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  30731. : child.key;
  30732. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  30733. var oldRawChild = this._vnode;
  30734. var oldChild = getRealChild(oldRawChild);
  30735. // mark v-show
  30736. // so that the transition module can hand over the control to the directive
  30737. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  30738. child.data.show = true;
  30739. }
  30740. if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
  30741. // replace old child transition data with fresh one
  30742. // important for dynamic transitions!
  30743. var oldData = oldChild && (oldChild.data.transition = extend({}, data));
  30744. // handle transition mode
  30745. if (mode === 'out-in') {
  30746. // return placeholder node and queue update when leave finishes
  30747. this._leaving = true;
  30748. mergeVNodeHook(oldData, 'afterLeave', function () {
  30749. this$1._leaving = false;
  30750. this$1.$forceUpdate();
  30751. }, key);
  30752. return placeholder(h, rawChild)
  30753. } else if (mode === 'in-out') {
  30754. var delayedLeave;
  30755. var performLeave = function () { delayedLeave(); };
  30756. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  30757. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  30758. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  30759. delayedLeave = leave;
  30760. }, key);
  30761. }
  30762. }
  30763. return rawChild
  30764. }
  30765. };
  30766. /* */
  30767. // Provides transition support for list items.
  30768. // supports move transitions using the FLIP technique.
  30769. // Because the vdom's children update algorithm is "unstable" - i.e.
  30770. // it doesn't guarantee the relative positioning of removed elements,
  30771. // we force transition-group to update its children into two passes:
  30772. // in the first pass, we remove all nodes that need to be removed,
  30773. // triggering their leaving transition; in the second pass, we insert/move
  30774. // into the final disired state. This way in the second pass removed
  30775. // nodes will remain where they should be.
  30776. var props = extend({
  30777. tag: String,
  30778. moveClass: String
  30779. }, transitionProps);
  30780. delete props.mode;
  30781. var TransitionGroup = {
  30782. props: props,
  30783. render: function render (h) {
  30784. var tag = this.tag || this.$vnode.data.tag || 'span';
  30785. var map = Object.create(null);
  30786. var prevChildren = this.prevChildren = this.children;
  30787. var rawChildren = this.$slots.default || [];
  30788. var children = this.children = [];
  30789. var transitionData = extractTransitionData(this);
  30790. for (var i = 0; i < rawChildren.length; i++) {
  30791. var c = rawChildren[i];
  30792. if (c.tag) {
  30793. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  30794. children.push(c);
  30795. map[c.key] = c
  30796. ;(c.data || (c.data = {})).transition = transitionData;
  30797. } else if (process.env.NODE_ENV !== 'production') {
  30798. var opts = c.componentOptions;
  30799. var name = opts
  30800. ? (opts.Ctor.options.name || opts.tag)
  30801. : c.tag;
  30802. warn(("<transition-group> children must be keyed: <" + name + ">"));
  30803. }
  30804. }
  30805. }
  30806. if (prevChildren) {
  30807. var kept = [];
  30808. var removed = [];
  30809. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  30810. var c$1 = prevChildren[i$1];
  30811. c$1.data.transition = transitionData;
  30812. c$1.data.pos = c$1.elm.getBoundingClientRect();
  30813. if (map[c$1.key]) {
  30814. kept.push(c$1);
  30815. } else {
  30816. removed.push(c$1);
  30817. }
  30818. }
  30819. this.kept = h(tag, null, kept);
  30820. this.removed = removed;
  30821. }
  30822. return h(tag, null, children)
  30823. },
  30824. beforeUpdate: function beforeUpdate () {
  30825. // force removing pass
  30826. this.__patch__(
  30827. this._vnode,
  30828. this.kept,
  30829. false, // hydrating
  30830. true // removeOnly (!important, avoids unnecessary moves)
  30831. );
  30832. this._vnode = this.kept;
  30833. },
  30834. updated: function updated () {
  30835. var children = this.prevChildren;
  30836. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  30837. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  30838. return
  30839. }
  30840. // we divide the work into three loops to avoid mixing DOM reads and writes
  30841. // in each iteration - which helps prevent layout thrashing.
  30842. children.forEach(callPendingCbs);
  30843. children.forEach(recordPosition);
  30844. children.forEach(applyTranslation);
  30845. // force reflow to put everything in position
  30846. var f = document.body.offsetHeight; // eslint-disable-line
  30847. children.forEach(function (c) {
  30848. if (c.data.moved) {
  30849. var el = c.elm;
  30850. var s = el.style;
  30851. addTransitionClass(el, moveClass);
  30852. s.transform = s.WebkitTransform = s.transitionDuration = '';
  30853. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  30854. if (!e || /transform$/.test(e.propertyName)) {
  30855. el.removeEventListener(transitionEndEvent, cb);
  30856. el._moveCb = null;
  30857. removeTransitionClass(el, moveClass);
  30858. }
  30859. });
  30860. }
  30861. });
  30862. },
  30863. methods: {
  30864. hasMove: function hasMove (el, moveClass) {
  30865. /* istanbul ignore if */
  30866. if (!hasTransition) {
  30867. return false
  30868. }
  30869. if (this._hasMove != null) {
  30870. return this._hasMove
  30871. }
  30872. addTransitionClass(el, moveClass);
  30873. var info = getTransitionInfo(el);
  30874. removeTransitionClass(el, moveClass);
  30875. return (this._hasMove = info.hasTransform)
  30876. }
  30877. }
  30878. };
  30879. function callPendingCbs (c) {
  30880. /* istanbul ignore if */
  30881. if (c.elm._moveCb) {
  30882. c.elm._moveCb();
  30883. }
  30884. /* istanbul ignore if */
  30885. if (c.elm._enterCb) {
  30886. c.elm._enterCb();
  30887. }
  30888. }
  30889. function recordPosition (c) {
  30890. c.data.newPos = c.elm.getBoundingClientRect();
  30891. }
  30892. function applyTranslation (c) {
  30893. var oldPos = c.data.pos;
  30894. var newPos = c.data.newPos;
  30895. var dx = oldPos.left - newPos.left;
  30896. var dy = oldPos.top - newPos.top;
  30897. if (dx || dy) {
  30898. c.data.moved = true;
  30899. var s = c.elm.style;
  30900. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  30901. s.transitionDuration = '0s';
  30902. }
  30903. }
  30904. var platformComponents = {
  30905. Transition: Transition,
  30906. TransitionGroup: TransitionGroup
  30907. };
  30908. /* */
  30909. // install platform specific utils
  30910. Vue$3.config.isUnknownElement = isUnknownElement;
  30911. Vue$3.config.isReservedTag = isReservedTag;
  30912. Vue$3.config.getTagNamespace = getTagNamespace;
  30913. Vue$3.config.mustUseProp = mustUseProp;
  30914. // install platform runtime directives & components
  30915. extend(Vue$3.options.directives, platformDirectives);
  30916. extend(Vue$3.options.components, platformComponents);
  30917. // install platform patch function
  30918. Vue$3.prototype.__patch__ = inBrowser ? patch$1 : noop;
  30919. // wrap mount
  30920. Vue$3.prototype.$mount = function (
  30921. el,
  30922. hydrating
  30923. ) {
  30924. el = el && inBrowser ? query(el) : undefined;
  30925. return this._mount(el, hydrating)
  30926. };
  30927. if (process.env.NODE_ENV !== 'production' &&
  30928. inBrowser && typeof console !== 'undefined') {
  30929. console[console.info ? 'info' : 'log'](
  30930. "You are running Vue in development mode.\n" +
  30931. "Make sure to turn on production mode when deploying for production.\n" +
  30932. "See more tips at https://vuejs.org/guide/deployment.html"
  30933. );
  30934. }
  30935. // devtools global hook
  30936. /* istanbul ignore next */
  30937. setTimeout(function () {
  30938. if (config.devtools) {
  30939. if (devtools) {
  30940. devtools.emit('init', Vue$3);
  30941. } else if (
  30942. process.env.NODE_ENV !== 'production' &&
  30943. inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
  30944. ) {
  30945. console[console.info ? 'info' : 'log'](
  30946. 'Download the Vue Devtools extension for a better development experience:\n' +
  30947. 'https://github.com/vuejs/vue-devtools'
  30948. );
  30949. }
  30950. }
  30951. }, 0);
  30952. /* */
  30953. // check whether current browser encodes a char inside attribute values
  30954. function shouldDecode (content, encoded) {
  30955. var div = document.createElement('div');
  30956. div.innerHTML = "<div a=\"" + content + "\">";
  30957. return div.innerHTML.indexOf(encoded) > 0
  30958. }
  30959. // #3663
  30960. // IE encodes newlines inside attribute values while other browsers don't
  30961. var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
  30962. /* */
  30963. var decoder;
  30964. function decode (html) {
  30965. decoder = decoder || document.createElement('div');
  30966. decoder.innerHTML = html;
  30967. return decoder.textContent
  30968. }
  30969. /* */
  30970. var isUnaryTag = makeMap(
  30971. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  30972. 'link,meta,param,source,track,wbr',
  30973. true
  30974. );
  30975. // Elements that you can, intentionally, leave open
  30976. // (and which close themselves)
  30977. var canBeLeftOpenTag = makeMap(
  30978. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  30979. true
  30980. );
  30981. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  30982. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  30983. var isNonPhrasingTag = makeMap(
  30984. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  30985. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  30986. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  30987. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  30988. 'title,tr,track',
  30989. true
  30990. );
  30991. /**
  30992. * Not type-checking this file because it's mostly vendor code.
  30993. */
  30994. /*!
  30995. * HTML Parser By John Resig (ejohn.org)
  30996. * Modified by Juriy "kangax" Zaytsev
  30997. * Original code by Erik Arvidsson, Mozilla Public License
  30998. * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
  30999. */
  31000. // Regular Expressions for parsing tags and attributes
  31001. var singleAttrIdentifier = /([^\s"'<>/=]+)/;
  31002. var singleAttrAssign = /(?:=)/;
  31003. var singleAttrValues = [
  31004. // attr value double quotes
  31005. /"([^"]*)"+/.source,
  31006. // attr value, single quotes
  31007. /'([^']*)'+/.source,
  31008. // attr value, no quotes
  31009. /([^\s"'=<>`]+)/.source
  31010. ];
  31011. var attribute = new RegExp(
  31012. '^\\s*' + singleAttrIdentifier.source +
  31013. '(?:\\s*(' + singleAttrAssign.source + ')' +
  31014. '\\s*(?:' + singleAttrValues.join('|') + '))?'
  31015. );
  31016. // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
  31017. // but for Vue templates we can enforce a simple charset
  31018. var ncname = '[a-zA-Z_][\\w\\-\\.]*';
  31019. var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
  31020. var startTagOpen = new RegExp('^<' + qnameCapture);
  31021. var startTagClose = /^\s*(\/?)>/;
  31022. var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
  31023. var doctype = /^<!DOCTYPE [^>]+>/i;
  31024. var comment = /^<!--/;
  31025. var conditionalComment = /^<!\[/;
  31026. var IS_REGEX_CAPTURING_BROKEN = false;
  31027. 'x'.replace(/x(.)?/g, function (m, g) {
  31028. IS_REGEX_CAPTURING_BROKEN = g === '';
  31029. });
  31030. // Special Elements (can contain anything)
  31031. var isScriptOrStyle = makeMap('script,style', true);
  31032. var reCache = {};
  31033. var ltRE = /&lt;/g;
  31034. var gtRE = /&gt;/g;
  31035. var nlRE = /&#10;/g;
  31036. var ampRE = /&amp;/g;
  31037. var quoteRE = /&quot;/g;
  31038. function decodeAttr (value, shouldDecodeNewlines) {
  31039. if (shouldDecodeNewlines) {
  31040. value = value.replace(nlRE, '\n');
  31041. }
  31042. return value
  31043. .replace(ltRE, '<')
  31044. .replace(gtRE, '>')
  31045. .replace(ampRE, '&')
  31046. .replace(quoteRE, '"')
  31047. }
  31048. function parseHTML (html, options) {
  31049. var stack = [];
  31050. var expectHTML = options.expectHTML;
  31051. var isUnaryTag$$1 = options.isUnaryTag || no;
  31052. var index = 0;
  31053. var last, lastTag;
  31054. while (html) {
  31055. last = html;
  31056. // Make sure we're not in a script or style element
  31057. if (!lastTag || !isScriptOrStyle(lastTag)) {
  31058. var textEnd = html.indexOf('<');
  31059. if (textEnd === 0) {
  31060. // Comment:
  31061. if (comment.test(html)) {
  31062. var commentEnd = html.indexOf('-->');
  31063. if (commentEnd >= 0) {
  31064. advance(commentEnd + 3);
  31065. continue
  31066. }
  31067. }
  31068. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  31069. if (conditionalComment.test(html)) {
  31070. var conditionalEnd = html.indexOf(']>');
  31071. if (conditionalEnd >= 0) {
  31072. advance(conditionalEnd + 2);
  31073. continue
  31074. }
  31075. }
  31076. // Doctype:
  31077. var doctypeMatch = html.match(doctype);
  31078. if (doctypeMatch) {
  31079. advance(doctypeMatch[0].length);
  31080. continue
  31081. }
  31082. // End tag:
  31083. var endTagMatch = html.match(endTag);
  31084. if (endTagMatch) {
  31085. var curIndex = index;
  31086. advance(endTagMatch[0].length);
  31087. parseEndTag(endTagMatch[1], curIndex, index);
  31088. continue
  31089. }
  31090. // Start tag:
  31091. var startTagMatch = parseStartTag();
  31092. if (startTagMatch) {
  31093. handleStartTag(startTagMatch);
  31094. continue
  31095. }
  31096. }
  31097. var text = (void 0), rest$1 = (void 0), next = (void 0);
  31098. if (textEnd > 0) {
  31099. rest$1 = html.slice(textEnd);
  31100. while (
  31101. !endTag.test(rest$1) &&
  31102. !startTagOpen.test(rest$1) &&
  31103. !comment.test(rest$1) &&
  31104. !conditionalComment.test(rest$1)
  31105. ) {
  31106. // < in plain text, be forgiving and treat it as text
  31107. next = rest$1.indexOf('<', 1);
  31108. if (next < 0) { break }
  31109. textEnd += next;
  31110. rest$1 = html.slice(textEnd);
  31111. }
  31112. text = html.substring(0, textEnd);
  31113. advance(textEnd);
  31114. }
  31115. if (textEnd < 0) {
  31116. text = html;
  31117. html = '';
  31118. }
  31119. if (options.chars && text) {
  31120. options.chars(text);
  31121. }
  31122. } else {
  31123. var stackedTag = lastTag.toLowerCase();
  31124. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  31125. var endTagLength = 0;
  31126. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  31127. endTagLength = endTag.length;
  31128. if (stackedTag !== 'script' && stackedTag !== 'style' && stackedTag !== 'noscript') {
  31129. text = text
  31130. .replace(/<!--([\s\S]*?)-->/g, '$1')
  31131. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  31132. }
  31133. if (options.chars) {
  31134. options.chars(text);
  31135. }
  31136. return ''
  31137. });
  31138. index += html.length - rest.length;
  31139. html = rest;
  31140. parseEndTag(stackedTag, index - endTagLength, index);
  31141. }
  31142. if (html === last && options.chars) {
  31143. options.chars(html);
  31144. break
  31145. }
  31146. }
  31147. // Clean up any remaining tags
  31148. parseEndTag();
  31149. function advance (n) {
  31150. index += n;
  31151. html = html.substring(n);
  31152. }
  31153. function parseStartTag () {
  31154. var start = html.match(startTagOpen);
  31155. if (start) {
  31156. var match = {
  31157. tagName: start[1],
  31158. attrs: [],
  31159. start: index
  31160. };
  31161. advance(start[0].length);
  31162. var end, attr;
  31163. while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
  31164. advance(attr[0].length);
  31165. match.attrs.push(attr);
  31166. }
  31167. if (end) {
  31168. match.unarySlash = end[1];
  31169. advance(end[0].length);
  31170. match.end = index;
  31171. return match
  31172. }
  31173. }
  31174. }
  31175. function handleStartTag (match) {
  31176. var tagName = match.tagName;
  31177. var unarySlash = match.unarySlash;
  31178. if (expectHTML) {
  31179. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  31180. parseEndTag(lastTag);
  31181. }
  31182. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  31183. parseEndTag(tagName);
  31184. }
  31185. }
  31186. var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
  31187. var l = match.attrs.length;
  31188. var attrs = new Array(l);
  31189. for (var i = 0; i < l; i++) {
  31190. var args = match.attrs[i];
  31191. // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
  31192. if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
  31193. if (args[3] === '') { delete args[3]; }
  31194. if (args[4] === '') { delete args[4]; }
  31195. if (args[5] === '') { delete args[5]; }
  31196. }
  31197. var value = args[3] || args[4] || args[5] || '';
  31198. attrs[i] = {
  31199. name: args[1],
  31200. value: decodeAttr(
  31201. value,
  31202. options.shouldDecodeNewlines
  31203. )
  31204. };
  31205. }
  31206. if (!unary) {
  31207. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
  31208. lastTag = tagName;
  31209. unarySlash = '';
  31210. }
  31211. if (options.start) {
  31212. options.start(tagName, attrs, unary, match.start, match.end);
  31213. }
  31214. }
  31215. function parseEndTag (tagName, start, end) {
  31216. var pos, lowerCasedTagName;
  31217. if (start == null) { start = index; }
  31218. if (end == null) { end = index; }
  31219. if (tagName) {
  31220. lowerCasedTagName = tagName.toLowerCase();
  31221. }
  31222. // Find the closest opened tag of the same type
  31223. if (tagName) {
  31224. for (pos = stack.length - 1; pos >= 0; pos--) {
  31225. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  31226. break
  31227. }
  31228. }
  31229. } else {
  31230. // If no tag name is provided, clean shop
  31231. pos = 0;
  31232. }
  31233. if (pos >= 0) {
  31234. // Close all the open elements, up the stack
  31235. for (var i = stack.length - 1; i >= pos; i--) {
  31236. if (options.end) {
  31237. options.end(stack[i].tag, start, end);
  31238. }
  31239. }
  31240. // Remove the open elements from the stack
  31241. stack.length = pos;
  31242. lastTag = pos && stack[pos - 1].tag;
  31243. } else if (lowerCasedTagName === 'br') {
  31244. if (options.start) {
  31245. options.start(tagName, [], true, start, end);
  31246. }
  31247. } else if (lowerCasedTagName === 'p') {
  31248. if (options.start) {
  31249. options.start(tagName, [], false, start, end);
  31250. }
  31251. if (options.end) {
  31252. options.end(tagName, start, end);
  31253. }
  31254. }
  31255. }
  31256. }
  31257. /* */
  31258. function parseFilters (exp) {
  31259. var inSingle = false;
  31260. var inDouble = false;
  31261. var inTemplateString = false;
  31262. var inRegex = false;
  31263. var curly = 0;
  31264. var square = 0;
  31265. var paren = 0;
  31266. var lastFilterIndex = 0;
  31267. var c, prev, i, expression, filters;
  31268. for (i = 0; i < exp.length; i++) {
  31269. prev = c;
  31270. c = exp.charCodeAt(i);
  31271. if (inSingle) {
  31272. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  31273. } else if (inDouble) {
  31274. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  31275. } else if (inTemplateString) {
  31276. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  31277. } else if (inRegex) {
  31278. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  31279. } else if (
  31280. c === 0x7C && // pipe
  31281. exp.charCodeAt(i + 1) !== 0x7C &&
  31282. exp.charCodeAt(i - 1) !== 0x7C &&
  31283. !curly && !square && !paren
  31284. ) {
  31285. if (expression === undefined) {
  31286. // first filter, end of expression
  31287. lastFilterIndex = i + 1;
  31288. expression = exp.slice(0, i).trim();
  31289. } else {
  31290. pushFilter();
  31291. }
  31292. } else {
  31293. switch (c) {
  31294. case 0x22: inDouble = true; break // "
  31295. case 0x27: inSingle = true; break // '
  31296. case 0x60: inTemplateString = true; break // `
  31297. case 0x28: paren++; break // (
  31298. case 0x29: paren--; break // )
  31299. case 0x5B: square++; break // [
  31300. case 0x5D: square--; break // ]
  31301. case 0x7B: curly++; break // {
  31302. case 0x7D: curly--; break // }
  31303. }
  31304. if (c === 0x2f) { // /
  31305. var j = i - 1;
  31306. var p = (void 0);
  31307. // find first non-whitespace prev char
  31308. for (; j >= 0; j--) {
  31309. p = exp.charAt(j);
  31310. if (p !== ' ') { break }
  31311. }
  31312. if (!p || !/[\w$]/.test(p)) {
  31313. inRegex = true;
  31314. }
  31315. }
  31316. }
  31317. }
  31318. if (expression === undefined) {
  31319. expression = exp.slice(0, i).trim();
  31320. } else if (lastFilterIndex !== 0) {
  31321. pushFilter();
  31322. }
  31323. function pushFilter () {
  31324. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  31325. lastFilterIndex = i + 1;
  31326. }
  31327. if (filters) {
  31328. for (i = 0; i < filters.length; i++) {
  31329. expression = wrapFilter(expression, filters[i]);
  31330. }
  31331. }
  31332. return expression
  31333. }
  31334. function wrapFilter (exp, filter) {
  31335. var i = filter.indexOf('(');
  31336. if (i < 0) {
  31337. // _f: resolveFilter
  31338. return ("_f(\"" + filter + "\")(" + exp + ")")
  31339. } else {
  31340. var name = filter.slice(0, i);
  31341. var args = filter.slice(i + 1);
  31342. return ("_f(\"" + name + "\")(" + exp + "," + args)
  31343. }
  31344. }
  31345. /* */
  31346. var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
  31347. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  31348. var buildRegex = cached(function (delimiters) {
  31349. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  31350. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  31351. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  31352. });
  31353. function parseText (
  31354. text,
  31355. delimiters
  31356. ) {
  31357. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  31358. if (!tagRE.test(text)) {
  31359. return
  31360. }
  31361. var tokens = [];
  31362. var lastIndex = tagRE.lastIndex = 0;
  31363. var match, index;
  31364. while ((match = tagRE.exec(text))) {
  31365. index = match.index;
  31366. // push text token
  31367. if (index > lastIndex) {
  31368. tokens.push(JSON.stringify(text.slice(lastIndex, index)));
  31369. }
  31370. // tag token
  31371. var exp = parseFilters(match[1].trim());
  31372. tokens.push(("_s(" + exp + ")"));
  31373. lastIndex = index + match[0].length;
  31374. }
  31375. if (lastIndex < text.length) {
  31376. tokens.push(JSON.stringify(text.slice(lastIndex)));
  31377. }
  31378. return tokens.join('+')
  31379. }
  31380. /* */
  31381. function baseWarn (msg) {
  31382. console.error(("[Vue parser]: " + msg));
  31383. }
  31384. function pluckModuleFunction (
  31385. modules,
  31386. key
  31387. ) {
  31388. return modules
  31389. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  31390. : []
  31391. }
  31392. function addProp (el, name, value) {
  31393. (el.props || (el.props = [])).push({ name: name, value: value });
  31394. }
  31395. function addAttr (el, name, value) {
  31396. (el.attrs || (el.attrs = [])).push({ name: name, value: value });
  31397. }
  31398. function addDirective (
  31399. el,
  31400. name,
  31401. rawName,
  31402. value,
  31403. arg,
  31404. modifiers
  31405. ) {
  31406. (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
  31407. }
  31408. function addHandler (
  31409. el,
  31410. name,
  31411. value,
  31412. modifiers,
  31413. important
  31414. ) {
  31415. // check capture modifier
  31416. if (modifiers && modifiers.capture) {
  31417. delete modifiers.capture;
  31418. name = '!' + name; // mark the event as captured
  31419. }
  31420. if (modifiers && modifiers.once) {
  31421. delete modifiers.once;
  31422. name = '~' + name; // mark the event as once
  31423. }
  31424. var events;
  31425. if (modifiers && modifiers.native) {
  31426. delete modifiers.native;
  31427. events = el.nativeEvents || (el.nativeEvents = {});
  31428. } else {
  31429. events = el.events || (el.events = {});
  31430. }
  31431. var newHandler = { value: value, modifiers: modifiers };
  31432. var handlers = events[name];
  31433. /* istanbul ignore if */
  31434. if (Array.isArray(handlers)) {
  31435. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  31436. } else if (handlers) {
  31437. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  31438. } else {
  31439. events[name] = newHandler;
  31440. }
  31441. }
  31442. function getBindingAttr (
  31443. el,
  31444. name,
  31445. getStatic
  31446. ) {
  31447. var dynamicValue =
  31448. getAndRemoveAttr(el, ':' + name) ||
  31449. getAndRemoveAttr(el, 'v-bind:' + name);
  31450. if (dynamicValue != null) {
  31451. return parseFilters(dynamicValue)
  31452. } else if (getStatic !== false) {
  31453. var staticValue = getAndRemoveAttr(el, name);
  31454. if (staticValue != null) {
  31455. return JSON.stringify(staticValue)
  31456. }
  31457. }
  31458. }
  31459. function getAndRemoveAttr (el, name) {
  31460. var val;
  31461. if ((val = el.attrsMap[name]) != null) {
  31462. var list = el.attrsList;
  31463. for (var i = 0, l = list.length; i < l; i++) {
  31464. if (list[i].name === name) {
  31465. list.splice(i, 1);
  31466. break
  31467. }
  31468. }
  31469. }
  31470. return val
  31471. }
  31472. var len;
  31473. var str;
  31474. var chr;
  31475. var index$1;
  31476. var expressionPos;
  31477. var expressionEndPos;
  31478. /**
  31479. * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
  31480. *
  31481. * for loop possible cases:
  31482. *
  31483. * - test
  31484. * - test[idx]
  31485. * - test[test1[idx]]
  31486. * - test["a"][idx]
  31487. * - xxx.test[a[a].test1[idx]]
  31488. * - test.xxx.a["asa"][test1[idx]]
  31489. *
  31490. */
  31491. function parseModel (val) {
  31492. str = val;
  31493. len = str.length;
  31494. index$1 = expressionPos = expressionEndPos = 0;
  31495. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  31496. return {
  31497. exp: val,
  31498. idx: null
  31499. }
  31500. }
  31501. while (!eof()) {
  31502. chr = next();
  31503. /* istanbul ignore if */
  31504. if (isStringStart(chr)) {
  31505. parseString(chr);
  31506. } else if (chr === 0x5B) {
  31507. parseBracket(chr);
  31508. }
  31509. }
  31510. return {
  31511. exp: val.substring(0, expressionPos),
  31512. idx: val.substring(expressionPos + 1, expressionEndPos)
  31513. }
  31514. }
  31515. function next () {
  31516. return str.charCodeAt(++index$1)
  31517. }
  31518. function eof () {
  31519. return index$1 >= len
  31520. }
  31521. function isStringStart (chr) {
  31522. return chr === 0x22 || chr === 0x27
  31523. }
  31524. function parseBracket (chr) {
  31525. var inBracket = 1;
  31526. expressionPos = index$1;
  31527. while (!eof()) {
  31528. chr = next();
  31529. if (isStringStart(chr)) {
  31530. parseString(chr);
  31531. continue
  31532. }
  31533. if (chr === 0x5B) { inBracket++; }
  31534. if (chr === 0x5D) { inBracket--; }
  31535. if (inBracket === 0) {
  31536. expressionEndPos = index$1;
  31537. break
  31538. }
  31539. }
  31540. }
  31541. function parseString (chr) {
  31542. var stringQuote = chr;
  31543. while (!eof()) {
  31544. chr = next();
  31545. if (chr === stringQuote) {
  31546. break
  31547. }
  31548. }
  31549. }
  31550. /* */
  31551. var dirRE = /^v-|^@|^:/;
  31552. var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
  31553. var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
  31554. var bindRE = /^:|^v-bind:/;
  31555. var onRE = /^@|^v-on:/;
  31556. var argRE = /:(.*)$/;
  31557. var modifierRE = /\.[^.]+/g;
  31558. var decodeHTMLCached = cached(decode);
  31559. // configurable state
  31560. var warn$1;
  31561. var platformGetTagNamespace;
  31562. var platformMustUseProp;
  31563. var platformIsPreTag;
  31564. var preTransforms;
  31565. var transforms;
  31566. var postTransforms;
  31567. var delimiters;
  31568. /**
  31569. * Convert HTML string to AST.
  31570. */
  31571. function parse (
  31572. template,
  31573. options
  31574. ) {
  31575. warn$1 = options.warn || baseWarn;
  31576. platformGetTagNamespace = options.getTagNamespace || no;
  31577. platformMustUseProp = options.mustUseProp || no;
  31578. platformIsPreTag = options.isPreTag || no;
  31579. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  31580. transforms = pluckModuleFunction(options.modules, 'transformNode');
  31581. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  31582. delimiters = options.delimiters;
  31583. var stack = [];
  31584. var preserveWhitespace = options.preserveWhitespace !== false;
  31585. var root;
  31586. var currentParent;
  31587. var inVPre = false;
  31588. var inPre = false;
  31589. var warned = false;
  31590. parseHTML(template, {
  31591. expectHTML: options.expectHTML,
  31592. isUnaryTag: options.isUnaryTag,
  31593. shouldDecodeNewlines: options.shouldDecodeNewlines,
  31594. start: function start (tag, attrs, unary) {
  31595. // check namespace.
  31596. // inherit parent ns if there is one
  31597. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  31598. // handle IE svg bug
  31599. /* istanbul ignore if */
  31600. if (isIE && ns === 'svg') {
  31601. attrs = guardIESVGBug(attrs);
  31602. }
  31603. var element = {
  31604. type: 1,
  31605. tag: tag,
  31606. attrsList: attrs,
  31607. attrsMap: makeAttrsMap(attrs),
  31608. parent: currentParent,
  31609. children: []
  31610. };
  31611. if (ns) {
  31612. element.ns = ns;
  31613. }
  31614. if (isForbiddenTag(element) && !isServerRendering()) {
  31615. element.forbidden = true;
  31616. process.env.NODE_ENV !== 'production' && warn$1(
  31617. 'Templates should only be responsible for mapping the state to the ' +
  31618. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  31619. "<" + tag + ">" + ', as they will not be parsed.'
  31620. );
  31621. }
  31622. // apply pre-transforms
  31623. for (var i = 0; i < preTransforms.length; i++) {
  31624. preTransforms[i](element, options);
  31625. }
  31626. if (!inVPre) {
  31627. processPre(element);
  31628. if (element.pre) {
  31629. inVPre = true;
  31630. }
  31631. }
  31632. if (platformIsPreTag(element.tag)) {
  31633. inPre = true;
  31634. }
  31635. if (inVPre) {
  31636. processRawAttrs(element);
  31637. } else {
  31638. processFor(element);
  31639. processIf(element);
  31640. processOnce(element);
  31641. processKey(element);
  31642. // determine whether this is a plain element after
  31643. // removing structural attributes
  31644. element.plain = !element.key && !attrs.length;
  31645. processRef(element);
  31646. processSlot(element);
  31647. processComponent(element);
  31648. for (var i$1 = 0; i$1 < transforms.length; i$1++) {
  31649. transforms[i$1](element, options);
  31650. }
  31651. processAttrs(element);
  31652. }
  31653. function checkRootConstraints (el) {
  31654. if (process.env.NODE_ENV !== 'production' && !warned) {
  31655. if (el.tag === 'slot' || el.tag === 'template') {
  31656. warned = true;
  31657. warn$1(
  31658. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  31659. 'contain multiple nodes:\n' + template
  31660. );
  31661. }
  31662. if (el.attrsMap.hasOwnProperty('v-for')) {
  31663. warned = true;
  31664. warn$1(
  31665. 'Cannot use v-for on stateful component root element because ' +
  31666. 'it renders multiple elements:\n' + template
  31667. );
  31668. }
  31669. }
  31670. }
  31671. // tree management
  31672. if (!root) {
  31673. root = element;
  31674. checkRootConstraints(root);
  31675. } else if (!stack.length) {
  31676. // allow root elements with v-if, v-else-if and v-else
  31677. if (root.if && (element.elseif || element.else)) {
  31678. checkRootConstraints(element);
  31679. addIfCondition(root, {
  31680. exp: element.elseif,
  31681. block: element
  31682. });
  31683. } else if (process.env.NODE_ENV !== 'production' && !warned) {
  31684. warned = true;
  31685. warn$1(
  31686. "Component template should contain exactly one root element:" +
  31687. "\n\n" + template + "\n\n" +
  31688. "If you are using v-if on multiple elements, " +
  31689. "use v-else-if to chain them instead."
  31690. );
  31691. }
  31692. }
  31693. if (currentParent && !element.forbidden) {
  31694. if (element.elseif || element.else) {
  31695. processIfConditions(element, currentParent);
  31696. } else if (element.slotScope) { // scoped slot
  31697. currentParent.plain = false;
  31698. var name = element.slotTarget || 'default';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  31699. } else {
  31700. currentParent.children.push(element);
  31701. element.parent = currentParent;
  31702. }
  31703. }
  31704. if (!unary) {
  31705. currentParent = element;
  31706. stack.push(element);
  31707. }
  31708. // apply post-transforms
  31709. for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
  31710. postTransforms[i$2](element, options);
  31711. }
  31712. },
  31713. end: function end () {
  31714. // remove trailing whitespace
  31715. var element = stack[stack.length - 1];
  31716. var lastNode = element.children[element.children.length - 1];
  31717. if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
  31718. element.children.pop();
  31719. }
  31720. // pop stack
  31721. stack.length -= 1;
  31722. currentParent = stack[stack.length - 1];
  31723. // check pre state
  31724. if (element.pre) {
  31725. inVPre = false;
  31726. }
  31727. if (platformIsPreTag(element.tag)) {
  31728. inPre = false;
  31729. }
  31730. },
  31731. chars: function chars (text) {
  31732. if (!currentParent) {
  31733. if (process.env.NODE_ENV !== 'production' && !warned && text === template) {
  31734. warned = true;
  31735. warn$1(
  31736. 'Component template requires a root element, rather than just text:\n\n' + template
  31737. );
  31738. }
  31739. return
  31740. }
  31741. // IE textarea placeholder bug
  31742. /* istanbul ignore if */
  31743. if (isIE &&
  31744. currentParent.tag === 'textarea' &&
  31745. currentParent.attrsMap.placeholder === text) {
  31746. return
  31747. }
  31748. var children = currentParent.children;
  31749. text = inPre || text.trim()
  31750. ? decodeHTMLCached(text)
  31751. // only preserve whitespace if its not right after a starting tag
  31752. : preserveWhitespace && children.length ? ' ' : '';
  31753. if (text) {
  31754. var expression;
  31755. if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
  31756. children.push({
  31757. type: 2,
  31758. expression: expression,
  31759. text: text
  31760. });
  31761. } else if (text !== ' ' || children[children.length - 1].text !== ' ') {
  31762. currentParent.children.push({
  31763. type: 3,
  31764. text: text
  31765. });
  31766. }
  31767. }
  31768. }
  31769. });
  31770. return root
  31771. }
  31772. function processPre (el) {
  31773. if (getAndRemoveAttr(el, 'v-pre') != null) {
  31774. el.pre = true;
  31775. }
  31776. }
  31777. function processRawAttrs (el) {
  31778. var l = el.attrsList.length;
  31779. if (l) {
  31780. var attrs = el.attrs = new Array(l);
  31781. for (var i = 0; i < l; i++) {
  31782. attrs[i] = {
  31783. name: el.attrsList[i].name,
  31784. value: JSON.stringify(el.attrsList[i].value)
  31785. };
  31786. }
  31787. } else if (!el.pre) {
  31788. // non root node in pre blocks with no attributes
  31789. el.plain = true;
  31790. }
  31791. }
  31792. function processKey (el) {
  31793. var exp = getBindingAttr(el, 'key');
  31794. if (exp) {
  31795. if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
  31796. warn$1("<template> cannot be keyed. Place the key on real elements instead.");
  31797. }
  31798. el.key = exp;
  31799. }
  31800. }
  31801. function processRef (el) {
  31802. var ref = getBindingAttr(el, 'ref');
  31803. if (ref) {
  31804. el.ref = ref;
  31805. el.refInFor = checkInFor(el);
  31806. }
  31807. }
  31808. function processFor (el) {
  31809. var exp;
  31810. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  31811. var inMatch = exp.match(forAliasRE);
  31812. if (!inMatch) {
  31813. process.env.NODE_ENV !== 'production' && warn$1(
  31814. ("Invalid v-for expression: " + exp)
  31815. );
  31816. return
  31817. }
  31818. el.for = inMatch[2].trim();
  31819. var alias = inMatch[1].trim();
  31820. var iteratorMatch = alias.match(forIteratorRE);
  31821. if (iteratorMatch) {
  31822. el.alias = iteratorMatch[1].trim();
  31823. el.iterator1 = iteratorMatch[2].trim();
  31824. if (iteratorMatch[3]) {
  31825. el.iterator2 = iteratorMatch[3].trim();
  31826. }
  31827. } else {
  31828. el.alias = alias;
  31829. }
  31830. }
  31831. }
  31832. function processIf (el) {
  31833. var exp = getAndRemoveAttr(el, 'v-if');
  31834. if (exp) {
  31835. el.if = exp;
  31836. addIfCondition(el, {
  31837. exp: exp,
  31838. block: el
  31839. });
  31840. } else {
  31841. if (getAndRemoveAttr(el, 'v-else') != null) {
  31842. el.else = true;
  31843. }
  31844. var elseif = getAndRemoveAttr(el, 'v-else-if');
  31845. if (elseif) {
  31846. el.elseif = elseif;
  31847. }
  31848. }
  31849. }
  31850. function processIfConditions (el, parent) {
  31851. var prev = findPrevElement(parent.children);
  31852. if (prev && prev.if) {
  31853. addIfCondition(prev, {
  31854. exp: el.elseif,
  31855. block: el
  31856. });
  31857. } else if (process.env.NODE_ENV !== 'production') {
  31858. warn$1(
  31859. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  31860. "used on element <" + (el.tag) + "> without corresponding v-if."
  31861. );
  31862. }
  31863. }
  31864. function findPrevElement (children) {
  31865. var i = children.length;
  31866. while (i--) {
  31867. if (children[i].type === 1) {
  31868. return children[i]
  31869. } else {
  31870. if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
  31871. warn$1(
  31872. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  31873. "will be ignored."
  31874. );
  31875. }
  31876. children.pop();
  31877. }
  31878. }
  31879. }
  31880. function addIfCondition (el, condition) {
  31881. if (!el.ifConditions) {
  31882. el.ifConditions = [];
  31883. }
  31884. el.ifConditions.push(condition);
  31885. }
  31886. function processOnce (el) {
  31887. var once = getAndRemoveAttr(el, 'v-once');
  31888. if (once != null) {
  31889. el.once = true;
  31890. }
  31891. }
  31892. function processSlot (el) {
  31893. if (el.tag === 'slot') {
  31894. el.slotName = getBindingAttr(el, 'name');
  31895. if (process.env.NODE_ENV !== 'production' && el.key) {
  31896. warn$1(
  31897. "`key` does not work on <slot> because slots are abstract outlets " +
  31898. "and can possibly expand into multiple elements. " +
  31899. "Use the key on a wrapping element instead."
  31900. );
  31901. }
  31902. } else {
  31903. var slotTarget = getBindingAttr(el, 'slot');
  31904. if (slotTarget) {
  31905. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  31906. }
  31907. if (el.tag === 'template') {
  31908. el.slotScope = getAndRemoveAttr(el, 'scope');
  31909. }
  31910. }
  31911. }
  31912. function processComponent (el) {
  31913. var binding;
  31914. if ((binding = getBindingAttr(el, 'is'))) {
  31915. el.component = binding;
  31916. }
  31917. if (getAndRemoveAttr(el, 'inline-template') != null) {
  31918. el.inlineTemplate = true;
  31919. }
  31920. }
  31921. function processAttrs (el) {
  31922. var list = el.attrsList;
  31923. var i, l, name, rawName, value, arg, modifiers, isProp;
  31924. for (i = 0, l = list.length; i < l; i++) {
  31925. name = rawName = list[i].name;
  31926. value = list[i].value;
  31927. if (dirRE.test(name)) {
  31928. // mark element as dynamic
  31929. el.hasBindings = true;
  31930. // modifiers
  31931. modifiers = parseModifiers(name);
  31932. if (modifiers) {
  31933. name = name.replace(modifierRE, '');
  31934. }
  31935. if (bindRE.test(name)) { // v-bind
  31936. name = name.replace(bindRE, '');
  31937. value = parseFilters(value);
  31938. isProp = false;
  31939. if (modifiers) {
  31940. if (modifiers.prop) {
  31941. isProp = true;
  31942. name = camelize(name);
  31943. if (name === 'innerHtml') { name = 'innerHTML'; }
  31944. }
  31945. if (modifiers.camel) {
  31946. name = camelize(name);
  31947. }
  31948. }
  31949. if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  31950. addProp(el, name, value);
  31951. } else {
  31952. addAttr(el, name, value);
  31953. }
  31954. } else if (onRE.test(name)) { // v-on
  31955. name = name.replace(onRE, '');
  31956. addHandler(el, name, value, modifiers);
  31957. } else { // normal directives
  31958. name = name.replace(dirRE, '');
  31959. // parse arg
  31960. var argMatch = name.match(argRE);
  31961. if (argMatch && (arg = argMatch[1])) {
  31962. name = name.slice(0, -(arg.length + 1));
  31963. }
  31964. addDirective(el, name, rawName, value, arg, modifiers);
  31965. if (process.env.NODE_ENV !== 'production' && name === 'model') {
  31966. checkForAliasModel(el, value);
  31967. }
  31968. }
  31969. } else {
  31970. // literal attribute
  31971. if (process.env.NODE_ENV !== 'production') {
  31972. var expression = parseText(value, delimiters);
  31973. if (expression) {
  31974. warn$1(
  31975. name + "=\"" + value + "\": " +
  31976. 'Interpolation inside attributes has been removed. ' +
  31977. 'Use v-bind or the colon shorthand instead. For example, ' +
  31978. 'instead of <div id="{{ val }}">, use <div :id="val">.'
  31979. );
  31980. }
  31981. }
  31982. addAttr(el, name, JSON.stringify(value));
  31983. }
  31984. }
  31985. }
  31986. function checkInFor (el) {
  31987. var parent = el;
  31988. while (parent) {
  31989. if (parent.for !== undefined) {
  31990. return true
  31991. }
  31992. parent = parent.parent;
  31993. }
  31994. return false
  31995. }
  31996. function parseModifiers (name) {
  31997. var match = name.match(modifierRE);
  31998. if (match) {
  31999. var ret = {};
  32000. match.forEach(function (m) { ret[m.slice(1)] = true; });
  32001. return ret
  32002. }
  32003. }
  32004. function makeAttrsMap (attrs) {
  32005. var map = {};
  32006. for (var i = 0, l = attrs.length; i < l; i++) {
  32007. if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE) {
  32008. warn$1('duplicate attribute: ' + attrs[i].name);
  32009. }
  32010. map[attrs[i].name] = attrs[i].value;
  32011. }
  32012. return map
  32013. }
  32014. function isForbiddenTag (el) {
  32015. return (
  32016. el.tag === 'style' ||
  32017. (el.tag === 'script' && (
  32018. !el.attrsMap.type ||
  32019. el.attrsMap.type === 'text/javascript'
  32020. ))
  32021. )
  32022. }
  32023. var ieNSBug = /^xmlns:NS\d+/;
  32024. var ieNSPrefix = /^NS\d+:/;
  32025. /* istanbul ignore next */
  32026. function guardIESVGBug (attrs) {
  32027. var res = [];
  32028. for (var i = 0; i < attrs.length; i++) {
  32029. var attr = attrs[i];
  32030. if (!ieNSBug.test(attr.name)) {
  32031. attr.name = attr.name.replace(ieNSPrefix, '');
  32032. res.push(attr);
  32033. }
  32034. }
  32035. return res
  32036. }
  32037. function checkForAliasModel (el, value) {
  32038. var _el = el;
  32039. while (_el) {
  32040. if (_el.for && _el.alias === value) {
  32041. warn$1(
  32042. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  32043. "You are binding v-model directly to a v-for iteration alias. " +
  32044. "This will not be able to modify the v-for source array because " +
  32045. "writing to the alias is like modifying a function local variable. " +
  32046. "Consider using an array of objects and use v-model on an object property instead."
  32047. );
  32048. }
  32049. _el = _el.parent;
  32050. }
  32051. }
  32052. /* */
  32053. var isStaticKey;
  32054. var isPlatformReservedTag;
  32055. var genStaticKeysCached = cached(genStaticKeys$1);
  32056. /**
  32057. * Goal of the optimizer: walk the generated template AST tree
  32058. * and detect sub-trees that are purely static, i.e. parts of
  32059. * the DOM that never needs to change.
  32060. *
  32061. * Once we detect these sub-trees, we can:
  32062. *
  32063. * 1. Hoist them into constants, so that we no longer need to
  32064. * create fresh nodes for them on each re-render;
  32065. * 2. Completely skip them in the patching process.
  32066. */
  32067. function optimize (root, options) {
  32068. if (!root) { return }
  32069. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  32070. isPlatformReservedTag = options.isReservedTag || no;
  32071. // first pass: mark all non-static nodes.
  32072. markStatic(root);
  32073. // second pass: mark static roots.
  32074. markStaticRoots(root, false);
  32075. }
  32076. function genStaticKeys$1 (keys) {
  32077. return makeMap(
  32078. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
  32079. (keys ? ',' + keys : '')
  32080. )
  32081. }
  32082. function markStatic (node) {
  32083. node.static = isStatic(node);
  32084. if (node.type === 1) {
  32085. // do not make component slot content static. this avoids
  32086. // 1. components not able to mutate slot nodes
  32087. // 2. static slot content fails for hot-reloading
  32088. if (
  32089. !isPlatformReservedTag(node.tag) &&
  32090. node.tag !== 'slot' &&
  32091. node.attrsMap['inline-template'] == null
  32092. ) {
  32093. return
  32094. }
  32095. for (var i = 0, l = node.children.length; i < l; i++) {
  32096. var child = node.children[i];
  32097. markStatic(child);
  32098. if (!child.static) {
  32099. node.static = false;
  32100. }
  32101. }
  32102. }
  32103. }
  32104. function markStaticRoots (node, isInFor) {
  32105. if (node.type === 1) {
  32106. if (node.static || node.once) {
  32107. node.staticInFor = isInFor;
  32108. }
  32109. // For a node to qualify as a static root, it should have children that
  32110. // are not just static text. Otherwise the cost of hoisting out will
  32111. // outweigh the benefits and it's better off to just always render it fresh.
  32112. if (node.static && node.children.length && !(
  32113. node.children.length === 1 &&
  32114. node.children[0].type === 3
  32115. )) {
  32116. node.staticRoot = true;
  32117. return
  32118. } else {
  32119. node.staticRoot = false;
  32120. }
  32121. if (node.children) {
  32122. for (var i = 0, l = node.children.length; i < l; i++) {
  32123. markStaticRoots(node.children[i], isInFor || !!node.for);
  32124. }
  32125. }
  32126. if (node.ifConditions) {
  32127. walkThroughConditionsBlocks(node.ifConditions, isInFor);
  32128. }
  32129. }
  32130. }
  32131. function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
  32132. for (var i = 1, len = conditionBlocks.length; i < len; i++) {
  32133. markStaticRoots(conditionBlocks[i].block, isInFor);
  32134. }
  32135. }
  32136. function isStatic (node) {
  32137. if (node.type === 2) { // expression
  32138. return false
  32139. }
  32140. if (node.type === 3) { // text
  32141. return true
  32142. }
  32143. return !!(node.pre || (
  32144. !node.hasBindings && // no dynamic bindings
  32145. !node.if && !node.for && // not v-if or v-for or v-else
  32146. !isBuiltInTag(node.tag) && // not a built-in
  32147. isPlatformReservedTag(node.tag) && // not a component
  32148. !isDirectChildOfTemplateFor(node) &&
  32149. Object.keys(node).every(isStaticKey)
  32150. ))
  32151. }
  32152. function isDirectChildOfTemplateFor (node) {
  32153. while (node.parent) {
  32154. node = node.parent;
  32155. if (node.tag !== 'template') {
  32156. return false
  32157. }
  32158. if (node.for) {
  32159. return true
  32160. }
  32161. }
  32162. return false
  32163. }
  32164. /* */
  32165. var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
  32166. var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
  32167. // keyCode aliases
  32168. var keyCodes = {
  32169. esc: 27,
  32170. tab: 9,
  32171. enter: 13,
  32172. space: 32,
  32173. up: 38,
  32174. left: 37,
  32175. right: 39,
  32176. down: 40,
  32177. 'delete': [8, 46]
  32178. };
  32179. var modifierCode = {
  32180. stop: '$event.stopPropagation();',
  32181. prevent: '$event.preventDefault();',
  32182. self: 'if($event.target !== $event.currentTarget)return;',
  32183. ctrl: 'if(!$event.ctrlKey)return;',
  32184. shift: 'if(!$event.shiftKey)return;',
  32185. alt: 'if(!$event.altKey)return;',
  32186. meta: 'if(!$event.metaKey)return;'
  32187. };
  32188. function genHandlers (events, native) {
  32189. var res = native ? 'nativeOn:{' : 'on:{';
  32190. for (var name in events) {
  32191. res += "\"" + name + "\":" + (genHandler(name, events[name])) + ",";
  32192. }
  32193. return res.slice(0, -1) + '}'
  32194. }
  32195. function genHandler (
  32196. name,
  32197. handler
  32198. ) {
  32199. if (!handler) {
  32200. return 'function(){}'
  32201. } else if (Array.isArray(handler)) {
  32202. return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
  32203. } else if (!handler.modifiers) {
  32204. return fnExpRE.test(handler.value) || simplePathRE.test(handler.value)
  32205. ? handler.value
  32206. : ("function($event){" + (handler.value) + "}")
  32207. } else {
  32208. var code = '';
  32209. var keys = [];
  32210. for (var key in handler.modifiers) {
  32211. if (modifierCode[key]) {
  32212. code += modifierCode[key];
  32213. } else {
  32214. keys.push(key);
  32215. }
  32216. }
  32217. if (keys.length) {
  32218. code = genKeyFilter(keys) + code;
  32219. }
  32220. var handlerCode = simplePathRE.test(handler.value)
  32221. ? handler.value + '($event)'
  32222. : handler.value;
  32223. return 'function($event){' + code + handlerCode + '}'
  32224. }
  32225. }
  32226. function genKeyFilter (keys) {
  32227. return ("if(" + (keys.map(genFilterCode).join('&&')) + ")return;")
  32228. }
  32229. function genFilterCode (key) {
  32230. var keyVal = parseInt(key, 10);
  32231. if (keyVal) {
  32232. return ("$event.keyCode!==" + keyVal)
  32233. }
  32234. var alias = keyCodes[key];
  32235. return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
  32236. }
  32237. /* */
  32238. function bind$2 (el, dir) {
  32239. el.wrapData = function (code) {
  32240. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
  32241. };
  32242. }
  32243. /* */
  32244. var baseDirectives = {
  32245. bind: bind$2,
  32246. cloak: noop
  32247. };
  32248. /* */
  32249. // configurable state
  32250. var warn$2;
  32251. var transforms$1;
  32252. var dataGenFns;
  32253. var platformDirectives$1;
  32254. var isPlatformReservedTag$1;
  32255. var staticRenderFns;
  32256. var onceCount;
  32257. var currentOptions;
  32258. function generate (
  32259. ast,
  32260. options
  32261. ) {
  32262. // save previous staticRenderFns so generate calls can be nested
  32263. var prevStaticRenderFns = staticRenderFns;
  32264. var currentStaticRenderFns = staticRenderFns = [];
  32265. var prevOnceCount = onceCount;
  32266. onceCount = 0;
  32267. currentOptions = options;
  32268. warn$2 = options.warn || baseWarn;
  32269. transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
  32270. dataGenFns = pluckModuleFunction(options.modules, 'genData');
  32271. platformDirectives$1 = options.directives || {};
  32272. isPlatformReservedTag$1 = options.isReservedTag || no;
  32273. var code = ast ? genElement(ast) : '_c("div")';
  32274. staticRenderFns = prevStaticRenderFns;
  32275. onceCount = prevOnceCount;
  32276. return {
  32277. render: ("with(this){return " + code + "}"),
  32278. staticRenderFns: currentStaticRenderFns
  32279. }
  32280. }
  32281. function genElement (el) {
  32282. if (el.staticRoot && !el.staticProcessed) {
  32283. return genStatic(el)
  32284. } else if (el.once && !el.onceProcessed) {
  32285. return genOnce(el)
  32286. } else if (el.for && !el.forProcessed) {
  32287. return genFor(el)
  32288. } else if (el.if && !el.ifProcessed) {
  32289. return genIf(el)
  32290. } else if (el.tag === 'template' && !el.slotTarget) {
  32291. return genChildren(el) || 'void 0'
  32292. } else if (el.tag === 'slot') {
  32293. return genSlot(el)
  32294. } else {
  32295. // component or element
  32296. var code;
  32297. if (el.component) {
  32298. code = genComponent(el.component, el);
  32299. } else {
  32300. var data = el.plain ? undefined : genData(el);
  32301. var children = el.inlineTemplate ? null : genChildren(el, true);
  32302. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  32303. }
  32304. // module transforms
  32305. for (var i = 0; i < transforms$1.length; i++) {
  32306. code = transforms$1[i](el, code);
  32307. }
  32308. return code
  32309. }
  32310. }
  32311. // hoist static sub-trees out
  32312. function genStatic (el) {
  32313. el.staticProcessed = true;
  32314. staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
  32315. return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  32316. }
  32317. // v-once
  32318. function genOnce (el) {
  32319. el.onceProcessed = true;
  32320. if (el.if && !el.ifProcessed) {
  32321. return genIf(el)
  32322. } else if (el.staticInFor) {
  32323. var key = '';
  32324. var parent = el.parent;
  32325. while (parent) {
  32326. if (parent.for) {
  32327. key = parent.key;
  32328. break
  32329. }
  32330. parent = parent.parent;
  32331. }
  32332. if (!key) {
  32333. process.env.NODE_ENV !== 'production' && warn$2(
  32334. "v-once can only be used inside v-for that is keyed. "
  32335. );
  32336. return genElement(el)
  32337. }
  32338. return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
  32339. } else {
  32340. return genStatic(el)
  32341. }
  32342. }
  32343. function genIf (el) {
  32344. el.ifProcessed = true; // avoid recursion
  32345. return genIfConditions(el.ifConditions.slice())
  32346. }
  32347. function genIfConditions (conditions) {
  32348. if (!conditions.length) {
  32349. return '_e()'
  32350. }
  32351. var condition = conditions.shift();
  32352. if (condition.exp) {
  32353. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
  32354. } else {
  32355. return ("" + (genTernaryExp(condition.block)))
  32356. }
  32357. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  32358. function genTernaryExp (el) {
  32359. return el.once ? genOnce(el) : genElement(el)
  32360. }
  32361. }
  32362. function genFor (el) {
  32363. var exp = el.for;
  32364. var alias = el.alias;
  32365. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  32366. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  32367. el.forProcessed = true; // avoid recursion
  32368. return "_l((" + exp + ")," +
  32369. "function(" + alias + iterator1 + iterator2 + "){" +
  32370. "return " + (genElement(el)) +
  32371. '})'
  32372. }
  32373. function genData (el) {
  32374. var data = '{';
  32375. // directives first.
  32376. // directives may mutate the el's other properties before they are generated.
  32377. var dirs = genDirectives(el);
  32378. if (dirs) { data += dirs + ','; }
  32379. // key
  32380. if (el.key) {
  32381. data += "key:" + (el.key) + ",";
  32382. }
  32383. // ref
  32384. if (el.ref) {
  32385. data += "ref:" + (el.ref) + ",";
  32386. }
  32387. if (el.refInFor) {
  32388. data += "refInFor:true,";
  32389. }
  32390. // pre
  32391. if (el.pre) {
  32392. data += "pre:true,";
  32393. }
  32394. // record original tag name for components using "is" attribute
  32395. if (el.component) {
  32396. data += "tag:\"" + (el.tag) + "\",";
  32397. }
  32398. // module data generation functions
  32399. for (var i = 0; i < dataGenFns.length; i++) {
  32400. data += dataGenFns[i](el);
  32401. }
  32402. // attributes
  32403. if (el.attrs) {
  32404. data += "attrs:{" + (genProps(el.attrs)) + "},";
  32405. }
  32406. // DOM props
  32407. if (el.props) {
  32408. data += "domProps:{" + (genProps(el.props)) + "},";
  32409. }
  32410. // event handlers
  32411. if (el.events) {
  32412. data += (genHandlers(el.events)) + ",";
  32413. }
  32414. if (el.nativeEvents) {
  32415. data += (genHandlers(el.nativeEvents, true)) + ",";
  32416. }
  32417. // slot target
  32418. if (el.slotTarget) {
  32419. data += "slot:" + (el.slotTarget) + ",";
  32420. }
  32421. // scoped slots
  32422. if (el.scopedSlots) {
  32423. data += (genScopedSlots(el.scopedSlots)) + ",";
  32424. }
  32425. // inline-template
  32426. if (el.inlineTemplate) {
  32427. var inlineTemplate = genInlineTemplate(el);
  32428. if (inlineTemplate) {
  32429. data += inlineTemplate + ",";
  32430. }
  32431. }
  32432. data = data.replace(/,$/, '') + '}';
  32433. // v-bind data wrap
  32434. if (el.wrapData) {
  32435. data = el.wrapData(data);
  32436. }
  32437. return data
  32438. }
  32439. function genDirectives (el) {
  32440. var dirs = el.directives;
  32441. if (!dirs) { return }
  32442. var res = 'directives:[';
  32443. var hasRuntime = false;
  32444. var i, l, dir, needRuntime;
  32445. for (i = 0, l = dirs.length; i < l; i++) {
  32446. dir = dirs[i];
  32447. needRuntime = true;
  32448. var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
  32449. if (gen) {
  32450. // compile-time directive that manipulates AST.
  32451. // returns true if it also needs a runtime counterpart.
  32452. needRuntime = !!gen(el, dir, warn$2);
  32453. }
  32454. if (needRuntime) {
  32455. hasRuntime = true;
  32456. 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))) : '') + "},";
  32457. }
  32458. }
  32459. if (hasRuntime) {
  32460. return res.slice(0, -1) + ']'
  32461. }
  32462. }
  32463. function genInlineTemplate (el) {
  32464. var ast = el.children[0];
  32465. if (process.env.NODE_ENV !== 'production' && (
  32466. el.children.length > 1 || ast.type !== 1
  32467. )) {
  32468. warn$2('Inline-template components must have exactly one child element.');
  32469. }
  32470. if (ast.type === 1) {
  32471. var inlineRenderFns = generate(ast, currentOptions);
  32472. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  32473. }
  32474. }
  32475. function genScopedSlots (slots) {
  32476. return ("scopedSlots:{" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "}")
  32477. }
  32478. function genScopedSlot (key, el) {
  32479. return key + ":function(" + (String(el.attrsMap.scope)) + "){" +
  32480. "return " + (el.tag === 'template'
  32481. ? genChildren(el) || 'void 0'
  32482. : genElement(el)) + "}"
  32483. }
  32484. function genChildren (el, checkSkip) {
  32485. var children = el.children;
  32486. if (children.length) {
  32487. var el$1 = children[0];
  32488. // optimize single v-for
  32489. if (children.length === 1 &&
  32490. el$1.for &&
  32491. el$1.tag !== 'template' &&
  32492. el$1.tag !== 'slot') {
  32493. return genElement(el$1)
  32494. }
  32495. var normalizationType = getNormalizationType(children);
  32496. return ("[" + (children.map(genNode).join(',')) + "]" + (checkSkip
  32497. ? normalizationType ? ("," + normalizationType) : ''
  32498. : ''))
  32499. }
  32500. }
  32501. // determine the normalization needed for the children array.
  32502. // 0: no normalization needed
  32503. // 1: simple normalization needed (possible 1-level deep nested array)
  32504. // 2: full normalization needed
  32505. function getNormalizationType (children) {
  32506. var res = 0;
  32507. for (var i = 0; i < children.length; i++) {
  32508. var el = children[i];
  32509. if (el.type !== 1) {
  32510. continue
  32511. }
  32512. if (needsNormalization(el) ||
  32513. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  32514. res = 2;
  32515. break
  32516. }
  32517. if (maybeComponent(el) ||
  32518. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  32519. res = 1;
  32520. }
  32521. }
  32522. return res
  32523. }
  32524. function needsNormalization (el) {
  32525. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  32526. }
  32527. function maybeComponent (el) {
  32528. return !isPlatformReservedTag$1(el.tag)
  32529. }
  32530. function genNode (node) {
  32531. if (node.type === 1) {
  32532. return genElement(node)
  32533. } else {
  32534. return genText(node)
  32535. }
  32536. }
  32537. function genText (text) {
  32538. return ("_v(" + (text.type === 2
  32539. ? text.expression // no need for () because already wrapped in _s()
  32540. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  32541. }
  32542. function genSlot (el) {
  32543. var slotName = el.slotName || '"default"';
  32544. var children = genChildren(el);
  32545. var res = "_t(" + slotName + (children ? ("," + children) : '');
  32546. var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
  32547. var bind$$1 = el.attrsMap['v-bind'];
  32548. if ((attrs || bind$$1) && !children) {
  32549. res += ",null";
  32550. }
  32551. if (attrs) {
  32552. res += "," + attrs;
  32553. }
  32554. if (bind$$1) {
  32555. res += (attrs ? '' : ',null') + "," + bind$$1;
  32556. }
  32557. return res + ')'
  32558. }
  32559. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  32560. function genComponent (componentName, el) {
  32561. var children = el.inlineTemplate ? null : genChildren(el, true);
  32562. return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
  32563. }
  32564. function genProps (props) {
  32565. var res = '';
  32566. for (var i = 0; i < props.length; i++) {
  32567. var prop = props[i];
  32568. res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
  32569. }
  32570. return res.slice(0, -1)
  32571. }
  32572. // #3895, #4268
  32573. function transformSpecialNewlines (text) {
  32574. return text
  32575. .replace(/\u2028/g, '\\u2028')
  32576. .replace(/\u2029/g, '\\u2029')
  32577. }
  32578. /* */
  32579. /**
  32580. * Compile a template.
  32581. */
  32582. function compile$1 (
  32583. template,
  32584. options
  32585. ) {
  32586. var ast = parse(template.trim(), options);
  32587. optimize(ast, options);
  32588. var code = generate(ast, options);
  32589. return {
  32590. ast: ast,
  32591. render: code.render,
  32592. staticRenderFns: code.staticRenderFns
  32593. }
  32594. }
  32595. /* */
  32596. // operators like typeof, instanceof and in are allowed
  32597. var prohibitedKeywordRE = new RegExp('\\b' + (
  32598. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  32599. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  32600. 'extends,finally,continue,debugger,function,arguments'
  32601. ).split(',').join('\\b|\\b') + '\\b');
  32602. // check valid identifier for v-for
  32603. var identRE = /[A-Za-z_$][\w$]*/;
  32604. // strip strings in expressions
  32605. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  32606. // detect problematic expressions in a template
  32607. function detectErrors (ast) {
  32608. var errors = [];
  32609. if (ast) {
  32610. checkNode(ast, errors);
  32611. }
  32612. return errors
  32613. }
  32614. function checkNode (node, errors) {
  32615. if (node.type === 1) {
  32616. for (var name in node.attrsMap) {
  32617. if (dirRE.test(name)) {
  32618. var value = node.attrsMap[name];
  32619. if (value) {
  32620. if (name === 'v-for') {
  32621. checkFor(node, ("v-for=\"" + value + "\""), errors);
  32622. } else {
  32623. checkExpression(value, (name + "=\"" + value + "\""), errors);
  32624. }
  32625. }
  32626. }
  32627. }
  32628. if (node.children) {
  32629. for (var i = 0; i < node.children.length; i++) {
  32630. checkNode(node.children[i], errors);
  32631. }
  32632. }
  32633. } else if (node.type === 2) {
  32634. checkExpression(node.expression, node.text, errors);
  32635. }
  32636. }
  32637. function checkFor (node, text, errors) {
  32638. checkExpression(node.for || '', text, errors);
  32639. checkIdentifier(node.alias, 'v-for alias', text, errors);
  32640. checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
  32641. checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
  32642. }
  32643. function checkIdentifier (ident, type, text, errors) {
  32644. if (typeof ident === 'string' && !identRE.test(ident)) {
  32645. errors.push(("- invalid " + type + " \"" + ident + "\" in expression: " + text));
  32646. }
  32647. }
  32648. function checkExpression (exp, text, errors) {
  32649. try {
  32650. new Function(("return " + exp));
  32651. } catch (e) {
  32652. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  32653. if (keywordMatch) {
  32654. errors.push(
  32655. "- avoid using JavaScript keyword as property name: " +
  32656. "\"" + (keywordMatch[0]) + "\" in expression " + text
  32657. );
  32658. } else {
  32659. errors.push(("- invalid expression: " + text));
  32660. }
  32661. }
  32662. }
  32663. /* */
  32664. function transformNode (el, options) {
  32665. var warn = options.warn || baseWarn;
  32666. var staticClass = getAndRemoveAttr(el, 'class');
  32667. if (process.env.NODE_ENV !== 'production' && staticClass) {
  32668. var expression = parseText(staticClass, options.delimiters);
  32669. if (expression) {
  32670. warn(
  32671. "class=\"" + staticClass + "\": " +
  32672. 'Interpolation inside attributes has been removed. ' +
  32673. 'Use v-bind or the colon shorthand instead. For example, ' +
  32674. 'instead of <div class="{{ val }}">, use <div :class="val">.'
  32675. );
  32676. }
  32677. }
  32678. if (staticClass) {
  32679. el.staticClass = JSON.stringify(staticClass);
  32680. }
  32681. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  32682. if (classBinding) {
  32683. el.classBinding = classBinding;
  32684. }
  32685. }
  32686. function genData$1 (el) {
  32687. var data = '';
  32688. if (el.staticClass) {
  32689. data += "staticClass:" + (el.staticClass) + ",";
  32690. }
  32691. if (el.classBinding) {
  32692. data += "class:" + (el.classBinding) + ",";
  32693. }
  32694. return data
  32695. }
  32696. var klass$1 = {
  32697. staticKeys: ['staticClass'],
  32698. transformNode: transformNode,
  32699. genData: genData$1
  32700. };
  32701. /* */
  32702. function transformNode$1 (el, options) {
  32703. var warn = options.warn || baseWarn;
  32704. var staticStyle = getAndRemoveAttr(el, 'style');
  32705. if (staticStyle) {
  32706. /* istanbul ignore if */
  32707. if (process.env.NODE_ENV !== 'production') {
  32708. var expression = parseText(staticStyle, options.delimiters);
  32709. if (expression) {
  32710. warn(
  32711. "style=\"" + staticStyle + "\": " +
  32712. 'Interpolation inside attributes has been removed. ' +
  32713. 'Use v-bind or the colon shorthand instead. For example, ' +
  32714. 'instead of <div style="{{ val }}">, use <div :style="val">.'
  32715. );
  32716. }
  32717. }
  32718. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  32719. }
  32720. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  32721. if (styleBinding) {
  32722. el.styleBinding = styleBinding;
  32723. }
  32724. }
  32725. function genData$2 (el) {
  32726. var data = '';
  32727. if (el.staticStyle) {
  32728. data += "staticStyle:" + (el.staticStyle) + ",";
  32729. }
  32730. if (el.styleBinding) {
  32731. data += "style:(" + (el.styleBinding) + "),";
  32732. }
  32733. return data
  32734. }
  32735. var style$1 = {
  32736. staticKeys: ['staticStyle'],
  32737. transformNode: transformNode$1,
  32738. genData: genData$2
  32739. };
  32740. var modules$1 = [
  32741. klass$1,
  32742. style$1
  32743. ];
  32744. /* */
  32745. var warn$3;
  32746. function model$1 (
  32747. el,
  32748. dir,
  32749. _warn
  32750. ) {
  32751. warn$3 = _warn;
  32752. var value = dir.value;
  32753. var modifiers = dir.modifiers;
  32754. var tag = el.tag;
  32755. var type = el.attrsMap.type;
  32756. if (process.env.NODE_ENV !== 'production') {
  32757. var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  32758. if (tag === 'input' && dynamicType) {
  32759. warn$3(
  32760. "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
  32761. "v-model does not support dynamic input types. Use v-if branches instead."
  32762. );
  32763. }
  32764. }
  32765. if (tag === 'select') {
  32766. genSelect(el, value, modifiers);
  32767. } else if (tag === 'input' && type === 'checkbox') {
  32768. genCheckboxModel(el, value, modifiers);
  32769. } else if (tag === 'input' && type === 'radio') {
  32770. genRadioModel(el, value, modifiers);
  32771. } else {
  32772. genDefaultModel(el, value, modifiers);
  32773. }
  32774. // ensure runtime directive metadata
  32775. return true
  32776. }
  32777. function genCheckboxModel (
  32778. el,
  32779. value,
  32780. modifiers
  32781. ) {
  32782. if (process.env.NODE_ENV !== 'production' &&
  32783. el.attrsMap.checked != null) {
  32784. warn$3(
  32785. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32786. "inline checked attributes will be ignored when using v-model. " +
  32787. 'Declare initial values in the component\'s data option instead.'
  32788. );
  32789. }
  32790. var number = modifiers && modifiers.number;
  32791. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32792. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  32793. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  32794. addProp(el, 'checked',
  32795. "Array.isArray(" + value + ")" +
  32796. "?_i(" + value + "," + valueBinding + ")>-1" + (
  32797. trueValueBinding === 'true'
  32798. ? (":(" + value + ")")
  32799. : (":_q(" + value + "," + trueValueBinding + ")")
  32800. )
  32801. );
  32802. addHandler(el, 'click',
  32803. "var $$a=" + value + "," +
  32804. '$$el=$event.target,' +
  32805. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  32806. 'if(Array.isArray($$a)){' +
  32807. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  32808. '$$i=_i($$a,$$v);' +
  32809. "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
  32810. "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
  32811. "}else{" + value + "=$$c}",
  32812. null, true
  32813. );
  32814. }
  32815. function genRadioModel (
  32816. el,
  32817. value,
  32818. modifiers
  32819. ) {
  32820. if (process.env.NODE_ENV !== 'production' &&
  32821. el.attrsMap.checked != null) {
  32822. warn$3(
  32823. "<" + (el.tag) + " v-model=\"" + value + "\" checked>:\n" +
  32824. "inline checked attributes will be ignored when using v-model. " +
  32825. 'Declare initial values in the component\'s data option instead.'
  32826. );
  32827. }
  32828. var number = modifiers && modifiers.number;
  32829. var valueBinding = getBindingAttr(el, 'value') || 'null';
  32830. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  32831. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  32832. addHandler(el, 'click', genAssignmentCode(value, valueBinding), null, true);
  32833. }
  32834. function genDefaultModel (
  32835. el,
  32836. value,
  32837. modifiers
  32838. ) {
  32839. if (process.env.NODE_ENV !== 'production') {
  32840. if (el.tag === 'input' && el.attrsMap.value) {
  32841. warn$3(
  32842. "<" + (el.tag) + " v-model=\"" + value + "\" value=\"" + (el.attrsMap.value) + "\">:\n" +
  32843. 'inline value attributes will be ignored when using v-model. ' +
  32844. 'Declare initial values in the component\'s data option instead.'
  32845. );
  32846. }
  32847. if (el.tag === 'textarea' && el.children.length) {
  32848. warn$3(
  32849. "<textarea v-model=\"" + value + "\">:\n" +
  32850. 'inline content inside <textarea> will be ignored when using v-model. ' +
  32851. 'Declare initial values in the component\'s data option instead.'
  32852. );
  32853. }
  32854. }
  32855. var type = el.attrsMap.type;
  32856. var ref = modifiers || {};
  32857. var lazy = ref.lazy;
  32858. var number = ref.number;
  32859. var trim = ref.trim;
  32860. var event = lazy || (isIE && type === 'range') ? 'change' : 'input';
  32861. var needCompositionGuard = !lazy && type !== 'range';
  32862. var isNative = el.tag === 'input' || el.tag === 'textarea';
  32863. var valueExpression = isNative
  32864. ? ("$event.target.value" + (trim ? '.trim()' : ''))
  32865. : trim ? "(typeof $event === 'string' ? $event.trim() : $event)" : "$event";
  32866. valueExpression = number || type === 'number'
  32867. ? ("_n(" + valueExpression + ")")
  32868. : valueExpression;
  32869. var code = genAssignmentCode(value, valueExpression);
  32870. if (isNative && needCompositionGuard) {
  32871. code = "if($event.target.composing)return;" + code;
  32872. }
  32873. // inputs with type="file" are read only and setting the input's
  32874. // value will throw an error.
  32875. if (process.env.NODE_ENV !== 'production' &&
  32876. type === 'file') {
  32877. warn$3(
  32878. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  32879. "File inputs are read only. Use a v-on:change listener instead."
  32880. );
  32881. }
  32882. addProp(el, 'value', isNative ? ("_s(" + value + ")") : ("(" + value + ")"));
  32883. addHandler(el, event, code, null, true);
  32884. if (trim || number || type === 'number') {
  32885. addHandler(el, 'blur', '$forceUpdate()');
  32886. }
  32887. }
  32888. function genSelect (
  32889. el,
  32890. value,
  32891. modifiers
  32892. ) {
  32893. if (process.env.NODE_ENV !== 'production') {
  32894. el.children.some(checkOptionWarning);
  32895. }
  32896. var number = modifiers && modifiers.number;
  32897. var assignment = "Array.prototype.filter" +
  32898. ".call($event.target.options,function(o){return o.selected})" +
  32899. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  32900. "return " + (number ? '_n(val)' : 'val') + "})" +
  32901. (el.attrsMap.multiple == null ? '[0]' : '');
  32902. var code = genAssignmentCode(value, assignment);
  32903. addHandler(el, 'change', code, null, true);
  32904. }
  32905. function checkOptionWarning (option) {
  32906. if (option.type === 1 &&
  32907. option.tag === 'option' &&
  32908. option.attrsMap.selected != null) {
  32909. warn$3(
  32910. "<select v-model=\"" + (option.parent.attrsMap['v-model']) + "\">:\n" +
  32911. 'inline selected attributes on <option> will be ignored when using v-model. ' +
  32912. 'Declare initial values in the component\'s data option instead.'
  32913. );
  32914. return true
  32915. }
  32916. return false
  32917. }
  32918. function genAssignmentCode (value, assignment) {
  32919. var modelRs = parseModel(value);
  32920. if (modelRs.idx === null) {
  32921. return (value + "=" + assignment)
  32922. } else {
  32923. return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
  32924. "if (!Array.isArray($$exp)){" +
  32925. value + "=" + assignment + "}" +
  32926. "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  32927. }
  32928. }
  32929. /* */
  32930. function text (el, dir) {
  32931. if (dir.value) {
  32932. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
  32933. }
  32934. }
  32935. /* */
  32936. function html (el, dir) {
  32937. if (dir.value) {
  32938. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
  32939. }
  32940. }
  32941. var directives$1 = {
  32942. model: model$1,
  32943. text: text,
  32944. html: html
  32945. };
  32946. /* */
  32947. var cache = Object.create(null);
  32948. var baseOptions = {
  32949. expectHTML: true,
  32950. modules: modules$1,
  32951. staticKeys: genStaticKeys(modules$1),
  32952. directives: directives$1,
  32953. isReservedTag: isReservedTag,
  32954. isUnaryTag: isUnaryTag,
  32955. mustUseProp: mustUseProp,
  32956. getTagNamespace: getTagNamespace,
  32957. isPreTag: isPreTag
  32958. };
  32959. function compile$$1 (
  32960. template,
  32961. options
  32962. ) {
  32963. options = options
  32964. ? extend(extend({}, baseOptions), options)
  32965. : baseOptions;
  32966. return compile$1(template, options)
  32967. }
  32968. function compileToFunctions (
  32969. template,
  32970. options,
  32971. vm
  32972. ) {
  32973. var _warn = (options && options.warn) || warn;
  32974. // detect possible CSP restriction
  32975. /* istanbul ignore if */
  32976. if (process.env.NODE_ENV !== 'production') {
  32977. try {
  32978. new Function('return 1');
  32979. } catch (e) {
  32980. if (e.toString().match(/unsafe-eval|CSP/)) {
  32981. _warn(
  32982. 'It seems you are using the standalone build of Vue.js in an ' +
  32983. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  32984. 'The template compiler cannot work in this environment. Consider ' +
  32985. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  32986. 'templates into render functions.'
  32987. );
  32988. }
  32989. }
  32990. }
  32991. var key = options && options.delimiters
  32992. ? String(options.delimiters) + template
  32993. : template;
  32994. if (cache[key]) {
  32995. return cache[key]
  32996. }
  32997. var res = {};
  32998. var compiled = compile$$1(template, options);
  32999. res.render = makeFunction(compiled.render);
  33000. var l = compiled.staticRenderFns.length;
  33001. res.staticRenderFns = new Array(l);
  33002. for (var i = 0; i < l; i++) {
  33003. res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i]);
  33004. }
  33005. if (process.env.NODE_ENV !== 'production') {
  33006. if (res.render === noop || res.staticRenderFns.some(function (fn) { return fn === noop; })) {
  33007. _warn(
  33008. "failed to compile template:\n\n" + template + "\n\n" +
  33009. detectErrors(compiled.ast).join('\n') +
  33010. '\n\n',
  33011. vm
  33012. );
  33013. }
  33014. }
  33015. return (cache[key] = res)
  33016. }
  33017. function makeFunction (code) {
  33018. try {
  33019. return new Function(code)
  33020. } catch (e) {
  33021. return noop
  33022. }
  33023. }
  33024. /* */
  33025. var idToTemplate = cached(function (id) {
  33026. var el = query(id);
  33027. return el && el.innerHTML
  33028. });
  33029. var mount = Vue$3.prototype.$mount;
  33030. Vue$3.prototype.$mount = function (
  33031. el,
  33032. hydrating
  33033. ) {
  33034. el = el && query(el);
  33035. /* istanbul ignore if */
  33036. if (el === document.body || el === document.documentElement) {
  33037. process.env.NODE_ENV !== 'production' && warn(
  33038. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  33039. );
  33040. return this
  33041. }
  33042. var options = this.$options;
  33043. // resolve template/el and convert to render function
  33044. if (!options.render) {
  33045. var template = options.template;
  33046. if (template) {
  33047. if (typeof template === 'string') {
  33048. if (template.charAt(0) === '#') {
  33049. template = idToTemplate(template);
  33050. /* istanbul ignore if */
  33051. if (process.env.NODE_ENV !== 'production' && !template) {
  33052. warn(
  33053. ("Template element not found or is empty: " + (options.template)),
  33054. this
  33055. );
  33056. }
  33057. }
  33058. } else if (template.nodeType) {
  33059. template = template.innerHTML;
  33060. } else {
  33061. if (process.env.NODE_ENV !== 'production') {
  33062. warn('invalid template option:' + template, this);
  33063. }
  33064. return this
  33065. }
  33066. } else if (el) {
  33067. template = getOuterHTML(el);
  33068. }
  33069. if (template) {
  33070. var ref = compileToFunctions(template, {
  33071. warn: warn,
  33072. shouldDecodeNewlines: shouldDecodeNewlines,
  33073. delimiters: options.delimiters
  33074. }, this);
  33075. var render = ref.render;
  33076. var staticRenderFns = ref.staticRenderFns;
  33077. options.render = render;
  33078. options.staticRenderFns = staticRenderFns;
  33079. }
  33080. }
  33081. return mount.call(this, el, hydrating)
  33082. };
  33083. /**
  33084. * Get outerHTML of elements, taking care
  33085. * of SVG elements in IE as well.
  33086. */
  33087. function getOuterHTML (el) {
  33088. if (el.outerHTML) {
  33089. return el.outerHTML
  33090. } else {
  33091. var container = document.createElement('div');
  33092. container.appendChild(el.cloneNode(true));
  33093. return container.innerHTML
  33094. }
  33095. }
  33096. Vue$3.compile = compileToFunctions;
  33097. module.exports = Vue$3;
  33098. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(113), __webpack_require__(190)))
  33099. /***/ }),
  33100. /* 125 */
  33101. /***/ (function(module, exports, __webpack_require__) {
  33102. /**
  33103. * @namespace Chart
  33104. */
  33105. var Chart = __webpack_require__(146)();
  33106. __webpack_require__(144)(Chart);
  33107. __webpack_require__(160)(Chart);
  33108. __webpack_require__(140)(Chart);
  33109. __webpack_require__(149)(Chart);
  33110. __webpack_require__(143)(Chart);
  33111. __webpack_require__(139)(Chart);
  33112. __webpack_require__(141)(Chart);
  33113. __webpack_require__(142)(Chart);
  33114. __webpack_require__(147)(Chart);
  33115. __webpack_require__(151)(Chart);
  33116. __webpack_require__(152)(Chart);
  33117. __webpack_require__(150)(Chart);
  33118. __webpack_require__(153)(Chart);
  33119. __webpack_require__(148)(Chart);
  33120. __webpack_require__(145)(Chart);
  33121. __webpack_require__(154)(Chart);
  33122. __webpack_require__(155)(Chart);
  33123. __webpack_require__(156)(Chart);
  33124. __webpack_require__(157)(Chart);
  33125. __webpack_require__(158)(Chart);
  33126. __webpack_require__(163)(Chart);
  33127. __webpack_require__(161)(Chart);
  33128. __webpack_require__(162)(Chart);
  33129. __webpack_require__(164)(Chart);
  33130. __webpack_require__(165)(Chart);
  33131. __webpack_require__(166)(Chart);
  33132. // Controllers must be loaded after elements
  33133. // See Chart.core.datasetController.dataElementType
  33134. __webpack_require__(133)(Chart);
  33135. __webpack_require__(134)(Chart);
  33136. __webpack_require__(135)(Chart);
  33137. __webpack_require__(136)(Chart);
  33138. __webpack_require__(137)(Chart);
  33139. __webpack_require__(138)(Chart);
  33140. __webpack_require__(126)(Chart);
  33141. __webpack_require__(127)(Chart);
  33142. __webpack_require__(128)(Chart);
  33143. __webpack_require__(129)(Chart);
  33144. __webpack_require__(130)(Chart);
  33145. __webpack_require__(131)(Chart);
  33146. __webpack_require__(132)(Chart);
  33147. window.Chart = module.exports = Chart;
  33148. /***/ }),
  33149. /* 126 */
  33150. /***/ (function(module, exports, __webpack_require__) {
  33151. "use strict";
  33152. module.exports = function(Chart) {
  33153. Chart.Bar = function(context, config) {
  33154. config.type = 'bar';
  33155. return new Chart(context, config);
  33156. };
  33157. };
  33158. /***/ }),
  33159. /* 127 */
  33160. /***/ (function(module, exports, __webpack_require__) {
  33161. "use strict";
  33162. module.exports = function(Chart) {
  33163. Chart.Bubble = function(context, config) {
  33164. config.type = 'bubble';
  33165. return new Chart(context, config);
  33166. };
  33167. };
  33168. /***/ }),
  33169. /* 128 */
  33170. /***/ (function(module, exports, __webpack_require__) {
  33171. "use strict";
  33172. module.exports = function(Chart) {
  33173. Chart.Doughnut = function(context, config) {
  33174. config.type = 'doughnut';
  33175. return new Chart(context, config);
  33176. };
  33177. };
  33178. /***/ }),
  33179. /* 129 */
  33180. /***/ (function(module, exports, __webpack_require__) {
  33181. "use strict";
  33182. module.exports = function(Chart) {
  33183. Chart.Line = function(context, config) {
  33184. config.type = 'line';
  33185. return new Chart(context, config);
  33186. };
  33187. };
  33188. /***/ }),
  33189. /* 130 */
  33190. /***/ (function(module, exports, __webpack_require__) {
  33191. "use strict";
  33192. module.exports = function(Chart) {
  33193. Chart.PolarArea = function(context, config) {
  33194. config.type = 'polarArea';
  33195. return new Chart(context, config);
  33196. };
  33197. };
  33198. /***/ }),
  33199. /* 131 */
  33200. /***/ (function(module, exports, __webpack_require__) {
  33201. "use strict";
  33202. module.exports = function(Chart) {
  33203. Chart.Radar = function(context, config) {
  33204. config.type = 'radar';
  33205. return new Chart(context, config);
  33206. };
  33207. };
  33208. /***/ }),
  33209. /* 132 */
  33210. /***/ (function(module, exports, __webpack_require__) {
  33211. "use strict";
  33212. module.exports = function(Chart) {
  33213. var defaultConfig = {
  33214. hover: {
  33215. mode: 'single'
  33216. },
  33217. scales: {
  33218. xAxes: [{
  33219. type: 'linear', // scatter should not use a category axis
  33220. position: 'bottom',
  33221. id: 'x-axis-1' // need an ID so datasets can reference the scale
  33222. }],
  33223. yAxes: [{
  33224. type: 'linear',
  33225. position: 'left',
  33226. id: 'y-axis-1'
  33227. }]
  33228. },
  33229. tooltips: {
  33230. callbacks: {
  33231. title: function() {
  33232. // Title doesn't make sense for scatter since we format the data as a point
  33233. return '';
  33234. },
  33235. label: function(tooltipItem) {
  33236. return '(' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ')';
  33237. }
  33238. }
  33239. }
  33240. };
  33241. // Register the default config for this type
  33242. Chart.defaults.scatter = defaultConfig;
  33243. // Scatter charts use line controllers
  33244. Chart.controllers.scatter = Chart.controllers.line;
  33245. Chart.Scatter = function(context, config) {
  33246. config.type = 'scatter';
  33247. return new Chart(context, config);
  33248. };
  33249. };
  33250. /***/ }),
  33251. /* 133 */
  33252. /***/ (function(module, exports, __webpack_require__) {
  33253. "use strict";
  33254. module.exports = function(Chart) {
  33255. var helpers = Chart.helpers;
  33256. Chart.defaults.bar = {
  33257. hover: {
  33258. mode: 'label'
  33259. },
  33260. scales: {
  33261. xAxes: [{
  33262. type: 'category',
  33263. // Specific to Bar Controller
  33264. categoryPercentage: 0.8,
  33265. barPercentage: 0.9,
  33266. // grid line settings
  33267. gridLines: {
  33268. offsetGridLines: true
  33269. }
  33270. }],
  33271. yAxes: [{
  33272. type: 'linear'
  33273. }]
  33274. }
  33275. };
  33276. Chart.controllers.bar = Chart.DatasetController.extend({
  33277. dataElementType: Chart.elements.Rectangle,
  33278. initialize: function(chart, datasetIndex) {
  33279. Chart.DatasetController.prototype.initialize.call(this, chart, datasetIndex);
  33280. var me = this;
  33281. var meta = me.getMeta();
  33282. var dataset = me.getDataset();
  33283. meta.stack = dataset.stack;
  33284. // Use this to indicate that this is a bar dataset.
  33285. meta.bar = true;
  33286. },
  33287. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33288. getStackCount: function() {
  33289. var me = this;
  33290. var meta = me.getMeta();
  33291. var yScale = me.getScaleForId(meta.yAxisID);
  33292. var stacks = [];
  33293. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33294. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33295. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33296. (yScale.options.stacked === false ||
  33297. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33298. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33299. stacks.push(dsMeta.stack);
  33300. }
  33301. }, me);
  33302. return stacks.length;
  33303. },
  33304. update: function(reset) {
  33305. var me = this;
  33306. helpers.each(me.getMeta().data, function(rectangle, index) {
  33307. me.updateElement(rectangle, index, reset);
  33308. }, me);
  33309. },
  33310. updateElement: function(rectangle, index, reset) {
  33311. var me = this;
  33312. var meta = me.getMeta();
  33313. var xScale = me.getScaleForId(meta.xAxisID);
  33314. var yScale = me.getScaleForId(meta.yAxisID);
  33315. var scaleBase = yScale.getBasePixel();
  33316. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33317. var custom = rectangle.custom || {};
  33318. var dataset = me.getDataset();
  33319. rectangle._xScale = xScale;
  33320. rectangle._yScale = yScale;
  33321. rectangle._datasetIndex = me.index;
  33322. rectangle._index = index;
  33323. var ruler = me.getRuler(index); // The index argument for compatible
  33324. rectangle._model = {
  33325. x: me.calculateBarX(index, me.index, ruler),
  33326. y: reset ? scaleBase : me.calculateBarY(index, me.index),
  33327. // Tooltip
  33328. label: me.chart.data.labels[index],
  33329. datasetLabel: dataset.label,
  33330. // Appearance
  33331. horizontal: false,
  33332. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33333. width: me.calculateBarWidth(ruler),
  33334. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33335. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33336. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33337. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33338. };
  33339. rectangle.pivot();
  33340. },
  33341. calculateBarBase: function(datasetIndex, index) {
  33342. var me = this;
  33343. var meta = me.getMeta();
  33344. var yScale = me.getScaleForId(meta.yAxisID);
  33345. var base = yScale.getBaseValue();
  33346. var original = base;
  33347. if ((yScale.options.stacked === true) ||
  33348. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33349. var chart = me.chart;
  33350. var datasets = chart.data.datasets;
  33351. var value = Number(datasets[datasetIndex].data[index]);
  33352. for (var i = 0; i < datasetIndex; i++) {
  33353. var currentDs = datasets[i];
  33354. var currentDsMeta = chart.getDatasetMeta(i);
  33355. if (currentDsMeta.bar && currentDsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i) &&
  33356. meta.stack === currentDsMeta.stack) {
  33357. var currentVal = Number(currentDs.data[index]);
  33358. base += value < 0 ? Math.min(currentVal, original) : Math.max(currentVal, original);
  33359. }
  33360. }
  33361. return yScale.getPixelForValue(base);
  33362. }
  33363. return yScale.getBasePixel();
  33364. },
  33365. getRuler: function() {
  33366. var me = this;
  33367. var meta = me.getMeta();
  33368. var xScale = me.getScaleForId(meta.xAxisID);
  33369. var stackCount = me.getStackCount();
  33370. var tickWidth = xScale.width / xScale.ticks.length;
  33371. var categoryWidth = tickWidth * xScale.options.categoryPercentage;
  33372. var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2;
  33373. var fullBarWidth = categoryWidth / stackCount;
  33374. var barWidth = fullBarWidth * xScale.options.barPercentage;
  33375. var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage);
  33376. return {
  33377. stackCount: stackCount,
  33378. tickWidth: tickWidth,
  33379. categoryWidth: categoryWidth,
  33380. categorySpacing: categorySpacing,
  33381. fullBarWidth: fullBarWidth,
  33382. barWidth: barWidth,
  33383. barSpacing: barSpacing
  33384. };
  33385. },
  33386. calculateBarWidth: function(ruler) {
  33387. var me = this;
  33388. var meta = me.getMeta();
  33389. var xScale = me.getScaleForId(meta.xAxisID);
  33390. if (xScale.options.barThickness) {
  33391. return xScale.options.barThickness;
  33392. }
  33393. return ruler.barWidth;
  33394. },
  33395. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33396. getStackIndex: function(datasetIndex) {
  33397. var me = this;
  33398. var meta = me.chart.getDatasetMeta(datasetIndex);
  33399. var yScale = me.getScaleForId(meta.yAxisID);
  33400. var dsMeta, j;
  33401. var stacks = [meta.stack];
  33402. for (j = 0; j < datasetIndex; ++j) {
  33403. dsMeta = this.chart.getDatasetMeta(j);
  33404. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33405. (yScale.options.stacked === false ||
  33406. (yScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33407. (yScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33408. stacks.push(dsMeta.stack);
  33409. }
  33410. }
  33411. return stacks.length - 1;
  33412. },
  33413. calculateBarX: function(index, datasetIndex, ruler) {
  33414. var me = this;
  33415. var meta = me.getMeta();
  33416. var xScale = me.getScaleForId(meta.xAxisID);
  33417. var stackIndex = me.getStackIndex(datasetIndex);
  33418. var leftTick = xScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33419. leftTick -= me.chart.isCombo ? (ruler.tickWidth / 2) : 0;
  33420. return leftTick +
  33421. (ruler.barWidth / 2) +
  33422. ruler.categorySpacing +
  33423. (ruler.barWidth * stackIndex) +
  33424. (ruler.barSpacing / 2) +
  33425. (ruler.barSpacing * stackIndex);
  33426. },
  33427. calculateBarY: function(index, datasetIndex) {
  33428. var me = this;
  33429. var meta = me.getMeta();
  33430. var yScale = me.getScaleForId(meta.yAxisID);
  33431. var value = Number(me.getDataset().data[index]);
  33432. if (yScale.options.stacked ||
  33433. (yScale.options.stacked === undefined && meta.stack !== undefined)) {
  33434. var base = yScale.getBaseValue();
  33435. var sumPos = base,
  33436. sumNeg = base;
  33437. for (var i = 0; i < datasetIndex; i++) {
  33438. var ds = me.chart.data.datasets[i];
  33439. var dsMeta = me.chart.getDatasetMeta(i);
  33440. if (dsMeta.bar && dsMeta.yAxisID === yScale.id && me.chart.isDatasetVisible(i) &&
  33441. meta.stack === dsMeta.stack) {
  33442. var stackedVal = Number(ds.data[index]);
  33443. if (stackedVal < 0) {
  33444. sumNeg += stackedVal || 0;
  33445. } else {
  33446. sumPos += stackedVal || 0;
  33447. }
  33448. }
  33449. }
  33450. if (value < 0) {
  33451. return yScale.getPixelForValue(sumNeg + value);
  33452. }
  33453. return yScale.getPixelForValue(sumPos + value);
  33454. }
  33455. return yScale.getPixelForValue(value);
  33456. },
  33457. draw: function(ease) {
  33458. var me = this;
  33459. var easingDecimal = ease || 1;
  33460. var metaData = me.getMeta().data;
  33461. var dataset = me.getDataset();
  33462. var i, len;
  33463. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  33464. for (i = 0, len = metaData.length; i < len; ++i) {
  33465. var d = dataset.data[i];
  33466. if (d !== null && d !== undefined && !isNaN(d)) {
  33467. metaData[i].transition(easingDecimal).draw();
  33468. }
  33469. }
  33470. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  33471. },
  33472. setHoverStyle: function(rectangle) {
  33473. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33474. var index = rectangle._index;
  33475. var custom = rectangle.custom || {};
  33476. var model = rectangle._model;
  33477. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  33478. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  33479. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  33480. },
  33481. removeHoverStyle: function(rectangle) {
  33482. var dataset = this.chart.data.datasets[rectangle._datasetIndex];
  33483. var index = rectangle._index;
  33484. var custom = rectangle.custom || {};
  33485. var model = rectangle._model;
  33486. var rectangleElementOptions = this.chart.options.elements.rectangle;
  33487. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);
  33488. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);
  33489. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);
  33490. }
  33491. });
  33492. // including horizontalBar in the bar file, instead of a file of its own
  33493. // it extends bar (like pie extends doughnut)
  33494. Chart.defaults.horizontalBar = {
  33495. hover: {
  33496. mode: 'label'
  33497. },
  33498. scales: {
  33499. xAxes: [{
  33500. type: 'linear',
  33501. position: 'bottom'
  33502. }],
  33503. yAxes: [{
  33504. position: 'left',
  33505. type: 'category',
  33506. // Specific to Horizontal Bar Controller
  33507. categoryPercentage: 0.8,
  33508. barPercentage: 0.9,
  33509. // grid line settings
  33510. gridLines: {
  33511. offsetGridLines: true
  33512. }
  33513. }]
  33514. },
  33515. elements: {
  33516. rectangle: {
  33517. borderSkipped: 'left'
  33518. }
  33519. },
  33520. tooltips: {
  33521. callbacks: {
  33522. title: function(tooltipItems, data) {
  33523. // Pick first xLabel for now
  33524. var title = '';
  33525. if (tooltipItems.length > 0) {
  33526. if (tooltipItems[0].yLabel) {
  33527. title = tooltipItems[0].yLabel;
  33528. } else if (data.labels.length > 0 && tooltipItems[0].index < data.labels.length) {
  33529. title = data.labels[tooltipItems[0].index];
  33530. }
  33531. }
  33532. return title;
  33533. },
  33534. label: function(tooltipItem, data) {
  33535. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33536. return datasetLabel + ': ' + tooltipItem.xLabel;
  33537. }
  33538. }
  33539. }
  33540. };
  33541. Chart.controllers.horizontalBar = Chart.controllers.bar.extend({
  33542. // Correctly calculate the bar width accounting for stacks and the fact that not all bars are visible
  33543. getStackCount: function() {
  33544. var me = this;
  33545. var meta = me.getMeta();
  33546. var xScale = me.getScaleForId(meta.xAxisID);
  33547. var stacks = [];
  33548. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  33549. var dsMeta = me.chart.getDatasetMeta(datasetIndex);
  33550. if (dsMeta.bar && me.chart.isDatasetVisible(datasetIndex) &&
  33551. (xScale.options.stacked === false ||
  33552. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33553. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33554. stacks.push(dsMeta.stack);
  33555. }
  33556. }, me);
  33557. return stacks.length;
  33558. },
  33559. updateElement: function(rectangle, index, reset) {
  33560. var me = this;
  33561. var meta = me.getMeta();
  33562. var xScale = me.getScaleForId(meta.xAxisID);
  33563. var yScale = me.getScaleForId(meta.yAxisID);
  33564. var scaleBase = xScale.getBasePixel();
  33565. var custom = rectangle.custom || {};
  33566. var dataset = me.getDataset();
  33567. var rectangleElementOptions = me.chart.options.elements.rectangle;
  33568. rectangle._xScale = xScale;
  33569. rectangle._yScale = yScale;
  33570. rectangle._datasetIndex = me.index;
  33571. rectangle._index = index;
  33572. var ruler = me.getRuler(index); // The index argument for compatible
  33573. rectangle._model = {
  33574. x: reset ? scaleBase : me.calculateBarX(index, me.index),
  33575. y: me.calculateBarY(index, me.index, ruler),
  33576. // Tooltip
  33577. label: me.chart.data.labels[index],
  33578. datasetLabel: dataset.label,
  33579. // Appearance
  33580. horizontal: true,
  33581. base: reset ? scaleBase : me.calculateBarBase(me.index, index),
  33582. height: me.calculateBarHeight(ruler),
  33583. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor),
  33584. borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleElementOptions.borderSkipped,
  33585. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor),
  33586. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth)
  33587. };
  33588. rectangle.pivot();
  33589. },
  33590. calculateBarBase: function(datasetIndex, index) {
  33591. var me = this;
  33592. var meta = me.getMeta();
  33593. var xScale = me.getScaleForId(meta.xAxisID);
  33594. var base = xScale.getBaseValue();
  33595. var originalBase = base;
  33596. if (xScale.options.stacked ||
  33597. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33598. var chart = me.chart;
  33599. var datasets = chart.data.datasets;
  33600. var value = Number(datasets[datasetIndex].data[index]);
  33601. for (var i = 0; i < datasetIndex; i++) {
  33602. var currentDs = datasets[i];
  33603. var currentDsMeta = chart.getDatasetMeta(i);
  33604. if (currentDsMeta.bar && currentDsMeta.xAxisID === xScale.id && chart.isDatasetVisible(i) &&
  33605. meta.stack === currentDsMeta.stack) {
  33606. var currentVal = Number(currentDs.data[index]);
  33607. base += value < 0 ? Math.min(currentVal, originalBase) : Math.max(currentVal, originalBase);
  33608. }
  33609. }
  33610. return xScale.getPixelForValue(base);
  33611. }
  33612. return xScale.getBasePixel();
  33613. },
  33614. getRuler: function() {
  33615. var me = this;
  33616. var meta = me.getMeta();
  33617. var yScale = me.getScaleForId(meta.yAxisID);
  33618. var stackCount = me.getStackCount();
  33619. var tickHeight = yScale.height / yScale.ticks.length;
  33620. var categoryHeight = tickHeight * yScale.options.categoryPercentage;
  33621. var categorySpacing = (tickHeight - (tickHeight * yScale.options.categoryPercentage)) / 2;
  33622. var fullBarHeight = categoryHeight / stackCount;
  33623. var barHeight = fullBarHeight * yScale.options.barPercentage;
  33624. var barSpacing = fullBarHeight - (fullBarHeight * yScale.options.barPercentage);
  33625. return {
  33626. stackCount: stackCount,
  33627. tickHeight: tickHeight,
  33628. categoryHeight: categoryHeight,
  33629. categorySpacing: categorySpacing,
  33630. fullBarHeight: fullBarHeight,
  33631. barHeight: barHeight,
  33632. barSpacing: barSpacing
  33633. };
  33634. },
  33635. calculateBarHeight: function(ruler) {
  33636. var me = this;
  33637. var meta = me.getMeta();
  33638. var yScale = me.getScaleForId(meta.yAxisID);
  33639. if (yScale.options.barThickness) {
  33640. return yScale.options.barThickness;
  33641. }
  33642. return ruler.barHeight;
  33643. },
  33644. // Get stack index from the given dataset index accounting for stacks and the fact that not all bars are visible
  33645. getStackIndex: function(datasetIndex) {
  33646. var me = this;
  33647. var meta = me.chart.getDatasetMeta(datasetIndex);
  33648. var xScale = me.getScaleForId(meta.xAxisID);
  33649. var dsMeta, j;
  33650. var stacks = [meta.stack];
  33651. for (j = 0; j < datasetIndex; ++j) {
  33652. dsMeta = this.chart.getDatasetMeta(j);
  33653. if (dsMeta.bar && this.chart.isDatasetVisible(j) &&
  33654. (xScale.options.stacked === false ||
  33655. (xScale.options.stacked === true && stacks.indexOf(dsMeta.stack) === -1) ||
  33656. (xScale.options.stacked === undefined && (dsMeta.stack === undefined || stacks.indexOf(dsMeta.stack) === -1)))) {
  33657. stacks.push(dsMeta.stack);
  33658. }
  33659. }
  33660. return stacks.length - 1;
  33661. },
  33662. calculateBarX: function(index, datasetIndex) {
  33663. var me = this;
  33664. var meta = me.getMeta();
  33665. var xScale = me.getScaleForId(meta.xAxisID);
  33666. var value = Number(me.getDataset().data[index]);
  33667. if (xScale.options.stacked ||
  33668. (xScale.options.stacked === undefined && meta.stack !== undefined)) {
  33669. var base = xScale.getBaseValue();
  33670. var sumPos = base,
  33671. sumNeg = base;
  33672. for (var i = 0; i < datasetIndex; i++) {
  33673. var ds = me.chart.data.datasets[i];
  33674. var dsMeta = me.chart.getDatasetMeta(i);
  33675. if (dsMeta.bar && dsMeta.xAxisID === xScale.id && me.chart.isDatasetVisible(i) &&
  33676. meta.stack === dsMeta.stack) {
  33677. var stackedVal = Number(ds.data[index]);
  33678. if (stackedVal < 0) {
  33679. sumNeg += stackedVal || 0;
  33680. } else {
  33681. sumPos += stackedVal || 0;
  33682. }
  33683. }
  33684. }
  33685. if (value < 0) {
  33686. return xScale.getPixelForValue(sumNeg + value);
  33687. }
  33688. return xScale.getPixelForValue(sumPos + value);
  33689. }
  33690. return xScale.getPixelForValue(value);
  33691. },
  33692. calculateBarY: function(index, datasetIndex, ruler) {
  33693. var me = this;
  33694. var meta = me.getMeta();
  33695. var yScale = me.getScaleForId(meta.yAxisID);
  33696. var stackIndex = me.getStackIndex(datasetIndex);
  33697. var topTick = yScale.getPixelForValue(null, index, datasetIndex, me.chart.isCombo);
  33698. topTick -= me.chart.isCombo ? (ruler.tickHeight / 2) : 0;
  33699. return topTick +
  33700. (ruler.barHeight / 2) +
  33701. ruler.categorySpacing +
  33702. (ruler.barHeight * stackIndex) +
  33703. (ruler.barSpacing / 2) +
  33704. (ruler.barSpacing * stackIndex);
  33705. }
  33706. });
  33707. };
  33708. /***/ }),
  33709. /* 134 */
  33710. /***/ (function(module, exports, __webpack_require__) {
  33711. "use strict";
  33712. module.exports = function(Chart) {
  33713. var helpers = Chart.helpers;
  33714. Chart.defaults.bubble = {
  33715. hover: {
  33716. mode: 'single'
  33717. },
  33718. scales: {
  33719. xAxes: [{
  33720. type: 'linear', // bubble should probably use a linear scale by default
  33721. position: 'bottom',
  33722. id: 'x-axis-0' // need an ID so datasets can reference the scale
  33723. }],
  33724. yAxes: [{
  33725. type: 'linear',
  33726. position: 'left',
  33727. id: 'y-axis-0'
  33728. }]
  33729. },
  33730. tooltips: {
  33731. callbacks: {
  33732. title: function() {
  33733. // Title doesn't make sense for scatter since we format the data as a point
  33734. return '';
  33735. },
  33736. label: function(tooltipItem, data) {
  33737. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  33738. var dataPoint = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  33739. return datasetLabel + ': (' + tooltipItem.xLabel + ', ' + tooltipItem.yLabel + ', ' + dataPoint.r + ')';
  33740. }
  33741. }
  33742. }
  33743. };
  33744. Chart.controllers.bubble = Chart.DatasetController.extend({
  33745. dataElementType: Chart.elements.Point,
  33746. update: function(reset) {
  33747. var me = this;
  33748. var meta = me.getMeta();
  33749. var points = meta.data;
  33750. // Update Points
  33751. helpers.each(points, function(point, index) {
  33752. me.updateElement(point, index, reset);
  33753. });
  33754. },
  33755. updateElement: function(point, index, reset) {
  33756. var me = this;
  33757. var meta = me.getMeta();
  33758. var xScale = me.getScaleForId(meta.xAxisID);
  33759. var yScale = me.getScaleForId(meta.yAxisID);
  33760. var custom = point.custom || {};
  33761. var dataset = me.getDataset();
  33762. var data = dataset.data[index];
  33763. var pointElementOptions = me.chart.options.elements.point;
  33764. var dsIndex = me.index;
  33765. helpers.extend(point, {
  33766. // Utility
  33767. _xScale: xScale,
  33768. _yScale: yScale,
  33769. _datasetIndex: dsIndex,
  33770. _index: index,
  33771. // Desired view properties
  33772. _model: {
  33773. x: reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex, me.chart.isCombo),
  33774. y: reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex),
  33775. // Appearance
  33776. radius: reset ? 0 : custom.radius ? custom.radius : me.getRadius(data),
  33777. // Tooltip
  33778. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  33779. }
  33780. });
  33781. // Trick to reset the styles of the point
  33782. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, pointElementOptions);
  33783. var model = point._model;
  33784. model.skip = custom.skip ? custom.skip : (isNaN(model.x) || isNaN(model.y));
  33785. point.pivot();
  33786. },
  33787. getRadius: function(value) {
  33788. return value.r || this.chart.options.elements.point.radius;
  33789. },
  33790. setHoverStyle: function(point) {
  33791. var me = this;
  33792. Chart.DatasetController.prototype.setHoverStyle.call(me, point);
  33793. // Radius
  33794. var dataset = me.chart.data.datasets[point._datasetIndex];
  33795. var index = point._index;
  33796. var custom = point.custom || {};
  33797. var model = point._model;
  33798. model.radius = custom.hoverRadius ? custom.hoverRadius : (helpers.getValueAtIndexOrDefault(dataset.hoverRadius, index, me.chart.options.elements.point.hoverRadius)) + me.getRadius(dataset.data[index]);
  33799. },
  33800. removeHoverStyle: function(point) {
  33801. var me = this;
  33802. Chart.DatasetController.prototype.removeHoverStyle.call(me, point, me.chart.options.elements.point);
  33803. var dataVal = me.chart.data.datasets[point._datasetIndex].data[point._index];
  33804. var custom = point.custom || {};
  33805. var model = point._model;
  33806. model.radius = custom.radius ? custom.radius : me.getRadius(dataVal);
  33807. }
  33808. });
  33809. };
  33810. /***/ }),
  33811. /* 135 */
  33812. /***/ (function(module, exports, __webpack_require__) {
  33813. "use strict";
  33814. module.exports = function(Chart) {
  33815. var helpers = Chart.helpers,
  33816. defaults = Chart.defaults;
  33817. defaults.doughnut = {
  33818. animation: {
  33819. // Boolean - Whether we animate the rotation of the Doughnut
  33820. animateRotate: true,
  33821. // Boolean - Whether we animate scaling the Doughnut from the centre
  33822. animateScale: false
  33823. },
  33824. aspectRatio: 1,
  33825. hover: {
  33826. mode: 'single'
  33827. },
  33828. legendCallback: function(chart) {
  33829. var text = [];
  33830. text.push('<ul class="' + chart.id + '-legend">');
  33831. var data = chart.data;
  33832. var datasets = data.datasets;
  33833. var labels = data.labels;
  33834. if (datasets.length) {
  33835. for (var i = 0; i < datasets[0].data.length; ++i) {
  33836. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  33837. if (labels[i]) {
  33838. text.push(labels[i]);
  33839. }
  33840. text.push('</li>');
  33841. }
  33842. }
  33843. text.push('</ul>');
  33844. return text.join('');
  33845. },
  33846. legend: {
  33847. labels: {
  33848. generateLabels: function(chart) {
  33849. var data = chart.data;
  33850. if (data.labels.length && data.datasets.length) {
  33851. return data.labels.map(function(label, i) {
  33852. var meta = chart.getDatasetMeta(0);
  33853. var ds = data.datasets[0];
  33854. var arc = meta.data[i];
  33855. var custom = arc && arc.custom || {};
  33856. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  33857. var arcOpts = chart.options.elements.arc;
  33858. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  33859. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  33860. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  33861. return {
  33862. text: label,
  33863. fillStyle: fill,
  33864. strokeStyle: stroke,
  33865. lineWidth: bw,
  33866. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  33867. // Extra data used for toggling the correct item
  33868. index: i
  33869. };
  33870. });
  33871. }
  33872. return [];
  33873. }
  33874. },
  33875. onClick: function(e, legendItem) {
  33876. var index = legendItem.index;
  33877. var chart = this.chart;
  33878. var i, ilen, meta;
  33879. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  33880. meta = chart.getDatasetMeta(i);
  33881. // toggle visibility of index if exists
  33882. if (meta.data[index]) {
  33883. meta.data[index].hidden = !meta.data[index].hidden;
  33884. }
  33885. }
  33886. chart.update();
  33887. }
  33888. },
  33889. // The percentage of the chart that we cut out of the middle.
  33890. cutoutPercentage: 50,
  33891. // The rotation of the chart, where the first data arc begins.
  33892. rotation: Math.PI * -0.5,
  33893. // The total circumference of the chart.
  33894. circumference: Math.PI * 2.0,
  33895. // Need to override these to give a nice default
  33896. tooltips: {
  33897. callbacks: {
  33898. title: function() {
  33899. return '';
  33900. },
  33901. label: function(tooltipItem, data) {
  33902. var dataLabel = data.labels[tooltipItem.index];
  33903. var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  33904. if (helpers.isArray(dataLabel)) {
  33905. // show value on first line of multiline label
  33906. // need to clone because we are changing the value
  33907. dataLabel = dataLabel.slice();
  33908. dataLabel[0] += value;
  33909. } else {
  33910. dataLabel += value;
  33911. }
  33912. return dataLabel;
  33913. }
  33914. }
  33915. }
  33916. };
  33917. defaults.pie = helpers.clone(defaults.doughnut);
  33918. helpers.extend(defaults.pie, {
  33919. cutoutPercentage: 0
  33920. });
  33921. Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({
  33922. dataElementType: Chart.elements.Arc,
  33923. linkScales: helpers.noop,
  33924. // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly
  33925. getRingIndex: function(datasetIndex) {
  33926. var ringIndex = 0;
  33927. for (var j = 0; j < datasetIndex; ++j) {
  33928. if (this.chart.isDatasetVisible(j)) {
  33929. ++ringIndex;
  33930. }
  33931. }
  33932. return ringIndex;
  33933. },
  33934. update: function(reset) {
  33935. var me = this;
  33936. var chart = me.chart,
  33937. chartArea = chart.chartArea,
  33938. opts = chart.options,
  33939. arcOpts = opts.elements.arc,
  33940. availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth,
  33941. availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth,
  33942. minSize = Math.min(availableWidth, availableHeight),
  33943. offset = {
  33944. x: 0,
  33945. y: 0
  33946. },
  33947. meta = me.getMeta(),
  33948. cutoutPercentage = opts.cutoutPercentage,
  33949. circumference = opts.circumference;
  33950. // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc
  33951. if (circumference < Math.PI * 2.0) {
  33952. var startAngle = opts.rotation % (Math.PI * 2.0);
  33953. startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);
  33954. var endAngle = startAngle + circumference;
  33955. var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};
  33956. var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};
  33957. var contains0 = (startAngle <= 0 && 0 <= endAngle) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);
  33958. var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);
  33959. var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);
  33960. var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);
  33961. var cutout = cutoutPercentage / 100.0;
  33962. var min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};
  33963. var max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};
  33964. var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};
  33965. minSize = Math.min(availableWidth / size.width, availableHeight / size.height);
  33966. offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};
  33967. }
  33968. chart.borderWidth = me.getMaxBorderWidth(meta.data);
  33969. chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);
  33970. chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);
  33971. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  33972. chart.offsetX = offset.x * chart.outerRadius;
  33973. chart.offsetY = offset.y * chart.outerRadius;
  33974. meta.total = me.calculateTotal();
  33975. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));
  33976. me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);
  33977. helpers.each(meta.data, function(arc, index) {
  33978. me.updateElement(arc, index, reset);
  33979. });
  33980. },
  33981. updateElement: function(arc, index, reset) {
  33982. var me = this;
  33983. var chart = me.chart,
  33984. chartArea = chart.chartArea,
  33985. opts = chart.options,
  33986. animationOpts = opts.animation,
  33987. centerX = (chartArea.left + chartArea.right) / 2,
  33988. centerY = (chartArea.top + chartArea.bottom) / 2,
  33989. startAngle = opts.rotation, // non reset case handled later
  33990. endAngle = opts.rotation, // non reset case handled later
  33991. dataset = me.getDataset(),
  33992. circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI)),
  33993. innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius,
  33994. outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius,
  33995. valueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  33996. helpers.extend(arc, {
  33997. // Utility
  33998. _datasetIndex: me.index,
  33999. _index: index,
  34000. // Desired view properties
  34001. _model: {
  34002. x: centerX + chart.offsetX,
  34003. y: centerY + chart.offsetY,
  34004. startAngle: startAngle,
  34005. endAngle: endAngle,
  34006. circumference: circumference,
  34007. outerRadius: outerRadius,
  34008. innerRadius: innerRadius,
  34009. label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])
  34010. }
  34011. });
  34012. var model = arc._model;
  34013. // Resets the visual styles
  34014. this.removeHoverStyle(arc);
  34015. // Set correct angles if not resetting
  34016. if (!reset || !animationOpts.animateRotate) {
  34017. if (index === 0) {
  34018. model.startAngle = opts.rotation;
  34019. } else {
  34020. model.startAngle = me.getMeta().data[index - 1]._model.endAngle;
  34021. }
  34022. model.endAngle = model.startAngle + model.circumference;
  34023. }
  34024. arc.pivot();
  34025. },
  34026. removeHoverStyle: function(arc) {
  34027. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  34028. },
  34029. calculateTotal: function() {
  34030. var dataset = this.getDataset();
  34031. var meta = this.getMeta();
  34032. var total = 0;
  34033. var value;
  34034. helpers.each(meta.data, function(element, index) {
  34035. value = dataset.data[index];
  34036. if (!isNaN(value) && !element.hidden) {
  34037. total += Math.abs(value);
  34038. }
  34039. });
  34040. /* if (total === 0) {
  34041. total = NaN;
  34042. }*/
  34043. return total;
  34044. },
  34045. calculateCircumference: function(value) {
  34046. var total = this.getMeta().total;
  34047. if (total > 0 && !isNaN(value)) {
  34048. return (Math.PI * 2.0) * (value / total);
  34049. }
  34050. return 0;
  34051. },
  34052. // gets the max border or hover width to properly scale pie charts
  34053. getMaxBorderWidth: function(elements) {
  34054. var max = 0,
  34055. index = this.index,
  34056. length = elements.length,
  34057. borderWidth,
  34058. hoverWidth;
  34059. for (var i = 0; i < length; i++) {
  34060. borderWidth = elements[i]._model ? elements[i]._model.borderWidth : 0;
  34061. hoverWidth = elements[i]._chart ? elements[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;
  34062. max = borderWidth > max ? borderWidth : max;
  34063. max = hoverWidth > max ? hoverWidth : max;
  34064. }
  34065. return max;
  34066. }
  34067. });
  34068. };
  34069. /***/ }),
  34070. /* 136 */
  34071. /***/ (function(module, exports, __webpack_require__) {
  34072. "use strict";
  34073. module.exports = function(Chart) {
  34074. var helpers = Chart.helpers;
  34075. Chart.defaults.line = {
  34076. showLines: true,
  34077. spanGaps: false,
  34078. hover: {
  34079. mode: 'label'
  34080. },
  34081. scales: {
  34082. xAxes: [{
  34083. type: 'category',
  34084. id: 'x-axis-0'
  34085. }],
  34086. yAxes: [{
  34087. type: 'linear',
  34088. id: 'y-axis-0'
  34089. }]
  34090. }
  34091. };
  34092. function lineEnabled(dataset, options) {
  34093. return helpers.getValueOrDefault(dataset.showLine, options.showLines);
  34094. }
  34095. Chart.controllers.line = Chart.DatasetController.extend({
  34096. datasetElementType: Chart.elements.Line,
  34097. dataElementType: Chart.elements.Point,
  34098. update: function(reset) {
  34099. var me = this;
  34100. var meta = me.getMeta();
  34101. var line = meta.dataset;
  34102. var points = meta.data || [];
  34103. var options = me.chart.options;
  34104. var lineElementOptions = options.elements.line;
  34105. var scale = me.getScaleForId(meta.yAxisID);
  34106. var i, ilen, custom;
  34107. var dataset = me.getDataset();
  34108. var showLine = lineEnabled(dataset, options);
  34109. // Update Line
  34110. if (showLine) {
  34111. custom = line.custom || {};
  34112. // Compatibility: If the properties are defined with only the old name, use those values
  34113. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  34114. dataset.lineTension = dataset.tension;
  34115. }
  34116. // Utility
  34117. line._scale = scale;
  34118. line._datasetIndex = me.index;
  34119. // Data
  34120. line._children = points;
  34121. // Model
  34122. line._model = {
  34123. // Appearance
  34124. // The default behavior of lines is to break at null values, according
  34125. // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
  34126. // This option gives lines the ability to span gaps
  34127. spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,
  34128. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  34129. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  34130. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  34131. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  34132. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  34133. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  34134. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  34135. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  34136. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  34137. steppedLine: custom.steppedLine ? custom.steppedLine : helpers.getValueOrDefault(dataset.steppedLine, lineElementOptions.stepped),
  34138. cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.getValueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),
  34139. // Scale
  34140. scaleTop: scale.top,
  34141. scaleBottom: scale.bottom,
  34142. scaleZero: scale.getBasePixel()
  34143. };
  34144. line.pivot();
  34145. }
  34146. // Update Points
  34147. for (i=0, ilen=points.length; i<ilen; ++i) {
  34148. me.updateElement(points[i], i, reset);
  34149. }
  34150. if (showLine && line._model.tension !== 0) {
  34151. me.updateBezierControlPoints();
  34152. }
  34153. // Now pivot the point for animation
  34154. for (i=0, ilen=points.length; i<ilen; ++i) {
  34155. points[i].pivot();
  34156. }
  34157. },
  34158. getPointBackgroundColor: function(point, index) {
  34159. var backgroundColor = this.chart.options.elements.point.backgroundColor;
  34160. var dataset = this.getDataset();
  34161. var custom = point.custom || {};
  34162. if (custom.backgroundColor) {
  34163. backgroundColor = custom.backgroundColor;
  34164. } else if (dataset.pointBackgroundColor) {
  34165. backgroundColor = helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);
  34166. } else if (dataset.backgroundColor) {
  34167. backgroundColor = dataset.backgroundColor;
  34168. }
  34169. return backgroundColor;
  34170. },
  34171. getPointBorderColor: function(point, index) {
  34172. var borderColor = this.chart.options.elements.point.borderColor;
  34173. var dataset = this.getDataset();
  34174. var custom = point.custom || {};
  34175. if (custom.borderColor) {
  34176. borderColor = custom.borderColor;
  34177. } else if (dataset.pointBorderColor) {
  34178. borderColor = helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);
  34179. } else if (dataset.borderColor) {
  34180. borderColor = dataset.borderColor;
  34181. }
  34182. return borderColor;
  34183. },
  34184. getPointBorderWidth: function(point, index) {
  34185. var borderWidth = this.chart.options.elements.point.borderWidth;
  34186. var dataset = this.getDataset();
  34187. var custom = point.custom || {};
  34188. if (!isNaN(custom.borderWidth)) {
  34189. borderWidth = custom.borderWidth;
  34190. } else if (!isNaN(dataset.pointBorderWidth)) {
  34191. borderWidth = helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);
  34192. } else if (!isNaN(dataset.borderWidth)) {
  34193. borderWidth = dataset.borderWidth;
  34194. }
  34195. return borderWidth;
  34196. },
  34197. updateElement: function(point, index, reset) {
  34198. var me = this;
  34199. var meta = me.getMeta();
  34200. var custom = point.custom || {};
  34201. var dataset = me.getDataset();
  34202. var datasetIndex = me.index;
  34203. var value = dataset.data[index];
  34204. var yScale = me.getScaleForId(meta.yAxisID);
  34205. var xScale = me.getScaleForId(meta.xAxisID);
  34206. var pointOptions = me.chart.options.elements.point;
  34207. var x, y;
  34208. var labels = me.chart.data.labels || [];
  34209. var includeOffset = (labels.length === 1 || dataset.data.length === 1) || me.chart.isCombo;
  34210. // Compatibility: If the properties are defined with only the old name, use those values
  34211. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  34212. dataset.pointRadius = dataset.radius;
  34213. }
  34214. if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {
  34215. dataset.pointHitRadius = dataset.hitRadius;
  34216. }
  34217. x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex, includeOffset);
  34218. y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);
  34219. // Utility
  34220. point._xScale = xScale;
  34221. point._yScale = yScale;
  34222. point._datasetIndex = datasetIndex;
  34223. point._index = index;
  34224. // Desired view properties
  34225. point._model = {
  34226. x: x,
  34227. y: y,
  34228. skip: custom.skip || isNaN(x) || isNaN(y),
  34229. // Appearance
  34230. radius: custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),
  34231. pointStyle: custom.pointStyle || helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),
  34232. backgroundColor: me.getPointBackgroundColor(point, index),
  34233. borderColor: me.getPointBorderColor(point, index),
  34234. borderWidth: me.getPointBorderWidth(point, index),
  34235. tension: meta.dataset._model ? meta.dataset._model.tension : 0,
  34236. steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,
  34237. // Tooltip
  34238. hitRadius: custom.hitRadius || helpers.getValueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)
  34239. };
  34240. },
  34241. calculatePointY: function(value, index, datasetIndex) {
  34242. var me = this;
  34243. var chart = me.chart;
  34244. var meta = me.getMeta();
  34245. var yScale = me.getScaleForId(meta.yAxisID);
  34246. var sumPos = 0;
  34247. var sumNeg = 0;
  34248. var i, ds, dsMeta;
  34249. if (yScale.options.stacked) {
  34250. for (i = 0; i < datasetIndex; i++) {
  34251. ds = chart.data.datasets[i];
  34252. dsMeta = chart.getDatasetMeta(i);
  34253. if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {
  34254. var stackedRightValue = Number(yScale.getRightValue(ds.data[index]));
  34255. if (stackedRightValue < 0) {
  34256. sumNeg += stackedRightValue || 0;
  34257. } else {
  34258. sumPos += stackedRightValue || 0;
  34259. }
  34260. }
  34261. }
  34262. var rightValue = Number(yScale.getRightValue(value));
  34263. if (rightValue < 0) {
  34264. return yScale.getPixelForValue(sumNeg + rightValue);
  34265. }
  34266. return yScale.getPixelForValue(sumPos + rightValue);
  34267. }
  34268. return yScale.getPixelForValue(value);
  34269. },
  34270. updateBezierControlPoints: function() {
  34271. var me = this;
  34272. var meta = me.getMeta();
  34273. var area = me.chart.chartArea;
  34274. var points = (meta.data || []);
  34275. var i, ilen, point, model, controlPoints;
  34276. // Only consider points that are drawn in case the spanGaps option is used
  34277. if (meta.dataset._model.spanGaps) {
  34278. points = points.filter(function(pt) {
  34279. return !pt._model.skip;
  34280. });
  34281. }
  34282. function capControlPoint(pt, min, max) {
  34283. return Math.max(Math.min(pt, max), min);
  34284. }
  34285. if (meta.dataset._model.cubicInterpolationMode === 'monotone') {
  34286. helpers.splineCurveMonotone(points);
  34287. } else {
  34288. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34289. point = points[i];
  34290. model = point._model;
  34291. controlPoints = helpers.splineCurve(
  34292. helpers.previousItem(points, i)._model,
  34293. model,
  34294. helpers.nextItem(points, i)._model,
  34295. meta.dataset._model.tension
  34296. );
  34297. model.controlPointPreviousX = controlPoints.previous.x;
  34298. model.controlPointPreviousY = controlPoints.previous.y;
  34299. model.controlPointNextX = controlPoints.next.x;
  34300. model.controlPointNextY = controlPoints.next.y;
  34301. }
  34302. }
  34303. if (me.chart.options.elements.line.capBezierPoints) {
  34304. for (i = 0, ilen = points.length; i < ilen; ++i) {
  34305. model = points[i]._model;
  34306. model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);
  34307. model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);
  34308. model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);
  34309. model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);
  34310. }
  34311. }
  34312. },
  34313. draw: function(ease) {
  34314. var me = this;
  34315. var meta = me.getMeta();
  34316. var points = meta.data || [];
  34317. var easingDecimal = ease || 1;
  34318. var i, ilen;
  34319. // Transition Point Locations
  34320. for (i=0, ilen=points.length; i<ilen; ++i) {
  34321. points[i].transition(easingDecimal);
  34322. }
  34323. Chart.canvasHelpers.clipArea(me.chart.chart.ctx, me.chart.chartArea);
  34324. // Transition and Draw the line
  34325. if (lineEnabled(me.getDataset(), me.chart.options)) {
  34326. meta.dataset.transition(easingDecimal).draw();
  34327. }
  34328. Chart.canvasHelpers.unclipArea(me.chart.chart.ctx);
  34329. // Draw the points
  34330. for (i=0, ilen=points.length; i<ilen; ++i) {
  34331. points[i].draw(me.chart.chartArea);
  34332. }
  34333. },
  34334. setHoverStyle: function(point) {
  34335. // Point
  34336. var dataset = this.chart.data.datasets[point._datasetIndex];
  34337. var index = point._index;
  34338. var custom = point.custom || {};
  34339. var model = point._model;
  34340. model.radius = custom.hoverRadius || helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34341. model.backgroundColor = custom.hoverBackgroundColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34342. model.borderColor = custom.hoverBorderColor || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34343. model.borderWidth = custom.hoverBorderWidth || helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34344. },
  34345. removeHoverStyle: function(point) {
  34346. var me = this;
  34347. var dataset = me.chart.data.datasets[point._datasetIndex];
  34348. var index = point._index;
  34349. var custom = point.custom || {};
  34350. var model = point._model;
  34351. // Compatibility: If the properties are defined with only the old name, use those values
  34352. if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {
  34353. dataset.pointRadius = dataset.radius;
  34354. }
  34355. model.radius = custom.radius || helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);
  34356. model.backgroundColor = me.getPointBackgroundColor(point, index);
  34357. model.borderColor = me.getPointBorderColor(point, index);
  34358. model.borderWidth = me.getPointBorderWidth(point, index);
  34359. }
  34360. });
  34361. };
  34362. /***/ }),
  34363. /* 137 */
  34364. /***/ (function(module, exports, __webpack_require__) {
  34365. "use strict";
  34366. module.exports = function(Chart) {
  34367. var helpers = Chart.helpers;
  34368. Chart.defaults.polarArea = {
  34369. scale: {
  34370. type: 'radialLinear',
  34371. lineArc: true, // so that lines are circular
  34372. ticks: {
  34373. beginAtZero: true
  34374. }
  34375. },
  34376. // Boolean - Whether to animate the rotation of the chart
  34377. animation: {
  34378. animateRotate: true,
  34379. animateScale: true
  34380. },
  34381. startAngle: -0.5 * Math.PI,
  34382. aspectRatio: 1,
  34383. legendCallback: function(chart) {
  34384. var text = [];
  34385. text.push('<ul class="' + chart.id + '-legend">');
  34386. var data = chart.data;
  34387. var datasets = data.datasets;
  34388. var labels = data.labels;
  34389. if (datasets.length) {
  34390. for (var i = 0; i < datasets[0].data.length; ++i) {
  34391. text.push('<li><span style="background-color:' + datasets[0].backgroundColor[i] + '"></span>');
  34392. if (labels[i]) {
  34393. text.push(labels[i]);
  34394. }
  34395. text.push('</li>');
  34396. }
  34397. }
  34398. text.push('</ul>');
  34399. return text.join('');
  34400. },
  34401. legend: {
  34402. labels: {
  34403. generateLabels: function(chart) {
  34404. var data = chart.data;
  34405. if (data.labels.length && data.datasets.length) {
  34406. return data.labels.map(function(label, i) {
  34407. var meta = chart.getDatasetMeta(0);
  34408. var ds = data.datasets[0];
  34409. var arc = meta.data[i];
  34410. var custom = arc.custom || {};
  34411. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34412. var arcOpts = chart.options.elements.arc;
  34413. var fill = custom.backgroundColor ? custom.backgroundColor : getValueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);
  34414. var stroke = custom.borderColor ? custom.borderColor : getValueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);
  34415. var bw = custom.borderWidth ? custom.borderWidth : getValueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);
  34416. return {
  34417. text: label,
  34418. fillStyle: fill,
  34419. strokeStyle: stroke,
  34420. lineWidth: bw,
  34421. hidden: isNaN(ds.data[i]) || meta.data[i].hidden,
  34422. // Extra data used for toggling the correct item
  34423. index: i
  34424. };
  34425. });
  34426. }
  34427. return [];
  34428. }
  34429. },
  34430. onClick: function(e, legendItem) {
  34431. var index = legendItem.index;
  34432. var chart = this.chart;
  34433. var i, ilen, meta;
  34434. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  34435. meta = chart.getDatasetMeta(i);
  34436. meta.data[index].hidden = !meta.data[index].hidden;
  34437. }
  34438. chart.update();
  34439. }
  34440. },
  34441. // Need to override these to give a nice default
  34442. tooltips: {
  34443. callbacks: {
  34444. title: function() {
  34445. return '';
  34446. },
  34447. label: function(tooltipItem, data) {
  34448. return data.labels[tooltipItem.index] + ': ' + tooltipItem.yLabel;
  34449. }
  34450. }
  34451. }
  34452. };
  34453. Chart.controllers.polarArea = Chart.DatasetController.extend({
  34454. dataElementType: Chart.elements.Arc,
  34455. linkScales: helpers.noop,
  34456. update: function(reset) {
  34457. var me = this;
  34458. var chart = me.chart;
  34459. var chartArea = chart.chartArea;
  34460. var meta = me.getMeta();
  34461. var opts = chart.options;
  34462. var arcOpts = opts.elements.arc;
  34463. var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
  34464. chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);
  34465. chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);
  34466. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  34467. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);
  34468. me.innerRadius = me.outerRadius - chart.radiusLength;
  34469. meta.count = me.countVisibleElements();
  34470. helpers.each(meta.data, function(arc, index) {
  34471. me.updateElement(arc, index, reset);
  34472. });
  34473. },
  34474. updateElement: function(arc, index, reset) {
  34475. var me = this;
  34476. var chart = me.chart;
  34477. var dataset = me.getDataset();
  34478. var opts = chart.options;
  34479. var animationOpts = opts.animation;
  34480. var scale = chart.scale;
  34481. var getValueAtIndexOrDefault = helpers.getValueAtIndexOrDefault;
  34482. var labels = chart.data.labels;
  34483. var circumference = me.calculateCircumference(dataset.data[index]);
  34484. var centerX = scale.xCenter;
  34485. var centerY = scale.yCenter;
  34486. // If there is NaN data before us, we need to calculate the starting angle correctly.
  34487. // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data
  34488. var visibleCount = 0;
  34489. var meta = me.getMeta();
  34490. for (var i = 0; i < index; ++i) {
  34491. if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {
  34492. ++visibleCount;
  34493. }
  34494. }
  34495. // var negHalfPI = -0.5 * Math.PI;
  34496. var datasetStartAngle = opts.startAngle;
  34497. var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34498. var startAngle = datasetStartAngle + (circumference * visibleCount);
  34499. var endAngle = startAngle + (arc.hidden ? 0 : circumference);
  34500. var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  34501. helpers.extend(arc, {
  34502. // Utility
  34503. _datasetIndex: me.index,
  34504. _index: index,
  34505. _scale: scale,
  34506. // Desired view properties
  34507. _model: {
  34508. x: centerX,
  34509. y: centerY,
  34510. innerRadius: 0,
  34511. outerRadius: reset ? resetRadius : distance,
  34512. startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,
  34513. endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,
  34514. label: getValueAtIndexOrDefault(labels, index, labels[index])
  34515. }
  34516. });
  34517. // Apply border and fill style
  34518. me.removeHoverStyle(arc);
  34519. arc.pivot();
  34520. },
  34521. removeHoverStyle: function(arc) {
  34522. Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);
  34523. },
  34524. countVisibleElements: function() {
  34525. var dataset = this.getDataset();
  34526. var meta = this.getMeta();
  34527. var count = 0;
  34528. helpers.each(meta.data, function(element, index) {
  34529. if (!isNaN(dataset.data[index]) && !element.hidden) {
  34530. count++;
  34531. }
  34532. });
  34533. return count;
  34534. },
  34535. calculateCircumference: function(value) {
  34536. var count = this.getMeta().count;
  34537. if (count > 0 && !isNaN(value)) {
  34538. return (2 * Math.PI) / count;
  34539. }
  34540. return 0;
  34541. }
  34542. });
  34543. };
  34544. /***/ }),
  34545. /* 138 */
  34546. /***/ (function(module, exports, __webpack_require__) {
  34547. "use strict";
  34548. module.exports = function(Chart) {
  34549. var helpers = Chart.helpers;
  34550. Chart.defaults.radar = {
  34551. aspectRatio: 1,
  34552. scale: {
  34553. type: 'radialLinear'
  34554. },
  34555. elements: {
  34556. line: {
  34557. tension: 0 // no bezier in radar
  34558. }
  34559. }
  34560. };
  34561. Chart.controllers.radar = Chart.DatasetController.extend({
  34562. datasetElementType: Chart.elements.Line,
  34563. dataElementType: Chart.elements.Point,
  34564. linkScales: helpers.noop,
  34565. update: function(reset) {
  34566. var me = this;
  34567. var meta = me.getMeta();
  34568. var line = meta.dataset;
  34569. var points = meta.data;
  34570. var custom = line.custom || {};
  34571. var dataset = me.getDataset();
  34572. var lineElementOptions = me.chart.options.elements.line;
  34573. var scale = me.chart.scale;
  34574. // Compatibility: If the properties are defined with only the old name, use those values
  34575. if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
  34576. dataset.lineTension = dataset.tension;
  34577. }
  34578. helpers.extend(meta.dataset, {
  34579. // Utility
  34580. _datasetIndex: me.index,
  34581. // Data
  34582. _children: points,
  34583. _loop: true,
  34584. // Model
  34585. _model: {
  34586. // Appearance
  34587. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, lineElementOptions.tension),
  34588. backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),
  34589. borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),
  34590. borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),
  34591. fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),
  34592. borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),
  34593. borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),
  34594. borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),
  34595. borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),
  34596. // Scale
  34597. scaleTop: scale.top,
  34598. scaleBottom: scale.bottom,
  34599. scaleZero: scale.getBasePosition()
  34600. }
  34601. });
  34602. meta.dataset.pivot();
  34603. // Update Points
  34604. helpers.each(points, function(point, index) {
  34605. me.updateElement(point, index, reset);
  34606. }, me);
  34607. // Update bezier control points
  34608. me.updateBezierControlPoints();
  34609. },
  34610. updateElement: function(point, index, reset) {
  34611. var me = this;
  34612. var custom = point.custom || {};
  34613. var dataset = me.getDataset();
  34614. var scale = me.chart.scale;
  34615. var pointElementOptions = me.chart.options.elements.point;
  34616. var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);
  34617. helpers.extend(point, {
  34618. // Utility
  34619. _datasetIndex: me.index,
  34620. _index: index,
  34621. _scale: scale,
  34622. // Desired view properties
  34623. _model: {
  34624. x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales
  34625. y: reset ? scale.yCenter : pointPosition.y,
  34626. // Appearance
  34627. tension: custom.tension ? custom.tension : helpers.getValueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),
  34628. radius: custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),
  34629. backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),
  34630. borderColor: custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),
  34631. borderWidth: custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),
  34632. pointStyle: custom.pointStyle ? custom.pointStyle : helpers.getValueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),
  34633. // Tooltip
  34634. hitRadius: custom.hitRadius ? custom.hitRadius : helpers.getValueAtIndexOrDefault(dataset.hitRadius, index, pointElementOptions.hitRadius)
  34635. }
  34636. });
  34637. point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));
  34638. },
  34639. updateBezierControlPoints: function() {
  34640. var chartArea = this.chart.chartArea;
  34641. var meta = this.getMeta();
  34642. helpers.each(meta.data, function(point, index) {
  34643. var model = point._model;
  34644. var controlPoints = helpers.splineCurve(
  34645. helpers.previousItem(meta.data, index, true)._model,
  34646. model,
  34647. helpers.nextItem(meta.data, index, true)._model,
  34648. model.tension
  34649. );
  34650. // Prevent the bezier going outside of the bounds of the graph
  34651. model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);
  34652. model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);
  34653. model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);
  34654. model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);
  34655. // Now pivot the point for animation
  34656. point.pivot();
  34657. });
  34658. },
  34659. draw: function(ease) {
  34660. var meta = this.getMeta();
  34661. var easingDecimal = ease || 1;
  34662. // Transition Point Locations
  34663. helpers.each(meta.data, function(point) {
  34664. point.transition(easingDecimal);
  34665. });
  34666. // Transition and Draw the line
  34667. meta.dataset.transition(easingDecimal).draw();
  34668. // Draw the points
  34669. helpers.each(meta.data, function(point) {
  34670. point.draw();
  34671. });
  34672. },
  34673. setHoverStyle: function(point) {
  34674. // Point
  34675. var dataset = this.chart.data.datasets[point._datasetIndex];
  34676. var custom = point.custom || {};
  34677. var index = point._index;
  34678. var model = point._model;
  34679. model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.getValueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);
  34680. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));
  34681. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));
  34682. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.getValueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);
  34683. },
  34684. removeHoverStyle: function(point) {
  34685. var dataset = this.chart.data.datasets[point._datasetIndex];
  34686. var custom = point.custom || {};
  34687. var index = point._index;
  34688. var model = point._model;
  34689. var pointElementOptions = this.chart.options.elements.point;
  34690. model.radius = custom.radius ? custom.radius : helpers.getValueAtIndexOrDefault(dataset.radius, index, pointElementOptions.radius);
  34691. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.getValueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);
  34692. model.borderColor = custom.borderColor ? custom.borderColor : helpers.getValueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);
  34693. model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);
  34694. }
  34695. });
  34696. };
  34697. /***/ }),
  34698. /* 139 */
  34699. /***/ (function(module, exports, __webpack_require__) {
  34700. "use strict";
  34701. /* global window: false */
  34702. module.exports = function(Chart) {
  34703. var helpers = Chart.helpers;
  34704. Chart.defaults.global.animation = {
  34705. duration: 1000,
  34706. easing: 'easeOutQuart',
  34707. onProgress: helpers.noop,
  34708. onComplete: helpers.noop
  34709. };
  34710. Chart.Animation = Chart.Element.extend({
  34711. currentStep: null, // the current animation step
  34712. numSteps: 60, // default number of steps
  34713. easing: '', // the easing to use for this animation
  34714. render: null, // render function used by the animation service
  34715. onAnimationProgress: null, // user specified callback to fire on each step of the animation
  34716. onAnimationComplete: null // user specified callback to fire when the animation finishes
  34717. });
  34718. Chart.animationService = {
  34719. frameDuration: 17,
  34720. animations: [],
  34721. dropFrames: 0,
  34722. request: null,
  34723. /**
  34724. * @function Chart.animationService.addAnimation
  34725. * @param chartInstance {ChartController} the chart to animate
  34726. * @param animationObject {IAnimation} the animation that we will animate
  34727. * @param duration {Number} length of animation in ms
  34728. * @param lazy {Boolean} if true, the chart is not marked as animating to enable more responsive interactions
  34729. */
  34730. addAnimation: function(chartInstance, animationObject, duration, lazy) {
  34731. var me = this;
  34732. if (!lazy) {
  34733. chartInstance.animating = true;
  34734. }
  34735. for (var index = 0; index < me.animations.length; ++index) {
  34736. if (me.animations[index].chartInstance === chartInstance) {
  34737. // replacing an in progress animation
  34738. me.animations[index].animationObject = animationObject;
  34739. return;
  34740. }
  34741. }
  34742. me.animations.push({
  34743. chartInstance: chartInstance,
  34744. animationObject: animationObject
  34745. });
  34746. // If there are no animations queued, manually kickstart a digest, for lack of a better word
  34747. if (me.animations.length === 1) {
  34748. me.requestAnimationFrame();
  34749. }
  34750. },
  34751. // Cancel the animation for a given chart instance
  34752. cancelAnimation: function(chartInstance) {
  34753. var index = helpers.findIndex(this.animations, function(animationWrapper) {
  34754. return animationWrapper.chartInstance === chartInstance;
  34755. });
  34756. if (index !== -1) {
  34757. this.animations.splice(index, 1);
  34758. chartInstance.animating = false;
  34759. }
  34760. },
  34761. requestAnimationFrame: function() {
  34762. var me = this;
  34763. if (me.request === null) {
  34764. // Skip animation frame requests until the active one is executed.
  34765. // This can happen when processing mouse events, e.g. 'mousemove'
  34766. // and 'mouseout' events will trigger multiple renders.
  34767. me.request = helpers.requestAnimFrame.call(window, function() {
  34768. me.request = null;
  34769. me.startDigest();
  34770. });
  34771. }
  34772. },
  34773. startDigest: function() {
  34774. var me = this;
  34775. var startTime = Date.now();
  34776. var framesToDrop = 0;
  34777. if (me.dropFrames > 1) {
  34778. framesToDrop = Math.floor(me.dropFrames);
  34779. me.dropFrames = me.dropFrames % 1;
  34780. }
  34781. var i = 0;
  34782. while (i < me.animations.length) {
  34783. if (me.animations[i].animationObject.currentStep === null) {
  34784. me.animations[i].animationObject.currentStep = 0;
  34785. }
  34786. me.animations[i].animationObject.currentStep += 1 + framesToDrop;
  34787. if (me.animations[i].animationObject.currentStep > me.animations[i].animationObject.numSteps) {
  34788. me.animations[i].animationObject.currentStep = me.animations[i].animationObject.numSteps;
  34789. }
  34790. me.animations[i].animationObject.render(me.animations[i].chartInstance, me.animations[i].animationObject);
  34791. if (me.animations[i].animationObject.onAnimationProgress && me.animations[i].animationObject.onAnimationProgress.call) {
  34792. me.animations[i].animationObject.onAnimationProgress.call(me.animations[i].chartInstance, me.animations[i]);
  34793. }
  34794. if (me.animations[i].animationObject.currentStep === me.animations[i].animationObject.numSteps) {
  34795. if (me.animations[i].animationObject.onAnimationComplete && me.animations[i].animationObject.onAnimationComplete.call) {
  34796. me.animations[i].animationObject.onAnimationComplete.call(me.animations[i].chartInstance, me.animations[i]);
  34797. }
  34798. // executed the last frame. Remove the animation.
  34799. me.animations[i].chartInstance.animating = false;
  34800. me.animations.splice(i, 1);
  34801. } else {
  34802. ++i;
  34803. }
  34804. }
  34805. var endTime = Date.now();
  34806. var dropFrames = (endTime - startTime) / me.frameDuration;
  34807. me.dropFrames += dropFrames;
  34808. // Do we have more stuff to animate?
  34809. if (me.animations.length > 0) {
  34810. me.requestAnimationFrame();
  34811. }
  34812. }
  34813. };
  34814. };
  34815. /***/ }),
  34816. /* 140 */
  34817. /***/ (function(module, exports, __webpack_require__) {
  34818. "use strict";
  34819. module.exports = function(Chart) {
  34820. // Global Chart canvas helpers object for drawing items to canvas
  34821. var helpers = Chart.canvasHelpers = {};
  34822. helpers.drawPoint = function(ctx, pointStyle, radius, x, y) {
  34823. var type, edgeLength, xOffset, yOffset, height, size;
  34824. if (typeof pointStyle === 'object') {
  34825. type = pointStyle.toString();
  34826. if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {
  34827. ctx.drawImage(pointStyle, x - pointStyle.width / 2, y - pointStyle.height / 2);
  34828. return;
  34829. }
  34830. }
  34831. if (isNaN(radius) || radius <= 0) {
  34832. return;
  34833. }
  34834. switch (pointStyle) {
  34835. // Default includes circle
  34836. default:
  34837. ctx.beginPath();
  34838. ctx.arc(x, y, radius, 0, Math.PI * 2);
  34839. ctx.closePath();
  34840. ctx.fill();
  34841. break;
  34842. case 'triangle':
  34843. ctx.beginPath();
  34844. edgeLength = 3 * radius / Math.sqrt(3);
  34845. height = edgeLength * Math.sqrt(3) / 2;
  34846. ctx.moveTo(x - edgeLength / 2, y + height / 3);
  34847. ctx.lineTo(x + edgeLength / 2, y + height / 3);
  34848. ctx.lineTo(x, y - 2 * height / 3);
  34849. ctx.closePath();
  34850. ctx.fill();
  34851. break;
  34852. case 'rect':
  34853. size = 1 / Math.SQRT2 * radius;
  34854. ctx.beginPath();
  34855. ctx.fillRect(x - size, y - size, 2 * size, 2 * size);
  34856. ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);
  34857. break;
  34858. case 'rectRounded':
  34859. var offset = radius / Math.SQRT2;
  34860. var leftX = x - offset;
  34861. var topY = y - offset;
  34862. var sideSize = Math.SQRT2 * radius;
  34863. Chart.helpers.drawRoundedRectangle(ctx, leftX, topY, sideSize, sideSize, radius / 2);
  34864. ctx.fill();
  34865. break;
  34866. case 'rectRot':
  34867. size = 1 / Math.SQRT2 * radius;
  34868. ctx.beginPath();
  34869. ctx.moveTo(x - size, y);
  34870. ctx.lineTo(x, y + size);
  34871. ctx.lineTo(x + size, y);
  34872. ctx.lineTo(x, y - size);
  34873. ctx.closePath();
  34874. ctx.fill();
  34875. break;
  34876. case 'cross':
  34877. ctx.beginPath();
  34878. ctx.moveTo(x, y + radius);
  34879. ctx.lineTo(x, y - radius);
  34880. ctx.moveTo(x - radius, y);
  34881. ctx.lineTo(x + radius, y);
  34882. ctx.closePath();
  34883. break;
  34884. case 'crossRot':
  34885. ctx.beginPath();
  34886. xOffset = Math.cos(Math.PI / 4) * radius;
  34887. yOffset = Math.sin(Math.PI / 4) * radius;
  34888. ctx.moveTo(x - xOffset, y - yOffset);
  34889. ctx.lineTo(x + xOffset, y + yOffset);
  34890. ctx.moveTo(x - xOffset, y + yOffset);
  34891. ctx.lineTo(x + xOffset, y - yOffset);
  34892. ctx.closePath();
  34893. break;
  34894. case 'star':
  34895. ctx.beginPath();
  34896. ctx.moveTo(x, y + radius);
  34897. ctx.lineTo(x, y - radius);
  34898. ctx.moveTo(x - radius, y);
  34899. ctx.lineTo(x + radius, y);
  34900. xOffset = Math.cos(Math.PI / 4) * radius;
  34901. yOffset = Math.sin(Math.PI / 4) * radius;
  34902. ctx.moveTo(x - xOffset, y - yOffset);
  34903. ctx.lineTo(x + xOffset, y + yOffset);
  34904. ctx.moveTo(x - xOffset, y + yOffset);
  34905. ctx.lineTo(x + xOffset, y - yOffset);
  34906. ctx.closePath();
  34907. break;
  34908. case 'line':
  34909. ctx.beginPath();
  34910. ctx.moveTo(x - radius, y);
  34911. ctx.lineTo(x + radius, y);
  34912. ctx.closePath();
  34913. break;
  34914. case 'dash':
  34915. ctx.beginPath();
  34916. ctx.moveTo(x, y);
  34917. ctx.lineTo(x + radius, y);
  34918. ctx.closePath();
  34919. break;
  34920. }
  34921. ctx.stroke();
  34922. };
  34923. helpers.clipArea = function(ctx, clipArea) {
  34924. ctx.save();
  34925. ctx.beginPath();
  34926. ctx.rect(clipArea.left, clipArea.top, clipArea.right - clipArea.left, clipArea.bottom - clipArea.top);
  34927. ctx.clip();
  34928. };
  34929. helpers.unclipArea = function(ctx) {
  34930. ctx.restore();
  34931. };
  34932. };
  34933. /***/ }),
  34934. /* 141 */
  34935. /***/ (function(module, exports, __webpack_require__) {
  34936. "use strict";
  34937. module.exports = function(Chart) {
  34938. var helpers = Chart.helpers;
  34939. var plugins = Chart.plugins;
  34940. var platform = Chart.platform;
  34941. // Create a dictionary of chart types, to allow for extension of existing types
  34942. Chart.types = {};
  34943. // Store a reference to each instance - allowing us to globally resize chart instances on window resize.
  34944. // Destroy method on the chart will remove the instance of the chart from this reference.
  34945. Chart.instances = {};
  34946. // Controllers available for dataset visualization eg. bar, line, slice, etc.
  34947. Chart.controllers = {};
  34948. /**
  34949. * Initializes the given config with global and chart default values.
  34950. */
  34951. function initConfig(config) {
  34952. config = config || {};
  34953. // Do NOT use configMerge() for the data object because this method merges arrays
  34954. // and so would change references to labels and datasets, preventing data updates.
  34955. var data = config.data = config.data || {};
  34956. data.datasets = data.datasets || [];
  34957. data.labels = data.labels || [];
  34958. config.options = helpers.configMerge(
  34959. Chart.defaults.global,
  34960. Chart.defaults[config.type],
  34961. config.options || {});
  34962. return config;
  34963. }
  34964. /**
  34965. * Updates the config of the chart
  34966. * @param chart {Chart.Controller} chart to update the options for
  34967. */
  34968. function updateConfig(chart) {
  34969. var newOptions = chart.options;
  34970. // Update Scale(s) with options
  34971. if (newOptions.scale) {
  34972. chart.scale.options = newOptions.scale;
  34973. } else if (newOptions.scales) {
  34974. newOptions.scales.xAxes.concat(newOptions.scales.yAxes).forEach(function(scaleOptions) {
  34975. chart.scales[scaleOptions.id].options = scaleOptions;
  34976. });
  34977. }
  34978. // Tooltip
  34979. chart.tooltip._options = newOptions.tooltips;
  34980. }
  34981. /**
  34982. * @class Chart.Controller
  34983. * The main controller of a chart.
  34984. */
  34985. Chart.Controller = function(item, config, instance) {
  34986. var me = this;
  34987. config = initConfig(config);
  34988. var context = platform.acquireContext(item, config);
  34989. var canvas = context && context.canvas;
  34990. var height = canvas && canvas.height;
  34991. var width = canvas && canvas.width;
  34992. instance.ctx = context;
  34993. instance.canvas = canvas;
  34994. instance.config = config;
  34995. instance.width = width;
  34996. instance.height = height;
  34997. instance.aspectRatio = height? width / height : null;
  34998. me.id = helpers.uid();
  34999. me.chart = instance;
  35000. me.config = config;
  35001. me.options = config.options;
  35002. me._bufferedRender = false;
  35003. // Add the chart instance to the global namespace
  35004. Chart.instances[me.id] = me;
  35005. Object.defineProperty(me, 'data', {
  35006. get: function() {
  35007. return me.config.data;
  35008. }
  35009. });
  35010. if (!context || !canvas) {
  35011. // The given item is not a compatible context2d element, let's return before finalizing
  35012. // the chart initialization but after setting basic chart / controller properties that
  35013. // can help to figure out that the chart is not valid (e.g chart.canvas !== null);
  35014. // https://github.com/chartjs/Chart.js/issues/2807
  35015. console.error("Failed to create chart: can't acquire context from the given item");
  35016. return me;
  35017. }
  35018. me.initialize();
  35019. me.update();
  35020. return me;
  35021. };
  35022. helpers.extend(Chart.Controller.prototype, /** @lends Chart.Controller.prototype */ {
  35023. initialize: function() {
  35024. var me = this;
  35025. // Before init plugin notification
  35026. plugins.notify(me, 'beforeInit');
  35027. helpers.retinaScale(me.chart);
  35028. me.bindEvents();
  35029. if (me.options.responsive) {
  35030. // Initial resize before chart draws (must be silent to preserve initial animations).
  35031. me.resize(true);
  35032. }
  35033. // Make sure scales have IDs and are built before we build any controllers.
  35034. me.ensureScalesHaveIDs();
  35035. me.buildScales();
  35036. me.initToolTip();
  35037. // After init plugin notification
  35038. plugins.notify(me, 'afterInit');
  35039. return me;
  35040. },
  35041. clear: function() {
  35042. helpers.clear(this.chart);
  35043. return this;
  35044. },
  35045. stop: function() {
  35046. // Stops any current animation loop occurring
  35047. Chart.animationService.cancelAnimation(this);
  35048. return this;
  35049. },
  35050. resize: function(silent) {
  35051. var me = this;
  35052. var chart = me.chart;
  35053. var options = me.options;
  35054. var canvas = chart.canvas;
  35055. var aspectRatio = (options.maintainAspectRatio && chart.aspectRatio) || null;
  35056. // the canvas render width and height will be casted to integers so make sure that
  35057. // the canvas display style uses the same integer values to avoid blurring effect.
  35058. var newWidth = Math.floor(helpers.getMaximumWidth(canvas));
  35059. var newHeight = Math.floor(aspectRatio? newWidth / aspectRatio : helpers.getMaximumHeight(canvas));
  35060. if (chart.width === newWidth && chart.height === newHeight) {
  35061. return;
  35062. }
  35063. canvas.width = chart.width = newWidth;
  35064. canvas.height = chart.height = newHeight;
  35065. canvas.style.width = newWidth + 'px';
  35066. canvas.style.height = newHeight + 'px';
  35067. helpers.retinaScale(chart);
  35068. if (!silent) {
  35069. // Notify any plugins about the resize
  35070. var newSize = {width: newWidth, height: newHeight};
  35071. plugins.notify(me, 'resize', [newSize]);
  35072. // Notify of resize
  35073. if (me.options.onResize) {
  35074. me.options.onResize(me, newSize);
  35075. }
  35076. me.stop();
  35077. me.update(me.options.responsiveAnimationDuration);
  35078. }
  35079. },
  35080. ensureScalesHaveIDs: function() {
  35081. var options = this.options;
  35082. var scalesOptions = options.scales || {};
  35083. var scaleOptions = options.scale;
  35084. helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {
  35085. xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);
  35086. });
  35087. helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {
  35088. yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);
  35089. });
  35090. if (scaleOptions) {
  35091. scaleOptions.id = scaleOptions.id || 'scale';
  35092. }
  35093. },
  35094. /**
  35095. * Builds a map of scale ID to scale object for future lookup.
  35096. */
  35097. buildScales: function() {
  35098. var me = this;
  35099. var options = me.options;
  35100. var scales = me.scales = {};
  35101. var items = [];
  35102. if (options.scales) {
  35103. items = items.concat(
  35104. (options.scales.xAxes || []).map(function(xAxisOptions) {
  35105. return {options: xAxisOptions, dtype: 'category'};
  35106. }),
  35107. (options.scales.yAxes || []).map(function(yAxisOptions) {
  35108. return {options: yAxisOptions, dtype: 'linear'};
  35109. })
  35110. );
  35111. }
  35112. if (options.scale) {
  35113. items.push({options: options.scale, dtype: 'radialLinear', isDefault: true});
  35114. }
  35115. helpers.each(items, function(item) {
  35116. var scaleOptions = item.options;
  35117. var scaleType = helpers.getValueOrDefault(scaleOptions.type, item.dtype);
  35118. var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);
  35119. if (!scaleClass) {
  35120. return;
  35121. }
  35122. var scale = new scaleClass({
  35123. id: scaleOptions.id,
  35124. options: scaleOptions,
  35125. ctx: me.chart.ctx,
  35126. chart: me
  35127. });
  35128. scales[scale.id] = scale;
  35129. // TODO(SB): I think we should be able to remove this custom case (options.scale)
  35130. // and consider it as a regular scale part of the "scales"" map only! This would
  35131. // make the logic easier and remove some useless? custom code.
  35132. if (item.isDefault) {
  35133. me.scale = scale;
  35134. }
  35135. });
  35136. Chart.scaleService.addScalesToLayout(this);
  35137. },
  35138. buildOrUpdateControllers: function() {
  35139. var me = this;
  35140. var types = [];
  35141. var newControllers = [];
  35142. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35143. var meta = me.getDatasetMeta(datasetIndex);
  35144. if (!meta.type) {
  35145. meta.type = dataset.type || me.config.type;
  35146. }
  35147. types.push(meta.type);
  35148. if (meta.controller) {
  35149. meta.controller.updateIndex(datasetIndex);
  35150. } else {
  35151. meta.controller = new Chart.controllers[meta.type](me, datasetIndex);
  35152. newControllers.push(meta.controller);
  35153. }
  35154. }, me);
  35155. if (types.length > 1) {
  35156. for (var i = 1; i < types.length; i++) {
  35157. if (types[i] !== types[i - 1]) {
  35158. me.isCombo = true;
  35159. break;
  35160. }
  35161. }
  35162. }
  35163. return newControllers;
  35164. },
  35165. /**
  35166. * Reset the elements of all datasets
  35167. * @private
  35168. */
  35169. resetElements: function() {
  35170. var me = this;
  35171. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35172. me.getDatasetMeta(datasetIndex).controller.reset();
  35173. }, me);
  35174. },
  35175. /**
  35176. * Resets the chart back to it's state before the initial animation
  35177. */
  35178. reset: function() {
  35179. this.resetElements();
  35180. this.tooltip.initialize();
  35181. },
  35182. update: function(animationDuration, lazy) {
  35183. var me = this;
  35184. updateConfig(me);
  35185. if (plugins.notify(me, 'beforeUpdate') === false) {
  35186. return;
  35187. }
  35188. // In case the entire data object changed
  35189. me.tooltip._data = me.data;
  35190. // Make sure dataset controllers are updated and new controllers are reset
  35191. var newControllers = me.buildOrUpdateControllers();
  35192. // Make sure all dataset controllers have correct meta data counts
  35193. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35194. me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();
  35195. }, me);
  35196. me.updateLayout();
  35197. // Can only reset the new controllers after the scales have been updated
  35198. helpers.each(newControllers, function(controller) {
  35199. controller.reset();
  35200. });
  35201. me.updateDatasets();
  35202. // Do this before render so that any plugins that need final scale updates can use it
  35203. plugins.notify(me, 'afterUpdate');
  35204. if (me._bufferedRender) {
  35205. me._bufferedRequest = {
  35206. lazy: lazy,
  35207. duration: animationDuration
  35208. };
  35209. } else {
  35210. me.render(animationDuration, lazy);
  35211. }
  35212. },
  35213. /**
  35214. * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
  35215. * hook, in which case, plugins will not be called on `afterLayout`.
  35216. * @private
  35217. */
  35218. updateLayout: function() {
  35219. var me = this;
  35220. if (plugins.notify(me, 'beforeLayout') === false) {
  35221. return;
  35222. }
  35223. Chart.layoutService.update(this, this.chart.width, this.chart.height);
  35224. /**
  35225. * Provided for backward compatibility, use `afterLayout` instead.
  35226. * @method IPlugin#afterScaleUpdate
  35227. * @deprecated since version 2.5.0
  35228. * @todo remove at version 3
  35229. */
  35230. plugins.notify(me, 'afterScaleUpdate');
  35231. plugins.notify(me, 'afterLayout');
  35232. },
  35233. /**
  35234. * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
  35235. * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
  35236. * @private
  35237. */
  35238. updateDatasets: function() {
  35239. var me = this;
  35240. if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {
  35241. return;
  35242. }
  35243. for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  35244. me.getDatasetMeta(i).controller.update();
  35245. }
  35246. plugins.notify(me, 'afterDatasetsUpdate');
  35247. },
  35248. render: function(duration, lazy) {
  35249. var me = this;
  35250. if (plugins.notify(me, 'beforeRender') === false) {
  35251. return;
  35252. }
  35253. var animationOptions = me.options.animation;
  35254. var onComplete = function() {
  35255. plugins.notify(me, 'afterRender');
  35256. var callback = animationOptions && animationOptions.onComplete;
  35257. if (callback && callback.call) {
  35258. callback.call(me);
  35259. }
  35260. };
  35261. if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {
  35262. var animation = new Chart.Animation();
  35263. animation.numSteps = (duration || animationOptions.duration) / 16.66; // 60 fps
  35264. animation.easing = animationOptions.easing;
  35265. // render function
  35266. animation.render = function(chartInstance, animationObject) {
  35267. var easingFunction = helpers.easingEffects[animationObject.easing];
  35268. var stepDecimal = animationObject.currentStep / animationObject.numSteps;
  35269. var easeDecimal = easingFunction(stepDecimal);
  35270. chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
  35271. };
  35272. // user events
  35273. animation.onAnimationProgress = animationOptions.onProgress;
  35274. animation.onAnimationComplete = onComplete;
  35275. Chart.animationService.addAnimation(me, animation, duration, lazy);
  35276. } else {
  35277. me.draw();
  35278. onComplete();
  35279. }
  35280. return me;
  35281. },
  35282. draw: function(easingValue) {
  35283. var me = this;
  35284. me.clear();
  35285. if (easingValue === undefined || easingValue === null) {
  35286. easingValue = 1;
  35287. }
  35288. if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
  35289. return;
  35290. }
  35291. // Draw all the scales
  35292. helpers.each(me.boxes, function(box) {
  35293. box.draw(me.chartArea);
  35294. }, me);
  35295. if (me.scale) {
  35296. me.scale.draw();
  35297. }
  35298. me.drawDatasets(easingValue);
  35299. // Finally draw the tooltip
  35300. me.tooltip.transition(easingValue).draw();
  35301. plugins.notify(me, 'afterDraw', [easingValue]);
  35302. },
  35303. /**
  35304. * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
  35305. * hook, in which case, plugins will not be called on `afterDatasetsDraw`.
  35306. * @private
  35307. */
  35308. drawDatasets: function(easingValue) {
  35309. var me = this;
  35310. if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {
  35311. return;
  35312. }
  35313. // Draw each dataset via its respective controller (reversed to support proper line stacking)
  35314. helpers.each(me.data.datasets, function(dataset, datasetIndex) {
  35315. if (me.isDatasetVisible(datasetIndex)) {
  35316. me.getDatasetMeta(datasetIndex).controller.draw(easingValue);
  35317. }
  35318. }, me, true);
  35319. plugins.notify(me, 'afterDatasetsDraw', [easingValue]);
  35320. },
  35321. // Get the single element that was clicked on
  35322. // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
  35323. getElementAtEvent: function(e) {
  35324. return Chart.Interaction.modes.single(this, e);
  35325. },
  35326. getElementsAtEvent: function(e) {
  35327. return Chart.Interaction.modes.label(this, e, {intersect: true});
  35328. },
  35329. getElementsAtXAxis: function(e) {
  35330. return Chart.Interaction.modes['x-axis'](this, e, {intersect: true});
  35331. },
  35332. getElementsAtEventForMode: function(e, mode, options) {
  35333. var method = Chart.Interaction.modes[mode];
  35334. if (typeof method === 'function') {
  35335. return method(this, e, options);
  35336. }
  35337. return [];
  35338. },
  35339. getDatasetAtEvent: function(e) {
  35340. return Chart.Interaction.modes.dataset(this, e, {intersect: true});
  35341. },
  35342. getDatasetMeta: function(datasetIndex) {
  35343. var me = this;
  35344. var dataset = me.data.datasets[datasetIndex];
  35345. if (!dataset._meta) {
  35346. dataset._meta = {};
  35347. }
  35348. var meta = dataset._meta[me.id];
  35349. if (!meta) {
  35350. meta = dataset._meta[me.id] = {
  35351. type: null,
  35352. data: [],
  35353. dataset: null,
  35354. controller: null,
  35355. hidden: null, // See isDatasetVisible() comment
  35356. xAxisID: null,
  35357. yAxisID: null
  35358. };
  35359. }
  35360. return meta;
  35361. },
  35362. getVisibleDatasetCount: function() {
  35363. var count = 0;
  35364. for (var i = 0, ilen = this.data.datasets.length; i<ilen; ++i) {
  35365. if (this.isDatasetVisible(i)) {
  35366. count++;
  35367. }
  35368. }
  35369. return count;
  35370. },
  35371. isDatasetVisible: function(datasetIndex) {
  35372. var meta = this.getDatasetMeta(datasetIndex);
  35373. // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,
  35374. // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.
  35375. return typeof meta.hidden === 'boolean'? !meta.hidden : !this.data.datasets[datasetIndex].hidden;
  35376. },
  35377. generateLegend: function() {
  35378. return this.options.legendCallback(this);
  35379. },
  35380. destroy: function() {
  35381. var me = this;
  35382. var canvas = me.chart.canvas;
  35383. var meta, i, ilen;
  35384. me.stop();
  35385. // dataset controllers need to cleanup associated data
  35386. for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  35387. meta = me.getDatasetMeta(i);
  35388. if (meta.controller) {
  35389. meta.controller.destroy();
  35390. meta.controller = null;
  35391. }
  35392. }
  35393. if (canvas) {
  35394. me.unbindEvents();
  35395. helpers.clear(me.chart);
  35396. platform.releaseContext(me.chart.ctx);
  35397. me.chart.canvas = null;
  35398. me.chart.ctx = null;
  35399. }
  35400. plugins.notify(me, 'destroy');
  35401. delete Chart.instances[me.id];
  35402. },
  35403. toBase64Image: function() {
  35404. return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);
  35405. },
  35406. initToolTip: function() {
  35407. var me = this;
  35408. me.tooltip = new Chart.Tooltip({
  35409. _chart: me.chart,
  35410. _chartInstance: me,
  35411. _data: me.data,
  35412. _options: me.options.tooltips
  35413. }, me);
  35414. me.tooltip.initialize();
  35415. },
  35416. /**
  35417. * @private
  35418. */
  35419. bindEvents: function() {
  35420. var me = this;
  35421. var listeners = me._listeners = {};
  35422. var listener = function() {
  35423. me.eventHandler.apply(me, arguments);
  35424. };
  35425. helpers.each(me.options.events, function(type) {
  35426. platform.addEventListener(me, type, listener);
  35427. listeners[type] = listener;
  35428. });
  35429. // Responsiveness is currently based on the use of an iframe, however this method causes
  35430. // performance issues and could be troublesome when used with ad blockers. So make sure
  35431. // that the user is still able to create a chart without iframe when responsive is false.
  35432. // See https://github.com/chartjs/Chart.js/issues/2210
  35433. if (me.options.responsive) {
  35434. listener = function() {
  35435. me.resize();
  35436. };
  35437. platform.addEventListener(me, 'resize', listener);
  35438. listeners.resize = listener;
  35439. }
  35440. },
  35441. /**
  35442. * @private
  35443. */
  35444. unbindEvents: function() {
  35445. var me = this;
  35446. var listeners = me._listeners;
  35447. if (!listeners) {
  35448. return;
  35449. }
  35450. delete me._listeners;
  35451. helpers.each(listeners, function(listener, type) {
  35452. platform.removeEventListener(me, type, listener);
  35453. });
  35454. },
  35455. updateHoverStyle: function(elements, mode, enabled) {
  35456. var method = enabled? 'setHoverStyle' : 'removeHoverStyle';
  35457. var element, i, ilen;
  35458. for (i=0, ilen=elements.length; i<ilen; ++i) {
  35459. element = elements[i];
  35460. if (element) {
  35461. this.getDatasetMeta(element._datasetIndex).controller[method](element);
  35462. }
  35463. }
  35464. },
  35465. /**
  35466. * @private
  35467. */
  35468. eventHandler: function(e) {
  35469. var me = this;
  35470. var tooltip = me.tooltip;
  35471. if (plugins.notify(me, 'beforeEvent', [e]) === false) {
  35472. return;
  35473. }
  35474. // Buffer any update calls so that renders do not occur
  35475. me._bufferedRender = true;
  35476. me._bufferedRequest = null;
  35477. var changed = me.handleEvent(e);
  35478. changed |= tooltip && tooltip.handleEvent(e);
  35479. plugins.notify(me, 'afterEvent', [e]);
  35480. var bufferedRequest = me._bufferedRequest;
  35481. if (bufferedRequest) {
  35482. // If we have an update that was triggered, we need to do a normal render
  35483. me.render(bufferedRequest.duration, bufferedRequest.lazy);
  35484. } else if (changed && !me.animating) {
  35485. // If entering, leaving, or changing elements, animate the change via pivot
  35486. me.stop();
  35487. // We only need to render at this point. Updating will cause scales to be
  35488. // recomputed generating flicker & using more memory than necessary.
  35489. me.render(me.options.hover.animationDuration, true);
  35490. }
  35491. me._bufferedRender = false;
  35492. me._bufferedRequest = null;
  35493. return me;
  35494. },
  35495. /**
  35496. * Handle an event
  35497. * @private
  35498. * @param {IEvent} event the event to handle
  35499. * @return {Boolean} true if the chart needs to re-render
  35500. */
  35501. handleEvent: function(e) {
  35502. var me = this;
  35503. var options = me.options || {};
  35504. var hoverOptions = options.hover;
  35505. var changed = false;
  35506. me.lastActive = me.lastActive || [];
  35507. // Find Active Elements for hover and tooltips
  35508. if (e.type === 'mouseout') {
  35509. me.active = [];
  35510. } else {
  35511. me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);
  35512. }
  35513. // On Hover hook
  35514. if (hoverOptions.onHover) {
  35515. // Need to call with native event here to not break backwards compatibility
  35516. hoverOptions.onHover.call(me, e.native, me.active);
  35517. }
  35518. if (e.type === 'mouseup' || e.type === 'click') {
  35519. if (options.onClick) {
  35520. // Use e.native here for backwards compatibility
  35521. options.onClick.call(me, e.native, me.active);
  35522. }
  35523. }
  35524. // Remove styling for last active (even if it may still be active)
  35525. if (me.lastActive.length) {
  35526. me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);
  35527. }
  35528. // Built in hover styling
  35529. if (me.active.length && hoverOptions.mode) {
  35530. me.updateHoverStyle(me.active, hoverOptions.mode, true);
  35531. }
  35532. changed = !helpers.arrayEquals(me.active, me.lastActive);
  35533. // Remember Last Actives
  35534. me.lastActive = me.active;
  35535. return changed;
  35536. }
  35537. });
  35538. };
  35539. /***/ }),
  35540. /* 142 */
  35541. /***/ (function(module, exports, __webpack_require__) {
  35542. "use strict";
  35543. module.exports = function(Chart) {
  35544. var helpers = Chart.helpers;
  35545. var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];
  35546. /**
  35547. * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
  35548. * 'unshift') and notify the listener AFTER the array has been altered. Listeners are
  35549. * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.
  35550. */
  35551. function listenArrayEvents(array, listener) {
  35552. if (array._chartjs) {
  35553. array._chartjs.listeners.push(listener);
  35554. return;
  35555. }
  35556. Object.defineProperty(array, '_chartjs', {
  35557. configurable: true,
  35558. enumerable: false,
  35559. value: {
  35560. listeners: [listener]
  35561. }
  35562. });
  35563. arrayEvents.forEach(function(key) {
  35564. var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);
  35565. var base = array[key];
  35566. Object.defineProperty(array, key, {
  35567. configurable: true,
  35568. enumerable: false,
  35569. value: function() {
  35570. var args = Array.prototype.slice.call(arguments);
  35571. var res = base.apply(this, args);
  35572. helpers.each(array._chartjs.listeners, function(object) {
  35573. if (typeof object[method] === 'function') {
  35574. object[method].apply(object, args);
  35575. }
  35576. });
  35577. return res;
  35578. }
  35579. });
  35580. });
  35581. }
  35582. /**
  35583. * Removes the given array event listener and cleanup extra attached properties (such as
  35584. * the _chartjs stub and overridden methods) if array doesn't have any more listeners.
  35585. */
  35586. function unlistenArrayEvents(array, listener) {
  35587. var stub = array._chartjs;
  35588. if (!stub) {
  35589. return;
  35590. }
  35591. var listeners = stub.listeners;
  35592. var index = listeners.indexOf(listener);
  35593. if (index !== -1) {
  35594. listeners.splice(index, 1);
  35595. }
  35596. if (listeners.length > 0) {
  35597. return;
  35598. }
  35599. arrayEvents.forEach(function(key) {
  35600. delete array[key];
  35601. });
  35602. delete array._chartjs;
  35603. }
  35604. // Base class for all dataset controllers (line, bar, etc)
  35605. Chart.DatasetController = function(chart, datasetIndex) {
  35606. this.initialize(chart, datasetIndex);
  35607. };
  35608. helpers.extend(Chart.DatasetController.prototype, {
  35609. /**
  35610. * Element type used to generate a meta dataset (e.g. Chart.element.Line).
  35611. * @type {Chart.core.element}
  35612. */
  35613. datasetElementType: null,
  35614. /**
  35615. * Element type used to generate a meta data (e.g. Chart.element.Point).
  35616. * @type {Chart.core.element}
  35617. */
  35618. dataElementType: null,
  35619. initialize: function(chart, datasetIndex) {
  35620. var me = this;
  35621. me.chart = chart;
  35622. me.index = datasetIndex;
  35623. me.linkScales();
  35624. me.addElements();
  35625. },
  35626. updateIndex: function(datasetIndex) {
  35627. this.index = datasetIndex;
  35628. },
  35629. linkScales: function() {
  35630. var me = this;
  35631. var meta = me.getMeta();
  35632. var dataset = me.getDataset();
  35633. if (meta.xAxisID === null) {
  35634. meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;
  35635. }
  35636. if (meta.yAxisID === null) {
  35637. meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;
  35638. }
  35639. },
  35640. getDataset: function() {
  35641. return this.chart.data.datasets[this.index];
  35642. },
  35643. getMeta: function() {
  35644. return this.chart.getDatasetMeta(this.index);
  35645. },
  35646. getScaleForId: function(scaleID) {
  35647. return this.chart.scales[scaleID];
  35648. },
  35649. reset: function() {
  35650. this.update(true);
  35651. },
  35652. /**
  35653. * @private
  35654. */
  35655. destroy: function() {
  35656. if (this._data) {
  35657. unlistenArrayEvents(this._data, this);
  35658. }
  35659. },
  35660. createMetaDataset: function() {
  35661. var me = this;
  35662. var type = me.datasetElementType;
  35663. return type && new type({
  35664. _chart: me.chart.chart,
  35665. _datasetIndex: me.index
  35666. });
  35667. },
  35668. createMetaData: function(index) {
  35669. var me = this;
  35670. var type = me.dataElementType;
  35671. return type && new type({
  35672. _chart: me.chart.chart,
  35673. _datasetIndex: me.index,
  35674. _index: index
  35675. });
  35676. },
  35677. addElements: function() {
  35678. var me = this;
  35679. var meta = me.getMeta();
  35680. var data = me.getDataset().data || [];
  35681. var metaData = meta.data;
  35682. var i, ilen;
  35683. for (i=0, ilen=data.length; i<ilen; ++i) {
  35684. metaData[i] = metaData[i] || me.createMetaData(i);
  35685. }
  35686. meta.dataset = meta.dataset || me.createMetaDataset();
  35687. },
  35688. addElementAndReset: function(index) {
  35689. var element = this.createMetaData(index);
  35690. this.getMeta().data.splice(index, 0, element);
  35691. this.updateElement(element, index, true);
  35692. },
  35693. buildOrUpdateElements: function() {
  35694. var me = this;
  35695. var dataset = me.getDataset();
  35696. var data = dataset.data || (dataset.data = []);
  35697. // In order to correctly handle data addition/deletion animation (an thus simulate
  35698. // real-time charts), we need to monitor these data modifications and synchronize
  35699. // the internal meta data accordingly.
  35700. if (me._data !== data) {
  35701. if (me._data) {
  35702. // This case happens when the user replaced the data array instance.
  35703. unlistenArrayEvents(me._data, me);
  35704. }
  35705. listenArrayEvents(data, me);
  35706. me._data = data;
  35707. }
  35708. // Re-sync meta data in case the user replaced the data array or if we missed
  35709. // any updates and so make sure that we handle number of datapoints changing.
  35710. me.resyncElements();
  35711. },
  35712. update: helpers.noop,
  35713. draw: function(ease) {
  35714. var easingDecimal = ease || 1;
  35715. var i, len;
  35716. var metaData = this.getMeta().data;
  35717. for (i = 0, len = metaData.length; i < len; ++i) {
  35718. metaData[i].transition(easingDecimal).draw();
  35719. }
  35720. },
  35721. removeHoverStyle: function(element, elementOpts) {
  35722. var dataset = this.chart.data.datasets[element._datasetIndex],
  35723. index = element._index,
  35724. custom = element.custom || {},
  35725. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35726. model = element._model;
  35727. model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);
  35728. model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);
  35729. model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);
  35730. },
  35731. setHoverStyle: function(element) {
  35732. var dataset = this.chart.data.datasets[element._datasetIndex],
  35733. index = element._index,
  35734. custom = element.custom || {},
  35735. valueOrDefault = helpers.getValueAtIndexOrDefault,
  35736. getHoverColor = helpers.getHoverColor,
  35737. model = element._model;
  35738. model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));
  35739. model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));
  35740. model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);
  35741. },
  35742. /**
  35743. * @private
  35744. */
  35745. resyncElements: function() {
  35746. var me = this;
  35747. var meta = me.getMeta();
  35748. var data = me.getDataset().data;
  35749. var numMeta = meta.data.length;
  35750. var numData = data.length;
  35751. if (numData < numMeta) {
  35752. meta.data.splice(numData, numMeta - numData);
  35753. } else if (numData > numMeta) {
  35754. me.insertElements(numMeta, numData - numMeta);
  35755. }
  35756. },
  35757. /**
  35758. * @private
  35759. */
  35760. insertElements: function(start, count) {
  35761. for (var i=0; i<count; ++i) {
  35762. this.addElementAndReset(start + i);
  35763. }
  35764. },
  35765. /**
  35766. * @private
  35767. */
  35768. onDataPush: function() {
  35769. this.insertElements(this.getDataset().data.length-1, arguments.length);
  35770. },
  35771. /**
  35772. * @private
  35773. */
  35774. onDataPop: function() {
  35775. this.getMeta().data.pop();
  35776. },
  35777. /**
  35778. * @private
  35779. */
  35780. onDataShift: function() {
  35781. this.getMeta().data.shift();
  35782. },
  35783. /**
  35784. * @private
  35785. */
  35786. onDataSplice: function(start, count) {
  35787. this.getMeta().data.splice(start, count);
  35788. this.insertElements(start, arguments.length - 2);
  35789. },
  35790. /**
  35791. * @private
  35792. */
  35793. onDataUnshift: function() {
  35794. this.insertElements(0, arguments.length);
  35795. }
  35796. });
  35797. Chart.DatasetController.extend = helpers.inherits;
  35798. };
  35799. /***/ }),
  35800. /* 143 */
  35801. /***/ (function(module, exports, __webpack_require__) {
  35802. "use strict";
  35803. module.exports = function(Chart) {
  35804. var helpers = Chart.helpers;
  35805. Chart.elements = {};
  35806. Chart.Element = function(configuration) {
  35807. helpers.extend(this, configuration);
  35808. this.initialize.apply(this, arguments);
  35809. };
  35810. helpers.extend(Chart.Element.prototype, {
  35811. initialize: function() {
  35812. this.hidden = false;
  35813. },
  35814. pivot: function() {
  35815. var me = this;
  35816. if (!me._view) {
  35817. me._view = helpers.clone(me._model);
  35818. }
  35819. me._start = helpers.clone(me._view);
  35820. return me;
  35821. },
  35822. transition: function(ease) {
  35823. var me = this;
  35824. if (!me._view) {
  35825. me._view = helpers.clone(me._model);
  35826. }
  35827. // No animation -> No Transition
  35828. if (ease === 1) {
  35829. me._view = me._model;
  35830. me._start = null;
  35831. return me;
  35832. }
  35833. if (!me._start) {
  35834. me.pivot();
  35835. }
  35836. helpers.each(me._model, function(value, key) {
  35837. if (key[0] === '_') {
  35838. // Only non-underscored properties
  35839. // Init if doesn't exist
  35840. } else if (!me._view.hasOwnProperty(key)) {
  35841. if (typeof value === 'number' && !isNaN(me._view[key])) {
  35842. me._view[key] = value * ease;
  35843. } else {
  35844. me._view[key] = value;
  35845. }
  35846. // No unnecessary computations
  35847. } else if (value === me._view[key]) {
  35848. // It's the same! Woohoo!
  35849. // Color transitions if possible
  35850. } else if (typeof value === 'string') {
  35851. try {
  35852. var color = helpers.color(me._model[key]).mix(helpers.color(me._start[key]), ease);
  35853. me._view[key] = color.rgbString();
  35854. } catch (err) {
  35855. me._view[key] = value;
  35856. }
  35857. // Number transitions
  35858. } else if (typeof value === 'number') {
  35859. var startVal = me._start[key] !== undefined && isNaN(me._start[key]) === false ? me._start[key] : 0;
  35860. me._view[key] = ((me._model[key] - startVal) * ease) + startVal;
  35861. // Everything else
  35862. } else {
  35863. me._view[key] = value;
  35864. }
  35865. }, me);
  35866. return me;
  35867. },
  35868. tooltipPosition: function() {
  35869. return {
  35870. x: this._model.x,
  35871. y: this._model.y
  35872. };
  35873. },
  35874. hasValue: function() {
  35875. return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);
  35876. }
  35877. });
  35878. Chart.Element.extend = helpers.inherits;
  35879. };
  35880. /***/ }),
  35881. /* 144 */
  35882. /***/ (function(module, exports, __webpack_require__) {
  35883. "use strict";
  35884. /* global window: false */
  35885. /* global document: false */
  35886. var color = __webpack_require__(168);
  35887. module.exports = function(Chart) {
  35888. // Global Chart helpers object for utility methods and classes
  35889. var helpers = Chart.helpers = {};
  35890. // -- Basic js utility methods
  35891. helpers.each = function(loopable, callback, self, reverse) {
  35892. // Check to see if null or undefined firstly.
  35893. var i, len;
  35894. if (helpers.isArray(loopable)) {
  35895. len = loopable.length;
  35896. if (reverse) {
  35897. for (i = len - 1; i >= 0; i--) {
  35898. callback.call(self, loopable[i], i);
  35899. }
  35900. } else {
  35901. for (i = 0; i < len; i++) {
  35902. callback.call(self, loopable[i], i);
  35903. }
  35904. }
  35905. } else if (typeof loopable === 'object') {
  35906. var keys = Object.keys(loopable);
  35907. len = keys.length;
  35908. for (i = 0; i < len; i++) {
  35909. callback.call(self, loopable[keys[i]], keys[i]);
  35910. }
  35911. }
  35912. };
  35913. helpers.clone = function(obj) {
  35914. var objClone = {};
  35915. helpers.each(obj, function(value, key) {
  35916. if (helpers.isArray(value)) {
  35917. objClone[key] = value.slice(0);
  35918. } else if (typeof value === 'object' && value !== null) {
  35919. objClone[key] = helpers.clone(value);
  35920. } else {
  35921. objClone[key] = value;
  35922. }
  35923. });
  35924. return objClone;
  35925. };
  35926. helpers.extend = function(base) {
  35927. var setFn = function(value, key) {
  35928. base[key] = value;
  35929. };
  35930. for (var i = 1, ilen = arguments.length; i < ilen; i++) {
  35931. helpers.each(arguments[i], setFn);
  35932. }
  35933. return base;
  35934. };
  35935. // Need a special merge function to chart configs since they are now grouped
  35936. helpers.configMerge = function(_base) {
  35937. var base = helpers.clone(_base);
  35938. helpers.each(Array.prototype.slice.call(arguments, 1), function(extension) {
  35939. helpers.each(extension, function(value, key) {
  35940. var baseHasProperty = base.hasOwnProperty(key);
  35941. var baseVal = baseHasProperty ? base[key] : {};
  35942. if (key === 'scales') {
  35943. // Scale config merging is complex. Add our own function here for that
  35944. base[key] = helpers.scaleMerge(baseVal, value);
  35945. } else if (key === 'scale') {
  35946. // Used in polar area & radar charts since there is only one scale
  35947. base[key] = helpers.configMerge(baseVal, Chart.scaleService.getScaleDefaults(value.type), value);
  35948. } else if (baseHasProperty
  35949. && typeof baseVal === 'object'
  35950. && !helpers.isArray(baseVal)
  35951. && baseVal !== null
  35952. && typeof value === 'object'
  35953. && !helpers.isArray(value)) {
  35954. // If we are overwriting an object with an object, do a merge of the properties.
  35955. base[key] = helpers.configMerge(baseVal, value);
  35956. } else {
  35957. // can just overwrite the value in this case
  35958. base[key] = value;
  35959. }
  35960. });
  35961. });
  35962. return base;
  35963. };
  35964. helpers.scaleMerge = function(_base, extension) {
  35965. var base = helpers.clone(_base);
  35966. helpers.each(extension, function(value, key) {
  35967. if (key === 'xAxes' || key === 'yAxes') {
  35968. // These properties are arrays of items
  35969. if (base.hasOwnProperty(key)) {
  35970. helpers.each(value, function(valueObj, index) {
  35971. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  35972. var axisDefaults = Chart.scaleService.getScaleDefaults(axisType);
  35973. if (index >= base[key].length || !base[key][index].type) {
  35974. base[key].push(helpers.configMerge(axisDefaults, valueObj));
  35975. } else if (valueObj.type && valueObj.type !== base[key][index].type) {
  35976. // Type changed. Bring in the new defaults before we bring in valueObj so that valueObj can override the correct scale defaults
  35977. base[key][index] = helpers.configMerge(base[key][index], axisDefaults, valueObj);
  35978. } else {
  35979. // Type is the same
  35980. base[key][index] = helpers.configMerge(base[key][index], valueObj);
  35981. }
  35982. });
  35983. } else {
  35984. base[key] = [];
  35985. helpers.each(value, function(valueObj) {
  35986. var axisType = helpers.getValueOrDefault(valueObj.type, key === 'xAxes' ? 'category' : 'linear');
  35987. base[key].push(helpers.configMerge(Chart.scaleService.getScaleDefaults(axisType), valueObj));
  35988. });
  35989. }
  35990. } else if (base.hasOwnProperty(key) && typeof base[key] === 'object' && base[key] !== null && typeof value === 'object') {
  35991. // If we are overwriting an object with an object, do a merge of the properties.
  35992. base[key] = helpers.configMerge(base[key], value);
  35993. } else {
  35994. // can just overwrite the value in this case
  35995. base[key] = value;
  35996. }
  35997. });
  35998. return base;
  35999. };
  36000. helpers.getValueAtIndexOrDefault = function(value, index, defaultValue) {
  36001. if (value === undefined || value === null) {
  36002. return defaultValue;
  36003. }
  36004. if (helpers.isArray(value)) {
  36005. return index < value.length ? value[index] : defaultValue;
  36006. }
  36007. return value;
  36008. };
  36009. helpers.getValueOrDefault = function(value, defaultValue) {
  36010. return value === undefined ? defaultValue : value;
  36011. };
  36012. helpers.indexOf = Array.prototype.indexOf?
  36013. function(array, item) {
  36014. return array.indexOf(item);
  36015. }:
  36016. function(array, item) {
  36017. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  36018. if (array[i] === item) {
  36019. return i;
  36020. }
  36021. }
  36022. return -1;
  36023. };
  36024. helpers.where = function(collection, filterCallback) {
  36025. if (helpers.isArray(collection) && Array.prototype.filter) {
  36026. return collection.filter(filterCallback);
  36027. }
  36028. var filtered = [];
  36029. helpers.each(collection, function(item) {
  36030. if (filterCallback(item)) {
  36031. filtered.push(item);
  36032. }
  36033. });
  36034. return filtered;
  36035. };
  36036. helpers.findIndex = Array.prototype.findIndex?
  36037. function(array, callback, scope) {
  36038. return array.findIndex(callback, scope);
  36039. } :
  36040. function(array, callback, scope) {
  36041. scope = scope === undefined? array : scope;
  36042. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  36043. if (callback.call(scope, array[i], i, array)) {
  36044. return i;
  36045. }
  36046. }
  36047. return -1;
  36048. };
  36049. helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {
  36050. // Default to start of the array
  36051. if (startIndex === undefined || startIndex === null) {
  36052. startIndex = -1;
  36053. }
  36054. for (var i = startIndex + 1; i < arrayToSearch.length; i++) {
  36055. var currentItem = arrayToSearch[i];
  36056. if (filterCallback(currentItem)) {
  36057. return currentItem;
  36058. }
  36059. }
  36060. };
  36061. helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {
  36062. // Default to end of the array
  36063. if (startIndex === undefined || startIndex === null) {
  36064. startIndex = arrayToSearch.length;
  36065. }
  36066. for (var i = startIndex - 1; i >= 0; i--) {
  36067. var currentItem = arrayToSearch[i];
  36068. if (filterCallback(currentItem)) {
  36069. return currentItem;
  36070. }
  36071. }
  36072. };
  36073. helpers.inherits = function(extensions) {
  36074. // Basic javascript inheritance based on the model created in Backbone.js
  36075. var me = this;
  36076. var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {
  36077. return me.apply(this, arguments);
  36078. };
  36079. var Surrogate = function() {
  36080. this.constructor = ChartElement;
  36081. };
  36082. Surrogate.prototype = me.prototype;
  36083. ChartElement.prototype = new Surrogate();
  36084. ChartElement.extend = helpers.inherits;
  36085. if (extensions) {
  36086. helpers.extend(ChartElement.prototype, extensions);
  36087. }
  36088. ChartElement.__super__ = me.prototype;
  36089. return ChartElement;
  36090. };
  36091. helpers.noop = function() {};
  36092. helpers.uid = (function() {
  36093. var id = 0;
  36094. return function() {
  36095. return id++;
  36096. };
  36097. }());
  36098. // -- Math methods
  36099. helpers.isNumber = function(n) {
  36100. return !isNaN(parseFloat(n)) && isFinite(n);
  36101. };
  36102. helpers.almostEquals = function(x, y, epsilon) {
  36103. return Math.abs(x - y) < epsilon;
  36104. };
  36105. helpers.almostWhole = function(x, epsilon) {
  36106. var rounded = Math.round(x);
  36107. return (((rounded - epsilon) < x) && ((rounded + epsilon) > x));
  36108. };
  36109. helpers.max = function(array) {
  36110. return array.reduce(function(max, value) {
  36111. if (!isNaN(value)) {
  36112. return Math.max(max, value);
  36113. }
  36114. return max;
  36115. }, Number.NEGATIVE_INFINITY);
  36116. };
  36117. helpers.min = function(array) {
  36118. return array.reduce(function(min, value) {
  36119. if (!isNaN(value)) {
  36120. return Math.min(min, value);
  36121. }
  36122. return min;
  36123. }, Number.POSITIVE_INFINITY);
  36124. };
  36125. helpers.sign = Math.sign?
  36126. function(x) {
  36127. return Math.sign(x);
  36128. } :
  36129. function(x) {
  36130. x = +x; // convert to a number
  36131. if (x === 0 || isNaN(x)) {
  36132. return x;
  36133. }
  36134. return x > 0 ? 1 : -1;
  36135. };
  36136. helpers.log10 = Math.log10?
  36137. function(x) {
  36138. return Math.log10(x);
  36139. } :
  36140. function(x) {
  36141. return Math.log(x) / Math.LN10;
  36142. };
  36143. helpers.toRadians = function(degrees) {
  36144. return degrees * (Math.PI / 180);
  36145. };
  36146. helpers.toDegrees = function(radians) {
  36147. return radians * (180 / Math.PI);
  36148. };
  36149. // Gets the angle from vertical upright to the point about a centre.
  36150. helpers.getAngleFromPoint = function(centrePoint, anglePoint) {
  36151. var distanceFromXCenter = anglePoint.x - centrePoint.x,
  36152. distanceFromYCenter = anglePoint.y - centrePoint.y,
  36153. radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
  36154. var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
  36155. if (angle < (-0.5 * Math.PI)) {
  36156. angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
  36157. }
  36158. return {
  36159. angle: angle,
  36160. distance: radialDistanceFromCenter
  36161. };
  36162. };
  36163. helpers.distanceBetweenPoints = function(pt1, pt2) {
  36164. return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
  36165. };
  36166. helpers.aliasPixel = function(pixelWidth) {
  36167. return (pixelWidth % 2 === 0) ? 0 : 0.5;
  36168. };
  36169. helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
  36170. // Props to Rob Spencer at scaled innovation for his post on splining between points
  36171. // http://scaledinnovation.com/analytics/splines/aboutSplines.html
  36172. // This function must also respect "skipped" points
  36173. var previous = firstPoint.skip ? middlePoint : firstPoint,
  36174. current = middlePoint,
  36175. next = afterPoint.skip ? middlePoint : afterPoint;
  36176. var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));
  36177. var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));
  36178. var s01 = d01 / (d01 + d12);
  36179. var s12 = d12 / (d01 + d12);
  36180. // If all points are the same, s01 & s02 will be inf
  36181. s01 = isNaN(s01) ? 0 : s01;
  36182. s12 = isNaN(s12) ? 0 : s12;
  36183. var fa = t * s01; // scaling factor for triangle Ta
  36184. var fb = t * s12;
  36185. return {
  36186. previous: {
  36187. x: current.x - fa * (next.x - previous.x),
  36188. y: current.y - fa * (next.y - previous.y)
  36189. },
  36190. next: {
  36191. x: current.x + fb * (next.x - previous.x),
  36192. y: current.y + fb * (next.y - previous.y)
  36193. }
  36194. };
  36195. };
  36196. helpers.EPSILON = Number.EPSILON || 1e-14;
  36197. helpers.splineCurveMonotone = function(points) {
  36198. // This function calculates Bézier control points in a similar way than |splineCurve|,
  36199. // but preserves monotonicity of the provided data and ensures no local extremums are added
  36200. // between the dataset discrete points due to the interpolation.
  36201. // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
  36202. var pointsWithTangents = (points || []).map(function(point) {
  36203. return {
  36204. model: point._model,
  36205. deltaK: 0,
  36206. mK: 0
  36207. };
  36208. });
  36209. // Calculate slopes (deltaK) and initialize tangents (mK)
  36210. var pointsLen = pointsWithTangents.length;
  36211. var i, pointBefore, pointCurrent, pointAfter;
  36212. for (i = 0; i < pointsLen; ++i) {
  36213. pointCurrent = pointsWithTangents[i];
  36214. if (pointCurrent.model.skip) {
  36215. continue;
  36216. }
  36217. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  36218. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  36219. if (pointAfter && !pointAfter.model.skip) {
  36220. var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);
  36221. // In the case of two points that appear at the same x pixel, slopeDeltaX is 0
  36222. pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;
  36223. }
  36224. if (!pointBefore || pointBefore.model.skip) {
  36225. pointCurrent.mK = pointCurrent.deltaK;
  36226. } else if (!pointAfter || pointAfter.model.skip) {
  36227. pointCurrent.mK = pointBefore.deltaK;
  36228. } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {
  36229. pointCurrent.mK = 0;
  36230. } else {
  36231. pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;
  36232. }
  36233. }
  36234. // Adjust tangents to ensure monotonic properties
  36235. var alphaK, betaK, tauK, squaredMagnitude;
  36236. for (i = 0; i < pointsLen - 1; ++i) {
  36237. pointCurrent = pointsWithTangents[i];
  36238. pointAfter = pointsWithTangents[i + 1];
  36239. if (pointCurrent.model.skip || pointAfter.model.skip) {
  36240. continue;
  36241. }
  36242. if (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {
  36243. pointCurrent.mK = pointAfter.mK = 0;
  36244. continue;
  36245. }
  36246. alphaK = pointCurrent.mK / pointCurrent.deltaK;
  36247. betaK = pointAfter.mK / pointCurrent.deltaK;
  36248. squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
  36249. if (squaredMagnitude <= 9) {
  36250. continue;
  36251. }
  36252. tauK = 3 / Math.sqrt(squaredMagnitude);
  36253. pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;
  36254. pointAfter.mK = betaK * tauK * pointCurrent.deltaK;
  36255. }
  36256. // Compute control points
  36257. var deltaX;
  36258. for (i = 0; i < pointsLen; ++i) {
  36259. pointCurrent = pointsWithTangents[i];
  36260. if (pointCurrent.model.skip) {
  36261. continue;
  36262. }
  36263. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  36264. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  36265. if (pointBefore && !pointBefore.model.skip) {
  36266. deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;
  36267. pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;
  36268. pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;
  36269. }
  36270. if (pointAfter && !pointAfter.model.skip) {
  36271. deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;
  36272. pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;
  36273. pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;
  36274. }
  36275. }
  36276. };
  36277. helpers.nextItem = function(collection, index, loop) {
  36278. if (loop) {
  36279. return index >= collection.length - 1 ? collection[0] : collection[index + 1];
  36280. }
  36281. return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];
  36282. };
  36283. helpers.previousItem = function(collection, index, loop) {
  36284. if (loop) {
  36285. return index <= 0 ? collection[collection.length - 1] : collection[index - 1];
  36286. }
  36287. return index <= 0 ? collection[0] : collection[index - 1];
  36288. };
  36289. // Implementation of the nice number algorithm used in determining where axis labels will go
  36290. helpers.niceNum = function(range, round) {
  36291. var exponent = Math.floor(helpers.log10(range));
  36292. var fraction = range / Math.pow(10, exponent);
  36293. var niceFraction;
  36294. if (round) {
  36295. if (fraction < 1.5) {
  36296. niceFraction = 1;
  36297. } else if (fraction < 3) {
  36298. niceFraction = 2;
  36299. } else if (fraction < 7) {
  36300. niceFraction = 5;
  36301. } else {
  36302. niceFraction = 10;
  36303. }
  36304. } else if (fraction <= 1.0) {
  36305. niceFraction = 1;
  36306. } else if (fraction <= 2) {
  36307. niceFraction = 2;
  36308. } else if (fraction <= 5) {
  36309. niceFraction = 5;
  36310. } else {
  36311. niceFraction = 10;
  36312. }
  36313. return niceFraction * Math.pow(10, exponent);
  36314. };
  36315. // Easing functions adapted from Robert Penner's easing equations
  36316. // http://www.robertpenner.com/easing/
  36317. var easingEffects = helpers.easingEffects = {
  36318. linear: function(t) {
  36319. return t;
  36320. },
  36321. easeInQuad: function(t) {
  36322. return t * t;
  36323. },
  36324. easeOutQuad: function(t) {
  36325. return -1 * t * (t - 2);
  36326. },
  36327. easeInOutQuad: function(t) {
  36328. if ((t /= 1 / 2) < 1) {
  36329. return 1 / 2 * t * t;
  36330. }
  36331. return -1 / 2 * ((--t) * (t - 2) - 1);
  36332. },
  36333. easeInCubic: function(t) {
  36334. return t * t * t;
  36335. },
  36336. easeOutCubic: function(t) {
  36337. return 1 * ((t = t / 1 - 1) * t * t + 1);
  36338. },
  36339. easeInOutCubic: function(t) {
  36340. if ((t /= 1 / 2) < 1) {
  36341. return 1 / 2 * t * t * t;
  36342. }
  36343. return 1 / 2 * ((t -= 2) * t * t + 2);
  36344. },
  36345. easeInQuart: function(t) {
  36346. return t * t * t * t;
  36347. },
  36348. easeOutQuart: function(t) {
  36349. return -1 * ((t = t / 1 - 1) * t * t * t - 1);
  36350. },
  36351. easeInOutQuart: function(t) {
  36352. if ((t /= 1 / 2) < 1) {
  36353. return 1 / 2 * t * t * t * t;
  36354. }
  36355. return -1 / 2 * ((t -= 2) * t * t * t - 2);
  36356. },
  36357. easeInQuint: function(t) {
  36358. return 1 * (t /= 1) * t * t * t * t;
  36359. },
  36360. easeOutQuint: function(t) {
  36361. return 1 * ((t = t / 1 - 1) * t * t * t * t + 1);
  36362. },
  36363. easeInOutQuint: function(t) {
  36364. if ((t /= 1 / 2) < 1) {
  36365. return 1 / 2 * t * t * t * t * t;
  36366. }
  36367. return 1 / 2 * ((t -= 2) * t * t * t * t + 2);
  36368. },
  36369. easeInSine: function(t) {
  36370. return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;
  36371. },
  36372. easeOutSine: function(t) {
  36373. return 1 * Math.sin(t / 1 * (Math.PI / 2));
  36374. },
  36375. easeInOutSine: function(t) {
  36376. return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);
  36377. },
  36378. easeInExpo: function(t) {
  36379. return (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));
  36380. },
  36381. easeOutExpo: function(t) {
  36382. return (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);
  36383. },
  36384. easeInOutExpo: function(t) {
  36385. if (t === 0) {
  36386. return 0;
  36387. }
  36388. if (t === 1) {
  36389. return 1;
  36390. }
  36391. if ((t /= 1 / 2) < 1) {
  36392. return 1 / 2 * Math.pow(2, 10 * (t - 1));
  36393. }
  36394. return 1 / 2 * (-Math.pow(2, -10 * --t) + 2);
  36395. },
  36396. easeInCirc: function(t) {
  36397. if (t >= 1) {
  36398. return t;
  36399. }
  36400. return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);
  36401. },
  36402. easeOutCirc: function(t) {
  36403. return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);
  36404. },
  36405. easeInOutCirc: function(t) {
  36406. if ((t /= 1 / 2) < 1) {
  36407. return -1 / 2 * (Math.sqrt(1 - t * t) - 1);
  36408. }
  36409. return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);
  36410. },
  36411. easeInElastic: function(t) {
  36412. var s = 1.70158;
  36413. var p = 0;
  36414. var a = 1;
  36415. if (t === 0) {
  36416. return 0;
  36417. }
  36418. if ((t /= 1) === 1) {
  36419. return 1;
  36420. }
  36421. if (!p) {
  36422. p = 1 * 0.3;
  36423. }
  36424. if (a < Math.abs(1)) {
  36425. a = 1;
  36426. s = p / 4;
  36427. } else {
  36428. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36429. }
  36430. return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36431. },
  36432. easeOutElastic: function(t) {
  36433. var s = 1.70158;
  36434. var p = 0;
  36435. var a = 1;
  36436. if (t === 0) {
  36437. return 0;
  36438. }
  36439. if ((t /= 1) === 1) {
  36440. return 1;
  36441. }
  36442. if (!p) {
  36443. p = 1 * 0.3;
  36444. }
  36445. if (a < Math.abs(1)) {
  36446. a = 1;
  36447. s = p / 4;
  36448. } else {
  36449. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36450. }
  36451. return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;
  36452. },
  36453. easeInOutElastic: function(t) {
  36454. var s = 1.70158;
  36455. var p = 0;
  36456. var a = 1;
  36457. if (t === 0) {
  36458. return 0;
  36459. }
  36460. if ((t /= 1 / 2) === 2) {
  36461. return 1;
  36462. }
  36463. if (!p) {
  36464. p = 1 * (0.3 * 1.5);
  36465. }
  36466. if (a < Math.abs(1)) {
  36467. a = 1;
  36468. s = p / 4;
  36469. } else {
  36470. s = p / (2 * Math.PI) * Math.asin(1 / a);
  36471. }
  36472. if (t < 1) {
  36473. return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
  36474. }
  36475. return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;
  36476. },
  36477. easeInBack: function(t) {
  36478. var s = 1.70158;
  36479. return 1 * (t /= 1) * t * ((s + 1) * t - s);
  36480. },
  36481. easeOutBack: function(t) {
  36482. var s = 1.70158;
  36483. return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);
  36484. },
  36485. easeInOutBack: function(t) {
  36486. var s = 1.70158;
  36487. if ((t /= 1 / 2) < 1) {
  36488. return 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));
  36489. }
  36490. return 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);
  36491. },
  36492. easeInBounce: function(t) {
  36493. return 1 - easingEffects.easeOutBounce(1 - t);
  36494. },
  36495. easeOutBounce: function(t) {
  36496. if ((t /= 1) < (1 / 2.75)) {
  36497. return 1 * (7.5625 * t * t);
  36498. } else if (t < (2 / 2.75)) {
  36499. return 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);
  36500. } else if (t < (2.5 / 2.75)) {
  36501. return 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);
  36502. }
  36503. return 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);
  36504. },
  36505. easeInOutBounce: function(t) {
  36506. if (t < 1 / 2) {
  36507. return easingEffects.easeInBounce(t * 2) * 0.5;
  36508. }
  36509. return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;
  36510. }
  36511. };
  36512. // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
  36513. helpers.requestAnimFrame = (function() {
  36514. return window.requestAnimationFrame ||
  36515. window.webkitRequestAnimationFrame ||
  36516. window.mozRequestAnimationFrame ||
  36517. window.oRequestAnimationFrame ||
  36518. window.msRequestAnimationFrame ||
  36519. function(callback) {
  36520. return window.setTimeout(callback, 1000 / 60);
  36521. };
  36522. }());
  36523. // -- DOM methods
  36524. helpers.getRelativePosition = function(evt, chart) {
  36525. var mouseX, mouseY;
  36526. var e = evt.originalEvent || evt,
  36527. canvas = evt.currentTarget || evt.srcElement,
  36528. boundingRect = canvas.getBoundingClientRect();
  36529. var touches = e.touches;
  36530. if (touches && touches.length > 0) {
  36531. mouseX = touches[0].clientX;
  36532. mouseY = touches[0].clientY;
  36533. } else {
  36534. mouseX = e.clientX;
  36535. mouseY = e.clientY;
  36536. }
  36537. // Scale mouse coordinates into canvas coordinates
  36538. // by following the pattern laid out by 'jerryj' in the comments of
  36539. // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
  36540. var paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));
  36541. var paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));
  36542. var paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));
  36543. var paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));
  36544. var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;
  36545. var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;
  36546. // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However
  36547. // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here
  36548. mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);
  36549. mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);
  36550. return {
  36551. x: mouseX,
  36552. y: mouseY
  36553. };
  36554. };
  36555. helpers.addEvent = function(node, eventType, method) {
  36556. if (node.addEventListener) {
  36557. node.addEventListener(eventType, method);
  36558. } else if (node.attachEvent) {
  36559. node.attachEvent('on' + eventType, method);
  36560. } else {
  36561. node['on' + eventType] = method;
  36562. }
  36563. };
  36564. helpers.removeEvent = function(node, eventType, handler) {
  36565. if (node.removeEventListener) {
  36566. node.removeEventListener(eventType, handler, false);
  36567. } else if (node.detachEvent) {
  36568. node.detachEvent('on' + eventType, handler);
  36569. } else {
  36570. node['on' + eventType] = helpers.noop;
  36571. }
  36572. };
  36573. // Private helper function to convert max-width/max-height values that may be percentages into a number
  36574. function parseMaxStyle(styleValue, node, parentProperty) {
  36575. var valueInPixels;
  36576. if (typeof(styleValue) === 'string') {
  36577. valueInPixels = parseInt(styleValue, 10);
  36578. if (styleValue.indexOf('%') !== -1) {
  36579. // percentage * size in dimension
  36580. valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
  36581. }
  36582. } else {
  36583. valueInPixels = styleValue;
  36584. }
  36585. return valueInPixels;
  36586. }
  36587. /**
  36588. * Returns if the given value contains an effective constraint.
  36589. * @private
  36590. */
  36591. function isConstrainedValue(value) {
  36592. return value !== undefined && value !== null && value !== 'none';
  36593. }
  36594. // Private helper to get a constraint dimension
  36595. // @param domNode : the node to check the constraint on
  36596. // @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)
  36597. // @param percentageProperty : property of parent to use when calculating width as a percentage
  36598. // @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser
  36599. function getConstraintDimension(domNode, maxStyle, percentageProperty) {
  36600. var view = document.defaultView;
  36601. var parentNode = domNode.parentNode;
  36602. var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
  36603. var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
  36604. var hasCNode = isConstrainedValue(constrainedNode);
  36605. var hasCContainer = isConstrainedValue(constrainedContainer);
  36606. var infinity = Number.POSITIVE_INFINITY;
  36607. if (hasCNode || hasCContainer) {
  36608. return Math.min(
  36609. hasCNode? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,
  36610. hasCContainer? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);
  36611. }
  36612. return 'none';
  36613. }
  36614. // returns Number or undefined if no constraint
  36615. helpers.getConstraintWidth = function(domNode) {
  36616. return getConstraintDimension(domNode, 'max-width', 'clientWidth');
  36617. };
  36618. // returns Number or undefined if no constraint
  36619. helpers.getConstraintHeight = function(domNode) {
  36620. return getConstraintDimension(domNode, 'max-height', 'clientHeight');
  36621. };
  36622. helpers.getMaximumWidth = function(domNode) {
  36623. var container = domNode.parentNode;
  36624. var paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);
  36625. var paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);
  36626. var w = container.clientWidth - paddingLeft - paddingRight;
  36627. var cw = helpers.getConstraintWidth(domNode);
  36628. return isNaN(cw)? w : Math.min(w, cw);
  36629. };
  36630. helpers.getMaximumHeight = function(domNode) {
  36631. var container = domNode.parentNode;
  36632. var paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);
  36633. var paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);
  36634. var h = container.clientHeight - paddingTop - paddingBottom;
  36635. var ch = helpers.getConstraintHeight(domNode);
  36636. return isNaN(ch)? h : Math.min(h, ch);
  36637. };
  36638. helpers.getStyle = function(el, property) {
  36639. return el.currentStyle ?
  36640. el.currentStyle[property] :
  36641. document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
  36642. };
  36643. helpers.retinaScale = function(chart) {
  36644. var pixelRatio = chart.currentDevicePixelRatio = window.devicePixelRatio || 1;
  36645. if (pixelRatio === 1) {
  36646. return;
  36647. }
  36648. var canvas = chart.canvas;
  36649. var height = chart.height;
  36650. var width = chart.width;
  36651. canvas.height = height * pixelRatio;
  36652. canvas.width = width * pixelRatio;
  36653. chart.ctx.scale(pixelRatio, pixelRatio);
  36654. // If no style has been set on the canvas, the render size is used as display size,
  36655. // making the chart visually bigger, so let's enforce it to the "correct" values.
  36656. // See https://github.com/chartjs/Chart.js/issues/3575
  36657. canvas.style.height = height + 'px';
  36658. canvas.style.width = width + 'px';
  36659. };
  36660. // -- Canvas methods
  36661. helpers.clear = function(chart) {
  36662. chart.ctx.clearRect(0, 0, chart.width, chart.height);
  36663. };
  36664. helpers.fontString = function(pixelSize, fontStyle, fontFamily) {
  36665. return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
  36666. };
  36667. helpers.longestText = function(ctx, font, arrayOfThings, cache) {
  36668. cache = cache || {};
  36669. var data = cache.data = cache.data || {};
  36670. var gc = cache.garbageCollect = cache.garbageCollect || [];
  36671. if (cache.font !== font) {
  36672. data = cache.data = {};
  36673. gc = cache.garbageCollect = [];
  36674. cache.font = font;
  36675. }
  36676. ctx.font = font;
  36677. var longest = 0;
  36678. helpers.each(arrayOfThings, function(thing) {
  36679. // Undefined strings and arrays should not be measured
  36680. if (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {
  36681. longest = helpers.measureText(ctx, data, gc, longest, thing);
  36682. } else if (helpers.isArray(thing)) {
  36683. // if it is an array lets measure each element
  36684. // to do maybe simplify this function a bit so we can do this more recursively?
  36685. helpers.each(thing, function(nestedThing) {
  36686. // Undefined strings and arrays should not be measured
  36687. if (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {
  36688. longest = helpers.measureText(ctx, data, gc, longest, nestedThing);
  36689. }
  36690. });
  36691. }
  36692. });
  36693. var gcLen = gc.length / 2;
  36694. if (gcLen > arrayOfThings.length) {
  36695. for (var i = 0; i < gcLen; i++) {
  36696. delete data[gc[i]];
  36697. }
  36698. gc.splice(0, gcLen);
  36699. }
  36700. return longest;
  36701. };
  36702. helpers.measureText = function(ctx, data, gc, longest, string) {
  36703. var textWidth = data[string];
  36704. if (!textWidth) {
  36705. textWidth = data[string] = ctx.measureText(string).width;
  36706. gc.push(string);
  36707. }
  36708. if (textWidth > longest) {
  36709. longest = textWidth;
  36710. }
  36711. return longest;
  36712. };
  36713. helpers.numberOfLabelLines = function(arrayOfThings) {
  36714. var numberOfLines = 1;
  36715. helpers.each(arrayOfThings, function(thing) {
  36716. if (helpers.isArray(thing)) {
  36717. if (thing.length > numberOfLines) {
  36718. numberOfLines = thing.length;
  36719. }
  36720. }
  36721. });
  36722. return numberOfLines;
  36723. };
  36724. helpers.drawRoundedRectangle = function(ctx, x, y, width, height, radius) {
  36725. ctx.beginPath();
  36726. ctx.moveTo(x + radius, y);
  36727. ctx.lineTo(x + width - radius, y);
  36728. ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
  36729. ctx.lineTo(x + width, y + height - radius);
  36730. ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
  36731. ctx.lineTo(x + radius, y + height);
  36732. ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
  36733. ctx.lineTo(x, y + radius);
  36734. ctx.quadraticCurveTo(x, y, x + radius, y);
  36735. ctx.closePath();
  36736. };
  36737. helpers.color = function(c) {
  36738. if (!color) {
  36739. console.error('Color.js not found!');
  36740. return c;
  36741. }
  36742. /* global CanvasGradient */
  36743. if (c instanceof CanvasGradient) {
  36744. return color(Chart.defaults.global.defaultColor);
  36745. }
  36746. return color(c);
  36747. };
  36748. helpers.isArray = Array.isArray?
  36749. function(obj) {
  36750. return Array.isArray(obj);
  36751. } :
  36752. function(obj) {
  36753. return Object.prototype.toString.call(obj) === '[object Array]';
  36754. };
  36755. // ! @see http://stackoverflow.com/a/14853974
  36756. helpers.arrayEquals = function(a0, a1) {
  36757. var i, ilen, v0, v1;
  36758. if (!a0 || !a1 || a0.length !== a1.length) {
  36759. return false;
  36760. }
  36761. for (i = 0, ilen=a0.length; i < ilen; ++i) {
  36762. v0 = a0[i];
  36763. v1 = a1[i];
  36764. if (v0 instanceof Array && v1 instanceof Array) {
  36765. if (!helpers.arrayEquals(v0, v1)) {
  36766. return false;
  36767. }
  36768. } else if (v0 !== v1) {
  36769. // NOTE: two different object instances will never be equal: {x:20} != {x:20}
  36770. return false;
  36771. }
  36772. }
  36773. return true;
  36774. };
  36775. helpers.callCallback = function(fn, args, _tArg) {
  36776. if (fn && typeof fn.call === 'function') {
  36777. fn.apply(_tArg, args);
  36778. }
  36779. };
  36780. helpers.getHoverColor = function(colorValue) {
  36781. /* global CanvasPattern */
  36782. return (colorValue instanceof CanvasPattern) ?
  36783. colorValue :
  36784. helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();
  36785. };
  36786. };
  36787. /***/ }),
  36788. /* 145 */
  36789. /***/ (function(module, exports, __webpack_require__) {
  36790. "use strict";
  36791. module.exports = function(Chart) {
  36792. var helpers = Chart.helpers;
  36793. /**
  36794. * Helper function to get relative position for an event
  36795. * @param {Event|IEvent} event - The event to get the position for
  36796. * @param {Chart} chart - The chart
  36797. * @returns {Point} the event position
  36798. */
  36799. function getRelativePosition(e, chart) {
  36800. if (e.native) {
  36801. return {
  36802. x: e.x,
  36803. y: e.y
  36804. };
  36805. }
  36806. return helpers.getRelativePosition(e, chart);
  36807. }
  36808. /**
  36809. * Helper function to traverse all of the visible elements in the chart
  36810. * @param chart {chart} the chart
  36811. * @param handler {Function} the callback to execute for each visible item
  36812. */
  36813. function parseVisibleItems(chart, handler) {
  36814. var datasets = chart.data.datasets;
  36815. var meta, i, j, ilen, jlen;
  36816. for (i = 0, ilen = datasets.length; i < ilen; ++i) {
  36817. if (!chart.isDatasetVisible(i)) {
  36818. continue;
  36819. }
  36820. meta = chart.getDatasetMeta(i);
  36821. for (j = 0, jlen = meta.data.length; j < jlen; ++j) {
  36822. var element = meta.data[j];
  36823. if (!element._view.skip) {
  36824. handler(element);
  36825. }
  36826. }
  36827. }
  36828. }
  36829. /**
  36830. * Helper function to get the items that intersect the event position
  36831. * @param items {ChartElement[]} elements to filter
  36832. * @param position {Point} the point to be nearest to
  36833. * @return {ChartElement[]} the nearest items
  36834. */
  36835. function getIntersectItems(chart, position) {
  36836. var elements = [];
  36837. parseVisibleItems(chart, function(element) {
  36838. if (element.inRange(position.x, position.y)) {
  36839. elements.push(element);
  36840. }
  36841. });
  36842. return elements;
  36843. }
  36844. /**
  36845. * Helper function to get the items nearest to the event position considering all visible items in teh chart
  36846. * @param chart {Chart} the chart to look at elements from
  36847. * @param position {Point} the point to be nearest to
  36848. * @param intersect {Boolean} if true, only consider items that intersect the position
  36849. * @param distanceMetric {Function} Optional function to provide the distance between
  36850. * @return {ChartElement[]} the nearest items
  36851. */
  36852. function getNearestItems(chart, position, intersect, distanceMetric) {
  36853. var minDistance = Number.POSITIVE_INFINITY;
  36854. var nearestItems = [];
  36855. if (!distanceMetric) {
  36856. distanceMetric = helpers.distanceBetweenPoints;
  36857. }
  36858. parseVisibleItems(chart, function(element) {
  36859. if (intersect && !element.inRange(position.x, position.y)) {
  36860. return;
  36861. }
  36862. var center = element.getCenterPoint();
  36863. var distance = distanceMetric(position, center);
  36864. if (distance < minDistance) {
  36865. nearestItems = [element];
  36866. minDistance = distance;
  36867. } else if (distance === minDistance) {
  36868. // Can have multiple items at the same distance in which case we sort by size
  36869. nearestItems.push(element);
  36870. }
  36871. });
  36872. return nearestItems;
  36873. }
  36874. function indexMode(chart, e, options) {
  36875. var position = getRelativePosition(e, chart.chart);
  36876. var distanceMetric = function(pt1, pt2) {
  36877. return Math.abs(pt1.x - pt2.x);
  36878. };
  36879. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);
  36880. var elements = [];
  36881. if (!items.length) {
  36882. return [];
  36883. }
  36884. chart.data.datasets.forEach(function(dataset, datasetIndex) {
  36885. if (chart.isDatasetVisible(datasetIndex)) {
  36886. var meta = chart.getDatasetMeta(datasetIndex),
  36887. element = meta.data[items[0]._index];
  36888. // don't count items that are skipped (null data)
  36889. if (element && !element._view.skip) {
  36890. elements.push(element);
  36891. }
  36892. }
  36893. });
  36894. return elements;
  36895. }
  36896. /**
  36897. * @interface IInteractionOptions
  36898. */
  36899. /**
  36900. * If true, only consider items that intersect the point
  36901. * @name IInterfaceOptions#boolean
  36902. * @type Boolean
  36903. */
  36904. /**
  36905. * Contains interaction related functions
  36906. * @namespace Chart.Interaction
  36907. */
  36908. Chart.Interaction = {
  36909. // Helper function for different modes
  36910. modes: {
  36911. single: function(chart, e) {
  36912. var position = getRelativePosition(e, chart.chart);
  36913. var elements = [];
  36914. parseVisibleItems(chart, function(element) {
  36915. if (element.inRange(position.x, position.y)) {
  36916. elements.push(element);
  36917. return elements;
  36918. }
  36919. });
  36920. return elements.slice(0, 1);
  36921. },
  36922. /**
  36923. * @function Chart.Interaction.modes.label
  36924. * @deprecated since version 2.4.0
  36925. */
  36926. label: indexMode,
  36927. /**
  36928. * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
  36929. * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
  36930. * @function Chart.Interaction.modes.index
  36931. * @since v2.4.0
  36932. * @param chart {chart} the chart we are returning items from
  36933. * @param e {Event} the event we are find things at
  36934. * @param options {IInteractionOptions} options to use during interaction
  36935. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36936. */
  36937. index: indexMode,
  36938. /**
  36939. * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
  36940. * If the options.intersect is false, we find the nearest item and return the items in that dataset
  36941. * @function Chart.Interaction.modes.dataset
  36942. * @param chart {chart} the chart we are returning items from
  36943. * @param e {Event} the event we are find things at
  36944. * @param options {IInteractionOptions} options to use during interaction
  36945. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36946. */
  36947. dataset: function(chart, e, options) {
  36948. var position = getRelativePosition(e, chart.chart);
  36949. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false);
  36950. if (items.length > 0) {
  36951. items = chart.getDatasetMeta(items[0]._datasetIndex).data;
  36952. }
  36953. return items;
  36954. },
  36955. /**
  36956. * @function Chart.Interaction.modes.x-axis
  36957. * @deprecated since version 2.4.0. Use index mode and intersect == true
  36958. */
  36959. 'x-axis': function(chart, e) {
  36960. return indexMode(chart, e, true);
  36961. },
  36962. /**
  36963. * Point mode returns all elements that hit test based on the event position
  36964. * of the event
  36965. * @function Chart.Interaction.modes.intersect
  36966. * @param chart {chart} the chart we are returning items from
  36967. * @param e {Event} the event we are find things at
  36968. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36969. */
  36970. point: function(chart, e) {
  36971. var position = getRelativePosition(e, chart.chart);
  36972. return getIntersectItems(chart, position);
  36973. },
  36974. /**
  36975. * nearest mode returns the element closest to the point
  36976. * @function Chart.Interaction.modes.intersect
  36977. * @param chart {chart} the chart we are returning items from
  36978. * @param e {Event} the event we are find things at
  36979. * @param options {IInteractionOptions} options to use
  36980. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  36981. */
  36982. nearest: function(chart, e, options) {
  36983. var position = getRelativePosition(e, chart.chart);
  36984. var nearestItems = getNearestItems(chart, position, options.intersect);
  36985. // We have multiple items at the same distance from the event. Now sort by smallest
  36986. if (nearestItems.length > 1) {
  36987. nearestItems.sort(function(a, b) {
  36988. var sizeA = a.getArea();
  36989. var sizeB = b.getArea();
  36990. var ret = sizeA - sizeB;
  36991. if (ret === 0) {
  36992. // if equal sort by dataset index
  36993. ret = a._datasetIndex - b._datasetIndex;
  36994. }
  36995. return ret;
  36996. });
  36997. }
  36998. // Return only 1 item
  36999. return nearestItems.slice(0, 1);
  37000. },
  37001. /**
  37002. * x mode returns the elements that hit-test at the current x coordinate
  37003. * @function Chart.Interaction.modes.x
  37004. * @param chart {chart} the chart we are returning items from
  37005. * @param e {Event} the event we are find things at
  37006. * @param options {IInteractionOptions} options to use
  37007. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37008. */
  37009. x: function(chart, e, options) {
  37010. var position = getRelativePosition(e, chart.chart);
  37011. var items = [];
  37012. var intersectsItem = false;
  37013. parseVisibleItems(chart, function(element) {
  37014. if (element.inXRange(position.x)) {
  37015. items.push(element);
  37016. }
  37017. if (element.inRange(position.x, position.y)) {
  37018. intersectsItem = true;
  37019. }
  37020. });
  37021. // If we want to trigger on an intersect and we don't have any items
  37022. // that intersect the position, return nothing
  37023. if (options.intersect && !intersectsItem) {
  37024. items = [];
  37025. }
  37026. return items;
  37027. },
  37028. /**
  37029. * y mode returns the elements that hit-test at the current y coordinate
  37030. * @function Chart.Interaction.modes.y
  37031. * @param chart {chart} the chart we are returning items from
  37032. * @param e {Event} the event we are find things at
  37033. * @param options {IInteractionOptions} options to use
  37034. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  37035. */
  37036. y: function(chart, e, options) {
  37037. var position = getRelativePosition(e, chart.chart);
  37038. var items = [];
  37039. var intersectsItem = false;
  37040. parseVisibleItems(chart, function(element) {
  37041. if (element.inYRange(position.y)) {
  37042. items.push(element);
  37043. }
  37044. if (element.inRange(position.x, position.y)) {
  37045. intersectsItem = true;
  37046. }
  37047. });
  37048. // If we want to trigger on an intersect and we don't have any items
  37049. // that intersect the position, return nothing
  37050. if (options.intersect && !intersectsItem) {
  37051. items = [];
  37052. }
  37053. return items;
  37054. }
  37055. }
  37056. };
  37057. };
  37058. /***/ }),
  37059. /* 146 */
  37060. /***/ (function(module, exports, __webpack_require__) {
  37061. "use strict";
  37062. module.exports = function() {
  37063. // Occupy the global variable of Chart, and create a simple base class
  37064. var Chart = function(item, config) {
  37065. this.controller = new Chart.Controller(item, config, this);
  37066. return this.controller;
  37067. };
  37068. // Globally expose the defaults to allow for user updating/changing
  37069. Chart.defaults = {
  37070. global: {
  37071. responsive: true,
  37072. responsiveAnimationDuration: 0,
  37073. maintainAspectRatio: true,
  37074. events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],
  37075. hover: {
  37076. onHover: null,
  37077. mode: 'nearest',
  37078. intersect: true,
  37079. animationDuration: 400
  37080. },
  37081. onClick: null,
  37082. defaultColor: 'rgba(0,0,0,0.1)',
  37083. defaultFontColor: '#666',
  37084. defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  37085. defaultFontSize: 12,
  37086. defaultFontStyle: 'normal',
  37087. showLines: true,
  37088. // Element defaults defined in element extensions
  37089. elements: {},
  37090. // Legend callback string
  37091. legendCallback: function(chart) {
  37092. var text = [];
  37093. text.push('<ul class="' + chart.id + '-legend">');
  37094. for (var i = 0; i < chart.data.datasets.length; i++) {
  37095. text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '"></span>');
  37096. if (chart.data.datasets[i].label) {
  37097. text.push(chart.data.datasets[i].label);
  37098. }
  37099. text.push('</li>');
  37100. }
  37101. text.push('</ul>');
  37102. return text.join('');
  37103. }
  37104. }
  37105. };
  37106. Chart.Chart = Chart;
  37107. return Chart;
  37108. };
  37109. /***/ }),
  37110. /* 147 */
  37111. /***/ (function(module, exports, __webpack_require__) {
  37112. "use strict";
  37113. module.exports = function(Chart) {
  37114. var helpers = Chart.helpers;
  37115. // The layout service is very self explanatory. It's responsible for the layout within a chart.
  37116. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
  37117. // It is this service's responsibility of carrying out that layout.
  37118. Chart.layoutService = {
  37119. defaults: {},
  37120. // Register a box to a chartInstance. A box is simply a reference to an object that requires layout. eg. Scales, Legend, Plugins.
  37121. addBox: function(chartInstance, box) {
  37122. if (!chartInstance.boxes) {
  37123. chartInstance.boxes = [];
  37124. }
  37125. chartInstance.boxes.push(box);
  37126. },
  37127. removeBox: function(chartInstance, box) {
  37128. if (!chartInstance.boxes) {
  37129. return;
  37130. }
  37131. chartInstance.boxes.splice(chartInstance.boxes.indexOf(box), 1);
  37132. },
  37133. // The most important function
  37134. update: function(chartInstance, width, height) {
  37135. if (!chartInstance) {
  37136. return;
  37137. }
  37138. var layoutOptions = chartInstance.options.layout;
  37139. var padding = layoutOptions ? layoutOptions.padding : null;
  37140. var leftPadding = 0;
  37141. var rightPadding = 0;
  37142. var topPadding = 0;
  37143. var bottomPadding = 0;
  37144. if (!isNaN(padding)) {
  37145. // options.layout.padding is a number. assign to all
  37146. leftPadding = padding;
  37147. rightPadding = padding;
  37148. topPadding = padding;
  37149. bottomPadding = padding;
  37150. } else {
  37151. leftPadding = padding.left || 0;
  37152. rightPadding = padding.right || 0;
  37153. topPadding = padding.top || 0;
  37154. bottomPadding = padding.bottom || 0;
  37155. }
  37156. var leftBoxes = helpers.where(chartInstance.boxes, function(box) {
  37157. return box.options.position === 'left';
  37158. });
  37159. var rightBoxes = helpers.where(chartInstance.boxes, function(box) {
  37160. return box.options.position === 'right';
  37161. });
  37162. var topBoxes = helpers.where(chartInstance.boxes, function(box) {
  37163. return box.options.position === 'top';
  37164. });
  37165. var bottomBoxes = helpers.where(chartInstance.boxes, function(box) {
  37166. return box.options.position === 'bottom';
  37167. });
  37168. // Boxes that overlay the chartarea such as the radialLinear scale
  37169. var chartAreaBoxes = helpers.where(chartInstance.boxes, function(box) {
  37170. return box.options.position === 'chartArea';
  37171. });
  37172. // Ensure that full width boxes are at the very top / bottom
  37173. topBoxes.sort(function(a, b) {
  37174. return (b.options.fullWidth ? 1 : 0) - (a.options.fullWidth ? 1 : 0);
  37175. });
  37176. bottomBoxes.sort(function(a, b) {
  37177. return (a.options.fullWidth ? 1 : 0) - (b.options.fullWidth ? 1 : 0);
  37178. });
  37179. // Essentially we now have any number of boxes on each of the 4 sides.
  37180. // Our canvas looks like the following.
  37181. // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
  37182. // B1 is the bottom axis
  37183. // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
  37184. // These locations are single-box locations only, when trying to register a chartArea location that is already taken,
  37185. // an error will be thrown.
  37186. //
  37187. // |----------------------------------------------------|
  37188. // | T1 (Full Width) |
  37189. // |----------------------------------------------------|
  37190. // | | | T2 | |
  37191. // | |----|-------------------------------------|----|
  37192. // | | | C1 | | C2 | |
  37193. // | | |----| |----| |
  37194. // | | | | |
  37195. // | L1 | L2 | ChartArea (C0) | R1 |
  37196. // | | | | |
  37197. // | | |----| |----| |
  37198. // | | | C3 | | C4 | |
  37199. // | |----|-------------------------------------|----|
  37200. // | | | B1 | |
  37201. // |----------------------------------------------------|
  37202. // | B2 (Full Width) |
  37203. // |----------------------------------------------------|
  37204. //
  37205. // What we do to find the best sizing, we do the following
  37206. // 1. Determine the minimum size of the chart area.
  37207. // 2. Split the remaining width equally between each vertical axis
  37208. // 3. Split the remaining height equally between each horizontal axis
  37209. // 4. Give each layout the maximum size it can be. The layout will return it's minimum size
  37210. // 5. Adjust the sizes of each axis based on it's minimum reported size.
  37211. // 6. Refit each axis
  37212. // 7. Position each axis in the final location
  37213. // 8. Tell the chart the final location of the chart area
  37214. // 9. Tell any axes that overlay the chart area the positions of the chart area
  37215. // Step 1
  37216. var chartWidth = width - leftPadding - rightPadding;
  37217. var chartHeight = height - topPadding - bottomPadding;
  37218. var chartAreaWidth = chartWidth / 2; // min 50%
  37219. var chartAreaHeight = chartHeight / 2; // min 50%
  37220. // Step 2
  37221. var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);
  37222. // Step 3
  37223. var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);
  37224. // Step 4
  37225. var maxChartAreaWidth = chartWidth;
  37226. var maxChartAreaHeight = chartHeight;
  37227. var minBoxSizes = [];
  37228. function getMinimumBoxSize(box) {
  37229. var minSize;
  37230. var isHorizontal = box.isHorizontal();
  37231. if (isHorizontal) {
  37232. minSize = box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);
  37233. maxChartAreaHeight -= minSize.height;
  37234. } else {
  37235. minSize = box.update(verticalBoxWidth, chartAreaHeight);
  37236. maxChartAreaWidth -= minSize.width;
  37237. }
  37238. minBoxSizes.push({
  37239. horizontal: isHorizontal,
  37240. minSize: minSize,
  37241. box: box,
  37242. });
  37243. }
  37244. helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);
  37245. // If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)
  37246. var maxHorizontalLeftPadding = 0;
  37247. var maxHorizontalRightPadding = 0;
  37248. var maxVerticalTopPadding = 0;
  37249. var maxVerticalBottomPadding = 0;
  37250. helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {
  37251. if (horizontalBox.getPadding) {
  37252. var boxPadding = horizontalBox.getPadding();
  37253. maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);
  37254. maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);
  37255. }
  37256. });
  37257. helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {
  37258. if (verticalBox.getPadding) {
  37259. var boxPadding = verticalBox.getPadding();
  37260. maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);
  37261. maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);
  37262. }
  37263. });
  37264. // At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could
  37265. // be if the axes are drawn at their minimum sizes.
  37266. // Steps 5 & 6
  37267. var totalLeftBoxesWidth = leftPadding;
  37268. var totalRightBoxesWidth = rightPadding;
  37269. var totalTopBoxesHeight = topPadding;
  37270. var totalBottomBoxesHeight = bottomPadding;
  37271. // Function to fit a box
  37272. function fitBox(box) {
  37273. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {
  37274. return minBox.box === box;
  37275. });
  37276. if (minBoxSize) {
  37277. if (box.isHorizontal()) {
  37278. var scaleMargin = {
  37279. left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),
  37280. right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),
  37281. top: 0,
  37282. bottom: 0
  37283. };
  37284. // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
  37285. // on the margin. Sometimes they need to increase in size slightly
  37286. box.update(box.options.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
  37287. } else {
  37288. box.update(minBoxSize.minSize.width, maxChartAreaHeight);
  37289. }
  37290. }
  37291. }
  37292. // Update, and calculate the left and right margins for the horizontal boxes
  37293. helpers.each(leftBoxes.concat(rightBoxes), fitBox);
  37294. helpers.each(leftBoxes, function(box) {
  37295. totalLeftBoxesWidth += box.width;
  37296. });
  37297. helpers.each(rightBoxes, function(box) {
  37298. totalRightBoxesWidth += box.width;
  37299. });
  37300. // Set the Left and Right margins for the horizontal boxes
  37301. helpers.each(topBoxes.concat(bottomBoxes), fitBox);
  37302. // Figure out how much margin is on the top and bottom of the vertical boxes
  37303. helpers.each(topBoxes, function(box) {
  37304. totalTopBoxesHeight += box.height;
  37305. });
  37306. helpers.each(bottomBoxes, function(box) {
  37307. totalBottomBoxesHeight += box.height;
  37308. });
  37309. function finalFitVerticalBox(box) {
  37310. var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {
  37311. return minSize.box === box;
  37312. });
  37313. var scaleMargin = {
  37314. left: 0,
  37315. right: 0,
  37316. top: totalTopBoxesHeight,
  37317. bottom: totalBottomBoxesHeight
  37318. };
  37319. if (minBoxSize) {
  37320. box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);
  37321. }
  37322. }
  37323. // Let the left layout know the final margin
  37324. helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);
  37325. // Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)
  37326. totalLeftBoxesWidth = leftPadding;
  37327. totalRightBoxesWidth = rightPadding;
  37328. totalTopBoxesHeight = topPadding;
  37329. totalBottomBoxesHeight = bottomPadding;
  37330. helpers.each(leftBoxes, function(box) {
  37331. totalLeftBoxesWidth += box.width;
  37332. });
  37333. helpers.each(rightBoxes, function(box) {
  37334. totalRightBoxesWidth += box.width;
  37335. });
  37336. helpers.each(topBoxes, function(box) {
  37337. totalTopBoxesHeight += box.height;
  37338. });
  37339. helpers.each(bottomBoxes, function(box) {
  37340. totalBottomBoxesHeight += box.height;
  37341. });
  37342. // We may be adding some padding to account for rotated x axis labels
  37343. var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);
  37344. totalLeftBoxesWidth += leftPaddingAddition;
  37345. totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);
  37346. var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);
  37347. totalTopBoxesHeight += topPaddingAddition;
  37348. totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);
  37349. // Figure out if our chart area changed. This would occur if the dataset layout label rotation
  37350. // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do
  37351. // without calling `fit` again
  37352. var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;
  37353. var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;
  37354. if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {
  37355. helpers.each(leftBoxes, function(box) {
  37356. box.height = newMaxChartAreaHeight;
  37357. });
  37358. helpers.each(rightBoxes, function(box) {
  37359. box.height = newMaxChartAreaHeight;
  37360. });
  37361. helpers.each(topBoxes, function(box) {
  37362. if (!box.options.fullWidth) {
  37363. box.width = newMaxChartAreaWidth;
  37364. }
  37365. });
  37366. helpers.each(bottomBoxes, function(box) {
  37367. if (!box.options.fullWidth) {
  37368. box.width = newMaxChartAreaWidth;
  37369. }
  37370. });
  37371. maxChartAreaHeight = newMaxChartAreaHeight;
  37372. maxChartAreaWidth = newMaxChartAreaWidth;
  37373. }
  37374. // Step 7 - Position the boxes
  37375. var left = leftPadding + leftPaddingAddition;
  37376. var top = topPadding + topPaddingAddition;
  37377. function placeBox(box) {
  37378. if (box.isHorizontal()) {
  37379. box.left = box.options.fullWidth ? leftPadding : totalLeftBoxesWidth;
  37380. box.right = box.options.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;
  37381. box.top = top;
  37382. box.bottom = top + box.height;
  37383. // Move to next point
  37384. top = box.bottom;
  37385. } else {
  37386. box.left = left;
  37387. box.right = left + box.width;
  37388. box.top = totalTopBoxesHeight;
  37389. box.bottom = totalTopBoxesHeight + maxChartAreaHeight;
  37390. // Move to next point
  37391. left = box.right;
  37392. }
  37393. }
  37394. helpers.each(leftBoxes.concat(topBoxes), placeBox);
  37395. // Account for chart width and height
  37396. left += maxChartAreaWidth;
  37397. top += maxChartAreaHeight;
  37398. helpers.each(rightBoxes, placeBox);
  37399. helpers.each(bottomBoxes, placeBox);
  37400. // Step 8
  37401. chartInstance.chartArea = {
  37402. left: totalLeftBoxesWidth,
  37403. top: totalTopBoxesHeight,
  37404. right: totalLeftBoxesWidth + maxChartAreaWidth,
  37405. bottom: totalTopBoxesHeight + maxChartAreaHeight
  37406. };
  37407. // Step 9
  37408. helpers.each(chartAreaBoxes, function(box) {
  37409. box.left = chartInstance.chartArea.left;
  37410. box.top = chartInstance.chartArea.top;
  37411. box.right = chartInstance.chartArea.right;
  37412. box.bottom = chartInstance.chartArea.bottom;
  37413. box.update(maxChartAreaWidth, maxChartAreaHeight);
  37414. });
  37415. }
  37416. };
  37417. };
  37418. /***/ }),
  37419. /* 148 */
  37420. /***/ (function(module, exports, __webpack_require__) {
  37421. "use strict";
  37422. module.exports = function(Chart) {
  37423. var helpers = Chart.helpers;
  37424. var noop = helpers.noop;
  37425. Chart.defaults.global.legend = {
  37426. display: true,
  37427. position: 'top',
  37428. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  37429. reverse: false,
  37430. // a callback that will handle
  37431. onClick: function(e, legendItem) {
  37432. var index = legendItem.datasetIndex;
  37433. var ci = this.chart;
  37434. var meta = ci.getDatasetMeta(index);
  37435. // See controller.isDatasetVisible comment
  37436. meta.hidden = meta.hidden === null? !ci.data.datasets[index].hidden : null;
  37437. // We hid a dataset ... rerender the chart
  37438. ci.update();
  37439. },
  37440. onHover: null,
  37441. labels: {
  37442. boxWidth: 40,
  37443. padding: 10,
  37444. // Generates labels shown in the legend
  37445. // Valid properties to return:
  37446. // text : text to display
  37447. // fillStyle : fill of coloured box
  37448. // strokeStyle: stroke of coloured box
  37449. // hidden : if this legend item refers to a hidden item
  37450. // lineCap : cap style for line
  37451. // lineDash
  37452. // lineDashOffset :
  37453. // lineJoin :
  37454. // lineWidth :
  37455. generateLabels: function(chart) {
  37456. var data = chart.data;
  37457. return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {
  37458. return {
  37459. text: dataset.label,
  37460. fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),
  37461. hidden: !chart.isDatasetVisible(i),
  37462. lineCap: dataset.borderCapStyle,
  37463. lineDash: dataset.borderDash,
  37464. lineDashOffset: dataset.borderDashOffset,
  37465. lineJoin: dataset.borderJoinStyle,
  37466. lineWidth: dataset.borderWidth,
  37467. strokeStyle: dataset.borderColor,
  37468. pointStyle: dataset.pointStyle,
  37469. // Below is extra data used for toggling the datasets
  37470. datasetIndex: i
  37471. };
  37472. }, this) : [];
  37473. }
  37474. }
  37475. };
  37476. /**
  37477. * Helper function to get the box width based on the usePointStyle option
  37478. * @param labelopts {Object} the label options on the legend
  37479. * @param fontSize {Number} the label font size
  37480. * @return {Number} width of the color box area
  37481. */
  37482. function getBoxWidth(labelOpts, fontSize) {
  37483. return labelOpts.usePointStyle ?
  37484. fontSize * Math.SQRT2 :
  37485. labelOpts.boxWidth;
  37486. }
  37487. Chart.Legend = Chart.Element.extend({
  37488. initialize: function(config) {
  37489. helpers.extend(this, config);
  37490. // Contains hit boxes for each dataset (in dataset order)
  37491. this.legendHitBoxes = [];
  37492. // Are we in doughnut mode which has a different data type
  37493. this.doughnutMode = false;
  37494. },
  37495. // These methods are ordered by lifecycle. Utilities then follow.
  37496. // Any function defined here is inherited by all legend types.
  37497. // Any function can be extended by the legend type
  37498. beforeUpdate: noop,
  37499. update: function(maxWidth, maxHeight, margins) {
  37500. var me = this;
  37501. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  37502. me.beforeUpdate();
  37503. // Absorb the master measurements
  37504. me.maxWidth = maxWidth;
  37505. me.maxHeight = maxHeight;
  37506. me.margins = margins;
  37507. // Dimensions
  37508. me.beforeSetDimensions();
  37509. me.setDimensions();
  37510. me.afterSetDimensions();
  37511. // Labels
  37512. me.beforeBuildLabels();
  37513. me.buildLabels();
  37514. me.afterBuildLabels();
  37515. // Fit
  37516. me.beforeFit();
  37517. me.fit();
  37518. me.afterFit();
  37519. //
  37520. me.afterUpdate();
  37521. return me.minSize;
  37522. },
  37523. afterUpdate: noop,
  37524. //
  37525. beforeSetDimensions: noop,
  37526. setDimensions: function() {
  37527. var me = this;
  37528. // Set the unconstrained dimension before label rotation
  37529. if (me.isHorizontal()) {
  37530. // Reset position before calculating rotation
  37531. me.width = me.maxWidth;
  37532. me.left = 0;
  37533. me.right = me.width;
  37534. } else {
  37535. me.height = me.maxHeight;
  37536. // Reset position before calculating rotation
  37537. me.top = 0;
  37538. me.bottom = me.height;
  37539. }
  37540. // Reset padding
  37541. me.paddingLeft = 0;
  37542. me.paddingTop = 0;
  37543. me.paddingRight = 0;
  37544. me.paddingBottom = 0;
  37545. // Reset minSize
  37546. me.minSize = {
  37547. width: 0,
  37548. height: 0
  37549. };
  37550. },
  37551. afterSetDimensions: noop,
  37552. //
  37553. beforeBuildLabels: noop,
  37554. buildLabels: function() {
  37555. var me = this;
  37556. var labelOpts = me.options.labels;
  37557. var legendItems = labelOpts.generateLabels.call(me, me.chart);
  37558. if (labelOpts.filter) {
  37559. legendItems = legendItems.filter(function(item) {
  37560. return labelOpts.filter(item, me.chart.data);
  37561. });
  37562. }
  37563. if (me.options.reverse) {
  37564. legendItems.reverse();
  37565. }
  37566. me.legendItems = legendItems;
  37567. },
  37568. afterBuildLabels: noop,
  37569. //
  37570. beforeFit: noop,
  37571. fit: function() {
  37572. var me = this;
  37573. var opts = me.options;
  37574. var labelOpts = opts.labels;
  37575. var display = opts.display;
  37576. var ctx = me.ctx;
  37577. var globalDefault = Chart.defaults.global,
  37578. itemOrDefault = helpers.getValueOrDefault,
  37579. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37580. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37581. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37582. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37583. // Reset hit boxes
  37584. var hitboxes = me.legendHitBoxes = [];
  37585. var minSize = me.minSize;
  37586. var isHorizontal = me.isHorizontal();
  37587. if (isHorizontal) {
  37588. minSize.width = me.maxWidth; // fill all the width
  37589. minSize.height = display ? 10 : 0;
  37590. } else {
  37591. minSize.width = display ? 10 : 0;
  37592. minSize.height = me.maxHeight; // fill all the height
  37593. }
  37594. // Increase sizes here
  37595. if (display) {
  37596. ctx.font = labelFont;
  37597. if (isHorizontal) {
  37598. // Labels
  37599. // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one
  37600. var lineWidths = me.lineWidths = [0];
  37601. var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;
  37602. ctx.textAlign = 'left';
  37603. ctx.textBaseline = 'top';
  37604. helpers.each(me.legendItems, function(legendItem, i) {
  37605. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37606. var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37607. if (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {
  37608. totalHeight += fontSize + (labelOpts.padding);
  37609. lineWidths[lineWidths.length] = me.left;
  37610. }
  37611. // Store the hitbox width and height here. Final position will be updated in `draw`
  37612. hitboxes[i] = {
  37613. left: 0,
  37614. top: 0,
  37615. width: width,
  37616. height: fontSize
  37617. };
  37618. lineWidths[lineWidths.length - 1] += width + labelOpts.padding;
  37619. });
  37620. minSize.height += totalHeight;
  37621. } else {
  37622. var vPadding = labelOpts.padding;
  37623. var columnWidths = me.columnWidths = [];
  37624. var totalWidth = labelOpts.padding;
  37625. var currentColWidth = 0;
  37626. var currentColHeight = 0;
  37627. var itemHeight = fontSize + vPadding;
  37628. helpers.each(me.legendItems, function(legendItem, i) {
  37629. var boxWidth = getBoxWidth(labelOpts, fontSize);
  37630. var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  37631. // If too tall, go to new column
  37632. if (currentColHeight + itemHeight > minSize.height) {
  37633. totalWidth += currentColWidth + labelOpts.padding;
  37634. columnWidths.push(currentColWidth); // previous column width
  37635. currentColWidth = 0;
  37636. currentColHeight = 0;
  37637. }
  37638. // Get max width
  37639. currentColWidth = Math.max(currentColWidth, itemWidth);
  37640. currentColHeight += itemHeight;
  37641. // Store the hitbox width and height here. Final position will be updated in `draw`
  37642. hitboxes[i] = {
  37643. left: 0,
  37644. top: 0,
  37645. width: itemWidth,
  37646. height: fontSize
  37647. };
  37648. });
  37649. totalWidth += currentColWidth;
  37650. columnWidths.push(currentColWidth);
  37651. minSize.width += totalWidth;
  37652. }
  37653. }
  37654. me.width = minSize.width;
  37655. me.height = minSize.height;
  37656. },
  37657. afterFit: noop,
  37658. // Shared Methods
  37659. isHorizontal: function() {
  37660. return this.options.position === 'top' || this.options.position === 'bottom';
  37661. },
  37662. // Actually draw the legend on the canvas
  37663. draw: function() {
  37664. var me = this;
  37665. var opts = me.options;
  37666. var labelOpts = opts.labels;
  37667. var globalDefault = Chart.defaults.global,
  37668. lineDefault = globalDefault.elements.line,
  37669. legendWidth = me.width,
  37670. lineWidths = me.lineWidths;
  37671. if (opts.display) {
  37672. var ctx = me.ctx,
  37673. cursor,
  37674. itemOrDefault = helpers.getValueOrDefault,
  37675. fontColor = itemOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor),
  37676. fontSize = itemOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize),
  37677. fontStyle = itemOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle),
  37678. fontFamily = itemOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily),
  37679. labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);
  37680. // Canvas setup
  37681. ctx.textAlign = 'left';
  37682. ctx.textBaseline = 'top';
  37683. ctx.lineWidth = 0.5;
  37684. ctx.strokeStyle = fontColor; // for strikethrough effect
  37685. ctx.fillStyle = fontColor; // render in correct colour
  37686. ctx.font = labelFont;
  37687. var boxWidth = getBoxWidth(labelOpts, fontSize),
  37688. hitboxes = me.legendHitBoxes;
  37689. // current position
  37690. var drawLegendBox = function(x, y, legendItem) {
  37691. if (isNaN(boxWidth) || boxWidth <= 0) {
  37692. return;
  37693. }
  37694. // Set the ctx for the box
  37695. ctx.save();
  37696. ctx.fillStyle = itemOrDefault(legendItem.fillStyle, globalDefault.defaultColor);
  37697. ctx.lineCap = itemOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);
  37698. ctx.lineDashOffset = itemOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);
  37699. ctx.lineJoin = itemOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);
  37700. ctx.lineWidth = itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth);
  37701. ctx.strokeStyle = itemOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);
  37702. var isLineWidthZero = (itemOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);
  37703. if (ctx.setLineDash) {
  37704. // IE 9 and 10 do not support line dash
  37705. ctx.setLineDash(itemOrDefault(legendItem.lineDash, lineDefault.borderDash));
  37706. }
  37707. if (opts.labels && opts.labels.usePointStyle) {
  37708. // Recalculate x and y for drawPoint() because its expecting
  37709. // x and y to be center of figure (instead of top left)
  37710. var radius = fontSize * Math.SQRT2 / 2;
  37711. var offSet = radius / Math.SQRT2;
  37712. var centerX = x + offSet;
  37713. var centerY = y + offSet;
  37714. // Draw pointStyle as legend symbol
  37715. Chart.canvasHelpers.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);
  37716. } else {
  37717. // Draw box as legend symbol
  37718. if (!isLineWidthZero) {
  37719. ctx.strokeRect(x, y, boxWidth, fontSize);
  37720. }
  37721. ctx.fillRect(x, y, boxWidth, fontSize);
  37722. }
  37723. ctx.restore();
  37724. };
  37725. var fillText = function(x, y, legendItem, textWidth) {
  37726. ctx.fillText(legendItem.text, boxWidth + (fontSize / 2) + x, y);
  37727. if (legendItem.hidden) {
  37728. // Strikethrough the text if hidden
  37729. ctx.beginPath();
  37730. ctx.lineWidth = 2;
  37731. ctx.moveTo(boxWidth + (fontSize / 2) + x, y + (fontSize / 2));
  37732. ctx.lineTo(boxWidth + (fontSize / 2) + x + textWidth, y + (fontSize / 2));
  37733. ctx.stroke();
  37734. }
  37735. };
  37736. // Horizontal
  37737. var isHorizontal = me.isHorizontal();
  37738. if (isHorizontal) {
  37739. cursor = {
  37740. x: me.left + ((legendWidth - lineWidths[0]) / 2),
  37741. y: me.top + labelOpts.padding,
  37742. line: 0
  37743. };
  37744. } else {
  37745. cursor = {
  37746. x: me.left + labelOpts.padding,
  37747. y: me.top + labelOpts.padding,
  37748. line: 0
  37749. };
  37750. }
  37751. var itemHeight = fontSize + labelOpts.padding;
  37752. helpers.each(me.legendItems, function(legendItem, i) {
  37753. var textWidth = ctx.measureText(legendItem.text).width,
  37754. width = boxWidth + (fontSize / 2) + textWidth,
  37755. x = cursor.x,
  37756. y = cursor.y;
  37757. if (isHorizontal) {
  37758. if (x + width >= legendWidth) {
  37759. y = cursor.y += itemHeight;
  37760. cursor.line++;
  37761. x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);
  37762. }
  37763. } else if (y + itemHeight > me.bottom) {
  37764. x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;
  37765. y = cursor.y = me.top + labelOpts.padding;
  37766. cursor.line++;
  37767. }
  37768. drawLegendBox(x, y, legendItem);
  37769. hitboxes[i].left = x;
  37770. hitboxes[i].top = y;
  37771. // Fill the actual label
  37772. fillText(x, y, legendItem, textWidth);
  37773. if (isHorizontal) {
  37774. cursor.x += width + (labelOpts.padding);
  37775. } else {
  37776. cursor.y += itemHeight;
  37777. }
  37778. });
  37779. }
  37780. },
  37781. /**
  37782. * Handle an event
  37783. * @private
  37784. * @param {IEvent} event - The event to handle
  37785. * @return {Boolean} true if a change occured
  37786. */
  37787. handleEvent: function(e) {
  37788. var me = this;
  37789. var opts = me.options;
  37790. var type = e.type === 'mouseup' ? 'click' : e.type;
  37791. var changed = false;
  37792. if (type === 'mousemove') {
  37793. if (!opts.onHover) {
  37794. return;
  37795. }
  37796. } else if (type === 'click') {
  37797. if (!opts.onClick) {
  37798. return;
  37799. }
  37800. } else {
  37801. return;
  37802. }
  37803. // Chart event already has relative position in it
  37804. var x = e.x,
  37805. y = e.y;
  37806. if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {
  37807. // See if we are touching one of the dataset boxes
  37808. var lh = me.legendHitBoxes;
  37809. for (var i = 0; i < lh.length; ++i) {
  37810. var hitBox = lh[i];
  37811. if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {
  37812. // Touching an element
  37813. if (type === 'click') {
  37814. // use e.native for backwards compatibility
  37815. opts.onClick.call(me, e.native, me.legendItems[i]);
  37816. changed = true;
  37817. break;
  37818. } else if (type === 'mousemove') {
  37819. // use e.native for backwards compatibility
  37820. opts.onHover.call(me, e.native, me.legendItems[i]);
  37821. changed = true;
  37822. break;
  37823. }
  37824. }
  37825. }
  37826. }
  37827. return changed;
  37828. }
  37829. });
  37830. function createNewLegendAndAttach(chartInstance, legendOpts) {
  37831. var legend = new Chart.Legend({
  37832. ctx: chartInstance.chart.ctx,
  37833. options: legendOpts,
  37834. chart: chartInstance
  37835. });
  37836. chartInstance.legend = legend;
  37837. Chart.layoutService.addBox(chartInstance, legend);
  37838. }
  37839. // Register the legend plugin
  37840. Chart.plugins.register({
  37841. beforeInit: function(chartInstance) {
  37842. var legendOpts = chartInstance.options.legend;
  37843. if (legendOpts) {
  37844. createNewLegendAndAttach(chartInstance, legendOpts);
  37845. }
  37846. },
  37847. beforeUpdate: function(chartInstance) {
  37848. var legendOpts = chartInstance.options.legend;
  37849. if (legendOpts) {
  37850. legendOpts = helpers.configMerge(Chart.defaults.global.legend, legendOpts);
  37851. if (chartInstance.legend) {
  37852. chartInstance.legend.options = legendOpts;
  37853. } else {
  37854. createNewLegendAndAttach(chartInstance, legendOpts);
  37855. }
  37856. } else {
  37857. Chart.layoutService.removeBox(chartInstance, chartInstance.legend);
  37858. delete chartInstance.legend;
  37859. }
  37860. },
  37861. afterEvent: function(chartInstance, e) {
  37862. var legend = chartInstance.legend;
  37863. if (legend) {
  37864. legend.handleEvent(e);
  37865. }
  37866. }
  37867. });
  37868. };
  37869. /***/ }),
  37870. /* 149 */
  37871. /***/ (function(module, exports, __webpack_require__) {
  37872. "use strict";
  37873. module.exports = function(Chart) {
  37874. var helpers = Chart.helpers;
  37875. Chart.defaults.global.plugins = {};
  37876. /**
  37877. * The plugin service singleton
  37878. * @namespace Chart.plugins
  37879. * @since 2.1.0
  37880. */
  37881. Chart.plugins = {
  37882. /**
  37883. * Globally registered plugins.
  37884. * @private
  37885. */
  37886. _plugins: [],
  37887. /**
  37888. * This identifier is used to invalidate the descriptors cache attached to each chart
  37889. * when a global plugin is registered or unregistered. In this case, the cache ID is
  37890. * incremented and descriptors are regenerated during following API calls.
  37891. * @private
  37892. */
  37893. _cacheId: 0,
  37894. /**
  37895. * Registers the given plugin(s) if not already registered.
  37896. * @param {Array|Object} plugins plugin instance(s).
  37897. */
  37898. register: function(plugins) {
  37899. var p = this._plugins;
  37900. ([]).concat(plugins).forEach(function(plugin) {
  37901. if (p.indexOf(plugin) === -1) {
  37902. p.push(plugin);
  37903. }
  37904. });
  37905. this._cacheId++;
  37906. },
  37907. /**
  37908. * Unregisters the given plugin(s) only if registered.
  37909. * @param {Array|Object} plugins plugin instance(s).
  37910. */
  37911. unregister: function(plugins) {
  37912. var p = this._plugins;
  37913. ([]).concat(plugins).forEach(function(plugin) {
  37914. var idx = p.indexOf(plugin);
  37915. if (idx !== -1) {
  37916. p.splice(idx, 1);
  37917. }
  37918. });
  37919. this._cacheId++;
  37920. },
  37921. /**
  37922. * Remove all registered plugins.
  37923. * @since 2.1.5
  37924. */
  37925. clear: function() {
  37926. this._plugins = [];
  37927. this._cacheId++;
  37928. },
  37929. /**
  37930. * Returns the number of registered plugins?
  37931. * @returns {Number}
  37932. * @since 2.1.5
  37933. */
  37934. count: function() {
  37935. return this._plugins.length;
  37936. },
  37937. /**
  37938. * Returns all registered plugin instances.
  37939. * @returns {Array} array of plugin objects.
  37940. * @since 2.1.5
  37941. */
  37942. getAll: function() {
  37943. return this._plugins;
  37944. },
  37945. /**
  37946. * Calls enabled plugins for `chart` on the specified hook and with the given args.
  37947. * This method immediately returns as soon as a plugin explicitly returns false. The
  37948. * returned value can be used, for instance, to interrupt the current action.
  37949. * @param {Object} chart - The chart instance for which plugins should be called.
  37950. * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
  37951. * @param {Array} [args] - Extra arguments to apply to the hook call.
  37952. * @returns {Boolean} false if any of the plugins return false, else returns true.
  37953. */
  37954. notify: function(chart, hook, args) {
  37955. var descriptors = this.descriptors(chart);
  37956. var ilen = descriptors.length;
  37957. var i, descriptor, plugin, params, method;
  37958. for (i=0; i<ilen; ++i) {
  37959. descriptor = descriptors[i];
  37960. plugin = descriptor.plugin;
  37961. method = plugin[hook];
  37962. if (typeof method === 'function') {
  37963. params = [chart].concat(args || []);
  37964. params.push(descriptor.options);
  37965. if (method.apply(plugin, params) === false) {
  37966. return false;
  37967. }
  37968. }
  37969. }
  37970. return true;
  37971. },
  37972. /**
  37973. * Returns descriptors of enabled plugins for the given chart.
  37974. * @returns {Array} [{ plugin, options }]
  37975. * @private
  37976. */
  37977. descriptors: function(chart) {
  37978. var cache = chart._plugins || (chart._plugins = {});
  37979. if (cache.id === this._cacheId) {
  37980. return cache.descriptors;
  37981. }
  37982. var plugins = [];
  37983. var descriptors = [];
  37984. var config = (chart && chart.config) || {};
  37985. var defaults = Chart.defaults.global.plugins;
  37986. var options = (config.options && config.options.plugins) || {};
  37987. this._plugins.concat(config.plugins || []).forEach(function(plugin) {
  37988. var idx = plugins.indexOf(plugin);
  37989. if (idx !== -1) {
  37990. return;
  37991. }
  37992. var id = plugin.id;
  37993. var opts = options[id];
  37994. if (opts === false) {
  37995. return;
  37996. }
  37997. if (opts === true) {
  37998. opts = helpers.clone(defaults[id]);
  37999. }
  38000. plugins.push(plugin);
  38001. descriptors.push({
  38002. plugin: plugin,
  38003. options: opts || {}
  38004. });
  38005. });
  38006. cache.descriptors = descriptors;
  38007. cache.id = this._cacheId;
  38008. return descriptors;
  38009. }
  38010. };
  38011. /**
  38012. * Plugin extension hooks.
  38013. * @interface IPlugin
  38014. * @since 2.1.0
  38015. */
  38016. /**
  38017. * @method IPlugin#beforeInit
  38018. * @desc Called before initializing `chart`.
  38019. * @param {Chart.Controller} chart - The chart instance.
  38020. * @param {Object} options - The plugin options.
  38021. */
  38022. /**
  38023. * @method IPlugin#afterInit
  38024. * @desc Called after `chart` has been initialized and before the first update.
  38025. * @param {Chart.Controller} chart - The chart instance.
  38026. * @param {Object} options - The plugin options.
  38027. */
  38028. /**
  38029. * @method IPlugin#beforeUpdate
  38030. * @desc Called before updating `chart`. If any plugin returns `false`, the update
  38031. * is cancelled (and thus subsequent render(s)) until another `update` is triggered.
  38032. * @param {Chart.Controller} chart - The chart instance.
  38033. * @param {Object} options - The plugin options.
  38034. * @returns {Boolean} `false` to cancel the chart update.
  38035. */
  38036. /**
  38037. * @method IPlugin#afterUpdate
  38038. * @desc Called after `chart` has been updated and before rendering. Note that this
  38039. * hook will not be called if the chart update has been previously cancelled.
  38040. * @param {Chart.Controller} chart - The chart instance.
  38041. * @param {Object} options - The plugin options.
  38042. */
  38043. /**
  38044. * @method IPlugin#beforeDatasetsUpdate
  38045. * @desc Called before updating the `chart` datasets. If any plugin returns `false`,
  38046. * the datasets update is cancelled until another `update` is triggered.
  38047. * @param {Chart.Controller} chart - The chart instance.
  38048. * @param {Object} options - The plugin options.
  38049. * @returns {Boolean} false to cancel the datasets update.
  38050. * @since version 2.1.5
  38051. */
  38052. /**
  38053. * @method IPlugin#afterDatasetsUpdate
  38054. * @desc Called after the `chart` datasets have been updated. Note that this hook
  38055. * will not be called if the datasets update has been previously cancelled.
  38056. * @param {Chart.Controller} chart - The chart instance.
  38057. * @param {Object} options - The plugin options.
  38058. * @since version 2.1.5
  38059. */
  38060. /**
  38061. * @method IPlugin#beforeLayout
  38062. * @desc Called before laying out `chart`. If any plugin returns `false`,
  38063. * the layout update is cancelled until another `update` is triggered.
  38064. * @param {Chart.Controller} chart - The chart instance.
  38065. * @param {Object} options - The plugin options.
  38066. * @returns {Boolean} `false` to cancel the chart layout.
  38067. */
  38068. /**
  38069. * @method IPlugin#afterLayout
  38070. * @desc Called after the `chart` has been layed out. Note that this hook will not
  38071. * be called if the layout update has been previously cancelled.
  38072. * @param {Chart.Controller} chart - The chart instance.
  38073. * @param {Object} options - The plugin options.
  38074. */
  38075. /**
  38076. * @method IPlugin#beforeRender
  38077. * @desc Called before rendering `chart`. If any plugin returns `false`,
  38078. * the rendering is cancelled until another `render` is triggered.
  38079. * @param {Chart.Controller} chart - The chart instance.
  38080. * @param {Object} options - The plugin options.
  38081. * @returns {Boolean} `false` to cancel the chart rendering.
  38082. */
  38083. /**
  38084. * @method IPlugin#afterRender
  38085. * @desc Called after the `chart` has been fully rendered (and animation completed). Note
  38086. * that this hook will not be called if the rendering has been previously cancelled.
  38087. * @param {Chart.Controller} chart - The chart instance.
  38088. * @param {Object} options - The plugin options.
  38089. */
  38090. /**
  38091. * @method IPlugin#beforeDraw
  38092. * @desc Called before drawing `chart` at every animation frame specified by the given
  38093. * easing value. If any plugin returns `false`, the frame drawing is cancelled until
  38094. * another `render` is triggered.
  38095. * @param {Chart.Controller} chart - The chart instance.
  38096. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38097. * @param {Object} options - The plugin options.
  38098. * @returns {Boolean} `false` to cancel the chart drawing.
  38099. */
  38100. /**
  38101. * @method IPlugin#afterDraw
  38102. * @desc Called after the `chart` has been drawn for the specific easing value. Note
  38103. * that this hook will not be called if the drawing has been previously cancelled.
  38104. * @param {Chart.Controller} chart - The chart instance.
  38105. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38106. * @param {Object} options - The plugin options.
  38107. */
  38108. /**
  38109. * @method IPlugin#beforeDatasetsDraw
  38110. * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,
  38111. * the datasets drawing is cancelled until another `render` is triggered.
  38112. * @param {Chart.Controller} chart - The chart instance.
  38113. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38114. * @param {Object} options - The plugin options.
  38115. * @returns {Boolean} `false` to cancel the chart datasets drawing.
  38116. */
  38117. /**
  38118. * @method IPlugin#afterDatasetsDraw
  38119. * @desc Called after the `chart` datasets have been drawn. Note that this hook
  38120. * will not be called if the datasets drawing has been previously cancelled.
  38121. * @param {Chart.Controller} chart - The chart instance.
  38122. * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.
  38123. * @param {Object} options - The plugin options.
  38124. */
  38125. /**
  38126. * @method IPlugin#beforeEvent
  38127. * @desc Called before processing the specified `event`. If any plugin returns `false`,
  38128. * the event will be discarded.
  38129. * @param {Chart.Controller} chart - The chart instance.
  38130. * @param {IEvent} event - The event object.
  38131. * @param {Object} options - The plugin options.
  38132. */
  38133. /**
  38134. * @method IPlugin#afterEvent
  38135. * @desc Called after the `event` has been consumed. Note that this hook
  38136. * will not be called if the `event` has been previously discarded.
  38137. * @param {Chart.Controller} chart - The chart instance.
  38138. * @param {IEvent} event - The event object.
  38139. * @param {Object} options - The plugin options.
  38140. */
  38141. /**
  38142. * @method IPlugin#resize
  38143. * @desc Called after the chart as been resized.
  38144. * @param {Chart.Controller} chart - The chart instance.
  38145. * @param {Number} size - The new canvas display size (eq. canvas.style width & height).
  38146. * @param {Object} options - The plugin options.
  38147. */
  38148. /**
  38149. * @method IPlugin#destroy
  38150. * @desc Called after the chart as been destroyed.
  38151. * @param {Chart.Controller} chart - The chart instance.
  38152. * @param {Object} options - The plugin options.
  38153. */
  38154. /**
  38155. * Provided for backward compatibility, use Chart.plugins instead
  38156. * @namespace Chart.pluginService
  38157. * @deprecated since version 2.1.5
  38158. * @todo remove at version 3
  38159. * @private
  38160. */
  38161. Chart.pluginService = Chart.plugins;
  38162. /**
  38163. * Provided for backward compatibility, inheriting from Chart.PlugingBase has no
  38164. * effect, instead simply create/register plugins via plain JavaScript objects.
  38165. * @interface Chart.PluginBase
  38166. * @deprecated since version 2.5.0
  38167. * @todo remove at version 3
  38168. * @private
  38169. */
  38170. Chart.PluginBase = helpers.inherits({});
  38171. };
  38172. /***/ }),
  38173. /* 150 */
  38174. /***/ (function(module, exports, __webpack_require__) {
  38175. "use strict";
  38176. module.exports = function(Chart) {
  38177. var helpers = Chart.helpers;
  38178. Chart.defaults.scale = {
  38179. display: true,
  38180. position: 'left',
  38181. // grid line settings
  38182. gridLines: {
  38183. display: true,
  38184. color: 'rgba(0, 0, 0, 0.1)',
  38185. lineWidth: 1,
  38186. drawBorder: true,
  38187. drawOnChartArea: true,
  38188. drawTicks: true,
  38189. tickMarkLength: 10,
  38190. zeroLineWidth: 1,
  38191. zeroLineColor: 'rgba(0,0,0,0.25)',
  38192. offsetGridLines: false,
  38193. borderDash: [],
  38194. borderDashOffset: 0.0
  38195. },
  38196. // scale label
  38197. scaleLabel: {
  38198. // actual label
  38199. labelString: '',
  38200. // display property
  38201. display: false
  38202. },
  38203. // label settings
  38204. ticks: {
  38205. beginAtZero: false,
  38206. minRotation: 0,
  38207. maxRotation: 50,
  38208. mirror: false,
  38209. padding: 0,
  38210. reverse: false,
  38211. display: true,
  38212. autoSkip: true,
  38213. autoSkipPadding: 0,
  38214. labelOffset: 0,
  38215. // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.
  38216. callback: Chart.Ticks.formatters.values
  38217. }
  38218. };
  38219. function computeTextSize(context, tick, font) {
  38220. return helpers.isArray(tick) ?
  38221. helpers.longestText(context, font, tick) :
  38222. context.measureText(tick).width;
  38223. }
  38224. function parseFontOptions(options) {
  38225. var getValueOrDefault = helpers.getValueOrDefault;
  38226. var globalDefaults = Chart.defaults.global;
  38227. var size = getValueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
  38228. var style = getValueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);
  38229. var family = getValueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);
  38230. return {
  38231. size: size,
  38232. style: style,
  38233. family: family,
  38234. font: helpers.fontString(size, style, family)
  38235. };
  38236. }
  38237. Chart.Scale = Chart.Element.extend({
  38238. /**
  38239. * Get the padding needed for the scale
  38240. * @method getPadding
  38241. * @private
  38242. * @returns {Padding} the necessary padding
  38243. */
  38244. getPadding: function() {
  38245. var me = this;
  38246. return {
  38247. left: me.paddingLeft || 0,
  38248. top: me.paddingTop || 0,
  38249. right: me.paddingRight || 0,
  38250. bottom: me.paddingBottom || 0
  38251. };
  38252. },
  38253. // These methods are ordered by lifecyle. Utilities then follow.
  38254. // Any function defined here is inherited by all scale types.
  38255. // Any function can be extended by the scale type
  38256. beforeUpdate: function() {
  38257. helpers.callCallback(this.options.beforeUpdate, [this]);
  38258. },
  38259. update: function(maxWidth, maxHeight, margins) {
  38260. var me = this;
  38261. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  38262. me.beforeUpdate();
  38263. // Absorb the master measurements
  38264. me.maxWidth = maxWidth;
  38265. me.maxHeight = maxHeight;
  38266. me.margins = helpers.extend({
  38267. left: 0,
  38268. right: 0,
  38269. top: 0,
  38270. bottom: 0
  38271. }, margins);
  38272. me.longestTextCache = me.longestTextCache || {};
  38273. // Dimensions
  38274. me.beforeSetDimensions();
  38275. me.setDimensions();
  38276. me.afterSetDimensions();
  38277. // Data min/max
  38278. me.beforeDataLimits();
  38279. me.determineDataLimits();
  38280. me.afterDataLimits();
  38281. // Ticks
  38282. me.beforeBuildTicks();
  38283. me.buildTicks();
  38284. me.afterBuildTicks();
  38285. me.beforeTickToLabelConversion();
  38286. me.convertTicksToLabels();
  38287. me.afterTickToLabelConversion();
  38288. // Tick Rotation
  38289. me.beforeCalculateTickRotation();
  38290. me.calculateTickRotation();
  38291. me.afterCalculateTickRotation();
  38292. // Fit
  38293. me.beforeFit();
  38294. me.fit();
  38295. me.afterFit();
  38296. //
  38297. me.afterUpdate();
  38298. return me.minSize;
  38299. },
  38300. afterUpdate: function() {
  38301. helpers.callCallback(this.options.afterUpdate, [this]);
  38302. },
  38303. //
  38304. beforeSetDimensions: function() {
  38305. helpers.callCallback(this.options.beforeSetDimensions, [this]);
  38306. },
  38307. setDimensions: function() {
  38308. var me = this;
  38309. // Set the unconstrained dimension before label rotation
  38310. if (me.isHorizontal()) {
  38311. // Reset position before calculating rotation
  38312. me.width = me.maxWidth;
  38313. me.left = 0;
  38314. me.right = me.width;
  38315. } else {
  38316. me.height = me.maxHeight;
  38317. // Reset position before calculating rotation
  38318. me.top = 0;
  38319. me.bottom = me.height;
  38320. }
  38321. // Reset padding
  38322. me.paddingLeft = 0;
  38323. me.paddingTop = 0;
  38324. me.paddingRight = 0;
  38325. me.paddingBottom = 0;
  38326. },
  38327. afterSetDimensions: function() {
  38328. helpers.callCallback(this.options.afterSetDimensions, [this]);
  38329. },
  38330. // Data limits
  38331. beforeDataLimits: function() {
  38332. helpers.callCallback(this.options.beforeDataLimits, [this]);
  38333. },
  38334. determineDataLimits: helpers.noop,
  38335. afterDataLimits: function() {
  38336. helpers.callCallback(this.options.afterDataLimits, [this]);
  38337. },
  38338. //
  38339. beforeBuildTicks: function() {
  38340. helpers.callCallback(this.options.beforeBuildTicks, [this]);
  38341. },
  38342. buildTicks: helpers.noop,
  38343. afterBuildTicks: function() {
  38344. helpers.callCallback(this.options.afterBuildTicks, [this]);
  38345. },
  38346. beforeTickToLabelConversion: function() {
  38347. helpers.callCallback(this.options.beforeTickToLabelConversion, [this]);
  38348. },
  38349. convertTicksToLabels: function() {
  38350. var me = this;
  38351. // Convert ticks to strings
  38352. var tickOpts = me.options.ticks;
  38353. me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback);
  38354. },
  38355. afterTickToLabelConversion: function() {
  38356. helpers.callCallback(this.options.afterTickToLabelConversion, [this]);
  38357. },
  38358. //
  38359. beforeCalculateTickRotation: function() {
  38360. helpers.callCallback(this.options.beforeCalculateTickRotation, [this]);
  38361. },
  38362. calculateTickRotation: function() {
  38363. var me = this;
  38364. var context = me.ctx;
  38365. var tickOpts = me.options.ticks;
  38366. // Get the width of each grid by calculating the difference
  38367. // between x offsets between 0 and 1.
  38368. var tickFont = parseFontOptions(tickOpts);
  38369. context.font = tickFont.font;
  38370. var labelRotation = tickOpts.minRotation || 0;
  38371. if (me.options.display && me.isHorizontal()) {
  38372. var originalLabelWidth = helpers.longestText(context, tickFont.font, me.ticks, me.longestTextCache);
  38373. var labelWidth = originalLabelWidth;
  38374. var cosRotation;
  38375. var sinRotation;
  38376. // Allow 3 pixels x2 padding either side for label readability
  38377. var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;
  38378. // Max label rotation can be set or default to 90 - also act as a loop counter
  38379. while (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {
  38380. var angleRadians = helpers.toRadians(labelRotation);
  38381. cosRotation = Math.cos(angleRadians);
  38382. sinRotation = Math.sin(angleRadians);
  38383. if (sinRotation * originalLabelWidth > me.maxHeight) {
  38384. // go back one step
  38385. labelRotation--;
  38386. break;
  38387. }
  38388. labelRotation++;
  38389. labelWidth = cosRotation * originalLabelWidth;
  38390. }
  38391. }
  38392. me.labelRotation = labelRotation;
  38393. },
  38394. afterCalculateTickRotation: function() {
  38395. helpers.callCallback(this.options.afterCalculateTickRotation, [this]);
  38396. },
  38397. //
  38398. beforeFit: function() {
  38399. helpers.callCallback(this.options.beforeFit, [this]);
  38400. },
  38401. fit: function() {
  38402. var me = this;
  38403. // Reset
  38404. var minSize = me.minSize = {
  38405. width: 0,
  38406. height: 0
  38407. };
  38408. var opts = me.options;
  38409. var tickOpts = opts.ticks;
  38410. var scaleLabelOpts = opts.scaleLabel;
  38411. var gridLineOpts = opts.gridLines;
  38412. var display = opts.display;
  38413. var isHorizontal = me.isHorizontal();
  38414. var tickFont = parseFontOptions(tickOpts);
  38415. var scaleLabelFontSize = parseFontOptions(scaleLabelOpts).size * 1.5;
  38416. var tickMarkLength = opts.gridLines.tickMarkLength;
  38417. // Width
  38418. if (isHorizontal) {
  38419. // subtract the margins to line up with the chartArea if we are a full width scale
  38420. minSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;
  38421. } else {
  38422. minSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38423. }
  38424. // height
  38425. if (isHorizontal) {
  38426. minSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;
  38427. } else {
  38428. minSize.height = me.maxHeight; // fill all the height
  38429. }
  38430. // Are we showing a title for the scale?
  38431. if (scaleLabelOpts.display && display) {
  38432. if (isHorizontal) {
  38433. minSize.height += scaleLabelFontSize;
  38434. } else {
  38435. minSize.width += scaleLabelFontSize;
  38436. }
  38437. }
  38438. // Don't bother fitting the ticks if we are not showing them
  38439. if (tickOpts.display && display) {
  38440. var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, me.ticks, me.longestTextCache);
  38441. var tallestLabelHeightInLines = helpers.numberOfLabelLines(me.ticks);
  38442. var lineSpace = tickFont.size * 0.5;
  38443. if (isHorizontal) {
  38444. // A horizontal axis is more constrained by the height.
  38445. me.longestLabelWidth = largestTextWidth;
  38446. var angleRadians = helpers.toRadians(me.labelRotation);
  38447. var cosRotation = Math.cos(angleRadians);
  38448. var sinRotation = Math.sin(angleRadians);
  38449. // TODO - improve this calculation
  38450. var labelHeight = (sinRotation * largestTextWidth)
  38451. + (tickFont.size * tallestLabelHeightInLines)
  38452. + (lineSpace * tallestLabelHeightInLines);
  38453. minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight);
  38454. me.ctx.font = tickFont.font;
  38455. var firstTick = me.ticks[0];
  38456. var firstLabelWidth = computeTextSize(me.ctx, firstTick, tickFont.font);
  38457. var lastTick = me.ticks[me.ticks.length - 1];
  38458. var lastLabelWidth = computeTextSize(me.ctx, lastTick, tickFont.font);
  38459. // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned which means that the right padding is dominated
  38460. // by the font height
  38461. if (me.labelRotation !== 0) {
  38462. me.paddingLeft = opts.position === 'bottom'? (cosRotation * firstLabelWidth) + 3: (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges
  38463. me.paddingRight = opts.position === 'bottom'? (cosRotation * lineSpace) + 3: (cosRotation * lastLabelWidth) + 3;
  38464. } else {
  38465. me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges
  38466. me.paddingRight = lastLabelWidth / 2 + 3;
  38467. }
  38468. } else {
  38469. // A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
  38470. // Account for padding
  38471. if (tickOpts.mirror) {
  38472. largestTextWidth = 0;
  38473. } else {
  38474. largestTextWidth += me.options.ticks.padding;
  38475. }
  38476. minSize.width += largestTextWidth;
  38477. me.paddingTop = tickFont.size / 2;
  38478. me.paddingBottom = tickFont.size / 2;
  38479. }
  38480. }
  38481. me.handleMargins();
  38482. me.width = minSize.width;
  38483. me.height = minSize.height;
  38484. },
  38485. /**
  38486. * Handle margins and padding interactions
  38487. * @private
  38488. */
  38489. handleMargins: function() {
  38490. var me = this;
  38491. if (me.margins) {
  38492. me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);
  38493. me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);
  38494. me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);
  38495. me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);
  38496. }
  38497. },
  38498. afterFit: function() {
  38499. helpers.callCallback(this.options.afterFit, [this]);
  38500. },
  38501. // Shared Methods
  38502. isHorizontal: function() {
  38503. return this.options.position === 'top' || this.options.position === 'bottom';
  38504. },
  38505. isFullWidth: function() {
  38506. return (this.options.fullWidth);
  38507. },
  38508. // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not
  38509. getRightValue: function(rawValue) {
  38510. // Null and undefined values first
  38511. if (rawValue === null || typeof(rawValue) === 'undefined') {
  38512. return NaN;
  38513. }
  38514. // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
  38515. if (typeof(rawValue) === 'number' && !isFinite(rawValue)) {
  38516. return NaN;
  38517. }
  38518. // If it is in fact an object, dive in one more level
  38519. if (typeof(rawValue) === 'object') {
  38520. if ((rawValue instanceof Date) || (rawValue.isValid)) {
  38521. return rawValue;
  38522. }
  38523. return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
  38524. }
  38525. // Value is good, return it
  38526. return rawValue;
  38527. },
  38528. // Used to get the value to display in the tooltip for the data at the given index
  38529. // function getLabelForIndex(index, datasetIndex)
  38530. getLabelForIndex: helpers.noop,
  38531. // Used to get data value locations. Value can either be an index or a numerical value
  38532. getPixelForValue: helpers.noop,
  38533. // Used to get the data value from a given pixel. This is the inverse of getPixelForValue
  38534. getValueForPixel: helpers.noop,
  38535. // Used for tick location, should
  38536. getPixelForTick: function(index, includeOffset) {
  38537. var me = this;
  38538. if (me.isHorizontal()) {
  38539. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38540. var tickWidth = innerWidth / Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  38541. var pixel = (tickWidth * index) + me.paddingLeft;
  38542. if (includeOffset) {
  38543. pixel += tickWidth / 2;
  38544. }
  38545. var finalVal = me.left + Math.round(pixel);
  38546. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38547. return finalVal;
  38548. }
  38549. var innerHeight = me.height - (me.paddingTop + me.paddingBottom);
  38550. return me.top + (index * (innerHeight / (me.ticks.length - 1)));
  38551. },
  38552. // Utility for getting the pixel location of a percentage of scale
  38553. getPixelForDecimal: function(decimal /* , includeOffset*/) {
  38554. var me = this;
  38555. if (me.isHorizontal()) {
  38556. var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
  38557. var valueOffset = (innerWidth * decimal) + me.paddingLeft;
  38558. var finalVal = me.left + Math.round(valueOffset);
  38559. finalVal += me.isFullWidth() ? me.margins.left : 0;
  38560. return finalVal;
  38561. }
  38562. return me.top + (decimal * me.height);
  38563. },
  38564. getBasePixel: function() {
  38565. return this.getPixelForValue(this.getBaseValue());
  38566. },
  38567. getBaseValue: function() {
  38568. var me = this;
  38569. var min = me.min;
  38570. var max = me.max;
  38571. return me.beginAtZero ? 0:
  38572. min < 0 && max < 0? max :
  38573. min > 0 && max > 0? min :
  38574. 0;
  38575. },
  38576. // Actually draw the scale on the canvas
  38577. // @param {rectangle} chartArea : the area of the chart to draw full grid lines on
  38578. draw: function(chartArea) {
  38579. var me = this;
  38580. var options = me.options;
  38581. if (!options.display) {
  38582. return;
  38583. }
  38584. var context = me.ctx;
  38585. var globalDefaults = Chart.defaults.global;
  38586. var optionTicks = options.ticks;
  38587. var gridLines = options.gridLines;
  38588. var scaleLabel = options.scaleLabel;
  38589. var isRotated = me.labelRotation !== 0;
  38590. var skipRatio;
  38591. var useAutoskipper = optionTicks.autoSkip;
  38592. var isHorizontal = me.isHorizontal();
  38593. // figure out the maximum number of gridlines to show
  38594. var maxTicks;
  38595. if (optionTicks.maxTicksLimit) {
  38596. maxTicks = optionTicks.maxTicksLimit;
  38597. }
  38598. var tickFontColor = helpers.getValueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);
  38599. var tickFont = parseFontOptions(optionTicks);
  38600. var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;
  38601. var borderDash = helpers.getValueOrDefault(gridLines.borderDash, globalDefaults.borderDash);
  38602. var borderDashOffset = helpers.getValueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);
  38603. var scaleLabelFontColor = helpers.getValueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);
  38604. var scaleLabelFont = parseFontOptions(scaleLabel);
  38605. var labelRotationRadians = helpers.toRadians(me.labelRotation);
  38606. var cosRotation = Math.cos(labelRotationRadians);
  38607. var longestRotatedLabel = me.longestLabelWidth * cosRotation;
  38608. // Make sure we draw text in the correct color and font
  38609. context.fillStyle = tickFontColor;
  38610. var itemsToDraw = [];
  38611. if (isHorizontal) {
  38612. skipRatio = false;
  38613. // Only calculate the skip ratio with the half width of longestRotateLabel if we got an actual rotation
  38614. // See #2584
  38615. if (isRotated) {
  38616. longestRotatedLabel /= 2;
  38617. }
  38618. if ((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length > (me.width - (me.paddingLeft + me.paddingRight))) {
  38619. skipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * me.ticks.length) / (me.width - (me.paddingLeft + me.paddingRight)));
  38620. }
  38621. // if they defined a max number of optionTicks,
  38622. // increase skipRatio until that number is met
  38623. if (maxTicks && me.ticks.length > maxTicks) {
  38624. while (!skipRatio || me.ticks.length / (skipRatio || 1) > maxTicks) {
  38625. if (!skipRatio) {
  38626. skipRatio = 1;
  38627. }
  38628. skipRatio += 1;
  38629. }
  38630. }
  38631. if (!useAutoskipper) {
  38632. skipRatio = false;
  38633. }
  38634. }
  38635. var xTickStart = options.position === 'right' ? me.left : me.right - tl;
  38636. var xTickEnd = options.position === 'right' ? me.left + tl : me.right;
  38637. var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;
  38638. var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;
  38639. helpers.each(me.ticks, function(label, index) {
  38640. // If the callback returned a null or undefined value, do not draw this line
  38641. if (label === undefined || label === null) {
  38642. return;
  38643. }
  38644. var isLastTick = me.ticks.length === index + 1;
  38645. // Since we always show the last tick,we need may need to hide the last shown one before
  38646. var shouldSkip = (skipRatio > 1 && index % skipRatio > 0) || (index % skipRatio === 0 && index + skipRatio >= me.ticks.length);
  38647. if (shouldSkip && !isLastTick || (label === undefined || label === null)) {
  38648. return;
  38649. }
  38650. var lineWidth, lineColor;
  38651. if (index === (typeof me.zeroLineIndex !== 'undefined' ? me.zeroLineIndex : 0)) {
  38652. // Draw the first index specially
  38653. lineWidth = gridLines.zeroLineWidth;
  38654. lineColor = gridLines.zeroLineColor;
  38655. } else {
  38656. lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, index);
  38657. lineColor = helpers.getValueAtIndexOrDefault(gridLines.color, index);
  38658. }
  38659. // Common properties
  38660. var tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;
  38661. var textAlign = 'middle';
  38662. var textBaseline = 'middle';
  38663. if (isHorizontal) {
  38664. if (options.position === 'bottom') {
  38665. // bottom
  38666. textBaseline = !isRotated? 'top':'middle';
  38667. textAlign = !isRotated? 'center': 'right';
  38668. labelY = me.top + tl;
  38669. } else {
  38670. // top
  38671. textBaseline = !isRotated? 'bottom':'middle';
  38672. textAlign = !isRotated? 'center': 'left';
  38673. labelY = me.bottom - tl;
  38674. }
  38675. var xLineValue = me.getPixelForTick(index) + helpers.aliasPixel(lineWidth); // xvalues for grid lines
  38676. labelX = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)
  38677. tx1 = tx2 = x1 = x2 = xLineValue;
  38678. ty1 = yTickStart;
  38679. ty2 = yTickEnd;
  38680. y1 = chartArea.top;
  38681. y2 = chartArea.bottom;
  38682. } else {
  38683. var isLeft = options.position === 'left';
  38684. var tickPadding = optionTicks.padding;
  38685. var labelXOffset;
  38686. if (optionTicks.mirror) {
  38687. textAlign = isLeft ? 'left' : 'right';
  38688. labelXOffset = tickPadding;
  38689. } else {
  38690. textAlign = isLeft ? 'right' : 'left';
  38691. labelXOffset = tl + tickPadding;
  38692. }
  38693. labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;
  38694. var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
  38695. yLineValue += helpers.aliasPixel(lineWidth);
  38696. labelY = me.getPixelForTick(index, gridLines.offsetGridLines);
  38697. tx1 = xTickStart;
  38698. tx2 = xTickEnd;
  38699. x1 = chartArea.left;
  38700. x2 = chartArea.right;
  38701. ty1 = ty2 = y1 = y2 = yLineValue;
  38702. }
  38703. itemsToDraw.push({
  38704. tx1: tx1,
  38705. ty1: ty1,
  38706. tx2: tx2,
  38707. ty2: ty2,
  38708. x1: x1,
  38709. y1: y1,
  38710. x2: x2,
  38711. y2: y2,
  38712. labelX: labelX,
  38713. labelY: labelY,
  38714. glWidth: lineWidth,
  38715. glColor: lineColor,
  38716. glBorderDash: borderDash,
  38717. glBorderDashOffset: borderDashOffset,
  38718. rotation: -1 * labelRotationRadians,
  38719. label: label,
  38720. textBaseline: textBaseline,
  38721. textAlign: textAlign
  38722. });
  38723. });
  38724. // Draw all of the tick labels, tick marks, and grid lines at the correct places
  38725. helpers.each(itemsToDraw, function(itemToDraw) {
  38726. if (gridLines.display) {
  38727. context.save();
  38728. context.lineWidth = itemToDraw.glWidth;
  38729. context.strokeStyle = itemToDraw.glColor;
  38730. if (context.setLineDash) {
  38731. context.setLineDash(itemToDraw.glBorderDash);
  38732. context.lineDashOffset = itemToDraw.glBorderDashOffset;
  38733. }
  38734. context.beginPath();
  38735. if (gridLines.drawTicks) {
  38736. context.moveTo(itemToDraw.tx1, itemToDraw.ty1);
  38737. context.lineTo(itemToDraw.tx2, itemToDraw.ty2);
  38738. }
  38739. if (gridLines.drawOnChartArea) {
  38740. context.moveTo(itemToDraw.x1, itemToDraw.y1);
  38741. context.lineTo(itemToDraw.x2, itemToDraw.y2);
  38742. }
  38743. context.stroke();
  38744. context.restore();
  38745. }
  38746. if (optionTicks.display) {
  38747. context.save();
  38748. context.translate(itemToDraw.labelX, itemToDraw.labelY);
  38749. context.rotate(itemToDraw.rotation);
  38750. context.font = tickFont.font;
  38751. context.textBaseline = itemToDraw.textBaseline;
  38752. context.textAlign = itemToDraw.textAlign;
  38753. var label = itemToDraw.label;
  38754. if (helpers.isArray(label)) {
  38755. for (var i = 0, y = 0; i < label.length; ++i) {
  38756. // We just make sure the multiline element is a string here..
  38757. context.fillText('' + label[i], 0, y);
  38758. // apply same lineSpacing as calculated @ L#320
  38759. y += (tickFont.size * 1.5);
  38760. }
  38761. } else {
  38762. context.fillText(label, 0, 0);
  38763. }
  38764. context.restore();
  38765. }
  38766. });
  38767. if (scaleLabel.display) {
  38768. // Draw the scale label
  38769. var scaleLabelX;
  38770. var scaleLabelY;
  38771. var rotation = 0;
  38772. if (isHorizontal) {
  38773. scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width
  38774. scaleLabelY = options.position === 'bottom' ? me.bottom - (scaleLabelFont.size / 2) : me.top + (scaleLabelFont.size / 2);
  38775. } else {
  38776. var isLeft = options.position === 'left';
  38777. scaleLabelX = isLeft ? me.left + (scaleLabelFont.size / 2) : me.right - (scaleLabelFont.size / 2);
  38778. scaleLabelY = me.top + ((me.bottom - me.top) / 2);
  38779. rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;
  38780. }
  38781. context.save();
  38782. context.translate(scaleLabelX, scaleLabelY);
  38783. context.rotate(rotation);
  38784. context.textAlign = 'center';
  38785. context.textBaseline = 'middle';
  38786. context.fillStyle = scaleLabelFontColor; // render in correct colour
  38787. context.font = scaleLabelFont.font;
  38788. context.fillText(scaleLabel.labelString, 0, 0);
  38789. context.restore();
  38790. }
  38791. if (gridLines.drawBorder) {
  38792. // Draw the line at the edge of the axis
  38793. context.lineWidth = helpers.getValueAtIndexOrDefault(gridLines.lineWidth, 0);
  38794. context.strokeStyle = helpers.getValueAtIndexOrDefault(gridLines.color, 0);
  38795. var x1 = me.left,
  38796. x2 = me.right,
  38797. y1 = me.top,
  38798. y2 = me.bottom;
  38799. var aliasPixel = helpers.aliasPixel(context.lineWidth);
  38800. if (isHorizontal) {
  38801. y1 = y2 = options.position === 'top' ? me.bottom : me.top;
  38802. y1 += aliasPixel;
  38803. y2 += aliasPixel;
  38804. } else {
  38805. x1 = x2 = options.position === 'left' ? me.right : me.left;
  38806. x1 += aliasPixel;
  38807. x2 += aliasPixel;
  38808. }
  38809. context.beginPath();
  38810. context.moveTo(x1, y1);
  38811. context.lineTo(x2, y2);
  38812. context.stroke();
  38813. }
  38814. }
  38815. });
  38816. };
  38817. /***/ }),
  38818. /* 151 */
  38819. /***/ (function(module, exports, __webpack_require__) {
  38820. "use strict";
  38821. module.exports = function(Chart) {
  38822. var helpers = Chart.helpers;
  38823. Chart.scaleService = {
  38824. // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
  38825. // use the new chart options to grab the correct scale
  38826. constructors: {},
  38827. // Use a registration function so that we can move to an ES6 map when we no longer need to support
  38828. // old browsers
  38829. // Scale config defaults
  38830. defaults: {},
  38831. registerScaleType: function(type, scaleConstructor, defaults) {
  38832. this.constructors[type] = scaleConstructor;
  38833. this.defaults[type] = helpers.clone(defaults);
  38834. },
  38835. getScaleConstructor: function(type) {
  38836. return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
  38837. },
  38838. getScaleDefaults: function(type) {
  38839. // Return the scale defaults merged with the global settings so that we always use the latest ones
  38840. return this.defaults.hasOwnProperty(type) ? helpers.scaleMerge(Chart.defaults.scale, this.defaults[type]) : {};
  38841. },
  38842. updateScaleDefaults: function(type, additions) {
  38843. var defaults = this.defaults;
  38844. if (defaults.hasOwnProperty(type)) {
  38845. defaults[type] = helpers.extend(defaults[type], additions);
  38846. }
  38847. },
  38848. addScalesToLayout: function(chartInstance) {
  38849. // Adds each scale to the chart.boxes array to be sized accordingly
  38850. helpers.each(chartInstance.scales, function(scale) {
  38851. Chart.layoutService.addBox(chartInstance, scale);
  38852. });
  38853. }
  38854. };
  38855. };
  38856. /***/ }),
  38857. /* 152 */
  38858. /***/ (function(module, exports, __webpack_require__) {
  38859. "use strict";
  38860. module.exports = function(Chart) {
  38861. var helpers = Chart.helpers;
  38862. /**
  38863. * Namespace to hold static tick generation functions
  38864. * @namespace Chart.Ticks
  38865. */
  38866. Chart.Ticks = {
  38867. /**
  38868. * Namespace to hold generators for different types of ticks
  38869. * @namespace Chart.Ticks.generators
  38870. */
  38871. generators: {
  38872. /**
  38873. * Interface for the options provided to the numeric tick generator
  38874. * @interface INumericTickGenerationOptions
  38875. */
  38876. /**
  38877. * The maximum number of ticks to display
  38878. * @name INumericTickGenerationOptions#maxTicks
  38879. * @type Number
  38880. */
  38881. /**
  38882. * The distance between each tick.
  38883. * @name INumericTickGenerationOptions#stepSize
  38884. * @type Number
  38885. * @optional
  38886. */
  38887. /**
  38888. * Forced minimum for the ticks. If not specified, the minimum of the data range is used to calculate the tick minimum
  38889. * @name INumericTickGenerationOptions#min
  38890. * @type Number
  38891. * @optional
  38892. */
  38893. /**
  38894. * The maximum value of the ticks. If not specified, the maximum of the data range is used to calculate the tick maximum
  38895. * @name INumericTickGenerationOptions#max
  38896. * @type Number
  38897. * @optional
  38898. */
  38899. /**
  38900. * Generate a set of linear ticks
  38901. * @method Chart.Ticks.generators.linear
  38902. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  38903. * @param dataRange {IRange} the range of the data
  38904. * @returns {Array<Number>} array of tick values
  38905. */
  38906. linear: function(generationOptions, dataRange) {
  38907. var ticks = [];
  38908. // To get a "nice" value for the tick spacing, we will use the appropriately named
  38909. // "nice number" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
  38910. // for details.
  38911. var spacing;
  38912. if (generationOptions.stepSize && generationOptions.stepSize > 0) {
  38913. spacing = generationOptions.stepSize;
  38914. } else {
  38915. var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);
  38916. spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);
  38917. }
  38918. var niceMin = Math.floor(dataRange.min / spacing) * spacing;
  38919. var niceMax = Math.ceil(dataRange.max / spacing) * spacing;
  38920. // If min, max and stepSize is set and they make an evenly spaced scale use it.
  38921. if (generationOptions.min && generationOptions.max && generationOptions.stepSize) {
  38922. // If very close to our whole number, use it.
  38923. if (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {
  38924. niceMin = generationOptions.min;
  38925. niceMax = generationOptions.max;
  38926. }
  38927. }
  38928. var numSpaces = (niceMax - niceMin) / spacing;
  38929. // If very close to our rounded value, use it.
  38930. if (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {
  38931. numSpaces = Math.round(numSpaces);
  38932. } else {
  38933. numSpaces = Math.ceil(numSpaces);
  38934. }
  38935. // Put the values into the ticks array
  38936. ticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);
  38937. for (var j = 1; j < numSpaces; ++j) {
  38938. ticks.push(niceMin + (j * spacing));
  38939. }
  38940. ticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);
  38941. return ticks;
  38942. },
  38943. /**
  38944. * Generate a set of logarithmic ticks
  38945. * @method Chart.Ticks.generators.logarithmic
  38946. * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks
  38947. * @param dataRange {IRange} the range of the data
  38948. * @returns {Array<Number>} array of tick values
  38949. */
  38950. logarithmic: function(generationOptions, dataRange) {
  38951. var ticks = [];
  38952. var getValueOrDefault = helpers.getValueOrDefault;
  38953. // Figure out what the max number of ticks we can support it is based on the size of
  38954. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  38955. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  38956. // the graph
  38957. var tickVal = getValueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));
  38958. var endExp = Math.floor(helpers.log10(dataRange.max));
  38959. var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
  38960. var exp;
  38961. var significand;
  38962. if (tickVal === 0) {
  38963. exp = Math.floor(helpers.log10(dataRange.minNotZero));
  38964. significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));
  38965. ticks.push(tickVal);
  38966. tickVal = significand * Math.pow(10, exp);
  38967. } else {
  38968. exp = Math.floor(helpers.log10(tickVal));
  38969. significand = Math.floor(tickVal / Math.pow(10, exp));
  38970. }
  38971. do {
  38972. ticks.push(tickVal);
  38973. ++significand;
  38974. if (significand === 10) {
  38975. significand = 1;
  38976. ++exp;
  38977. }
  38978. tickVal = significand * Math.pow(10, exp);
  38979. } while (exp < endExp || (exp === endExp && significand < endSignificand));
  38980. var lastTick = getValueOrDefault(generationOptions.max, tickVal);
  38981. ticks.push(lastTick);
  38982. return ticks;
  38983. }
  38984. },
  38985. /**
  38986. * Namespace to hold formatters for different types of ticks
  38987. * @namespace Chart.Ticks.formatters
  38988. */
  38989. formatters: {
  38990. /**
  38991. * Formatter for value labels
  38992. * @method Chart.Ticks.formatters.values
  38993. * @param value the value to display
  38994. * @return {String|Array} the label to display
  38995. */
  38996. values: function(value) {
  38997. return helpers.isArray(value) ? value : '' + value;
  38998. },
  38999. /**
  39000. * Formatter for linear numeric ticks
  39001. * @method Chart.Ticks.formatters.linear
  39002. * @param tickValue {Number} the value to be formatted
  39003. * @param index {Number} the position of the tickValue parameter in the ticks array
  39004. * @param ticks {Array<Number>} the list of ticks being converted
  39005. * @return {String} string representation of the tickValue parameter
  39006. */
  39007. linear: function(tickValue, index, ticks) {
  39008. // If we have lots of ticks, don't use the ones
  39009. var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];
  39010. // If we have a number like 2.5 as the delta, figure out how many decimal places we need
  39011. if (Math.abs(delta) > 1) {
  39012. if (tickValue !== Math.floor(tickValue)) {
  39013. // not an integer
  39014. delta = tickValue - Math.floor(tickValue);
  39015. }
  39016. }
  39017. var logDelta = helpers.log10(Math.abs(delta));
  39018. var tickString = '';
  39019. if (tickValue !== 0) {
  39020. var numDecimal = -1 * Math.floor(logDelta);
  39021. numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places
  39022. tickString = tickValue.toFixed(numDecimal);
  39023. } else {
  39024. tickString = '0'; // never show decimal places for 0
  39025. }
  39026. return tickString;
  39027. },
  39028. logarithmic: function(tickValue, index, ticks) {
  39029. var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));
  39030. if (tickValue === 0) {
  39031. return '0';
  39032. } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {
  39033. return tickValue.toExponential();
  39034. }
  39035. return '';
  39036. }
  39037. }
  39038. };
  39039. };
  39040. /***/ }),
  39041. /* 153 */
  39042. /***/ (function(module, exports, __webpack_require__) {
  39043. "use strict";
  39044. module.exports = function(Chart) {
  39045. var helpers = Chart.helpers;
  39046. Chart.defaults.global.title = {
  39047. display: false,
  39048. position: 'top',
  39049. fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
  39050. fontStyle: 'bold',
  39051. padding: 10,
  39052. // actual title
  39053. text: ''
  39054. };
  39055. var noop = helpers.noop;
  39056. Chart.Title = Chart.Element.extend({
  39057. initialize: function(config) {
  39058. var me = this;
  39059. helpers.extend(me, config);
  39060. // Contains hit boxes for each dataset (in dataset order)
  39061. me.legendHitBoxes = [];
  39062. },
  39063. // These methods are ordered by lifecycle. Utilities then follow.
  39064. beforeUpdate: noop,
  39065. update: function(maxWidth, maxHeight, margins) {
  39066. var me = this;
  39067. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  39068. me.beforeUpdate();
  39069. // Absorb the master measurements
  39070. me.maxWidth = maxWidth;
  39071. me.maxHeight = maxHeight;
  39072. me.margins = margins;
  39073. // Dimensions
  39074. me.beforeSetDimensions();
  39075. me.setDimensions();
  39076. me.afterSetDimensions();
  39077. // Labels
  39078. me.beforeBuildLabels();
  39079. me.buildLabels();
  39080. me.afterBuildLabels();
  39081. // Fit
  39082. me.beforeFit();
  39083. me.fit();
  39084. me.afterFit();
  39085. //
  39086. me.afterUpdate();
  39087. return me.minSize;
  39088. },
  39089. afterUpdate: noop,
  39090. //
  39091. beforeSetDimensions: noop,
  39092. setDimensions: function() {
  39093. var me = this;
  39094. // Set the unconstrained dimension before label rotation
  39095. if (me.isHorizontal()) {
  39096. // Reset position before calculating rotation
  39097. me.width = me.maxWidth;
  39098. me.left = 0;
  39099. me.right = me.width;
  39100. } else {
  39101. me.height = me.maxHeight;
  39102. // Reset position before calculating rotation
  39103. me.top = 0;
  39104. me.bottom = me.height;
  39105. }
  39106. // Reset padding
  39107. me.paddingLeft = 0;
  39108. me.paddingTop = 0;
  39109. me.paddingRight = 0;
  39110. me.paddingBottom = 0;
  39111. // Reset minSize
  39112. me.minSize = {
  39113. width: 0,
  39114. height: 0
  39115. };
  39116. },
  39117. afterSetDimensions: noop,
  39118. //
  39119. beforeBuildLabels: noop,
  39120. buildLabels: noop,
  39121. afterBuildLabels: noop,
  39122. //
  39123. beforeFit: noop,
  39124. fit: function() {
  39125. var me = this,
  39126. valueOrDefault = helpers.getValueOrDefault,
  39127. opts = me.options,
  39128. globalDefaults = Chart.defaults.global,
  39129. display = opts.display,
  39130. fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  39131. minSize = me.minSize;
  39132. if (me.isHorizontal()) {
  39133. minSize.width = me.maxWidth; // fill all the width
  39134. minSize.height = display ? fontSize + (opts.padding * 2) : 0;
  39135. } else {
  39136. minSize.width = display ? fontSize + (opts.padding * 2) : 0;
  39137. minSize.height = me.maxHeight; // fill all the height
  39138. }
  39139. me.width = minSize.width;
  39140. me.height = minSize.height;
  39141. },
  39142. afterFit: noop,
  39143. // Shared Methods
  39144. isHorizontal: function() {
  39145. var pos = this.options.position;
  39146. return pos === 'top' || pos === 'bottom';
  39147. },
  39148. // Actually draw the title block on the canvas
  39149. draw: function() {
  39150. var me = this,
  39151. ctx = me.ctx,
  39152. valueOrDefault = helpers.getValueOrDefault,
  39153. opts = me.options,
  39154. globalDefaults = Chart.defaults.global;
  39155. if (opts.display) {
  39156. var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize),
  39157. fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle),
  39158. fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily),
  39159. titleFont = helpers.fontString(fontSize, fontStyle, fontFamily),
  39160. rotation = 0,
  39161. titleX,
  39162. titleY,
  39163. top = me.top,
  39164. left = me.left,
  39165. bottom = me.bottom,
  39166. right = me.right,
  39167. maxWidth;
  39168. ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour
  39169. ctx.font = titleFont;
  39170. // Horizontal
  39171. if (me.isHorizontal()) {
  39172. titleX = left + ((right - left) / 2); // midpoint of the width
  39173. titleY = top + ((bottom - top) / 2); // midpoint of the height
  39174. maxWidth = right - left;
  39175. } else {
  39176. titleX = opts.position === 'left' ? left + (fontSize / 2) : right - (fontSize / 2);
  39177. titleY = top + ((bottom - top) / 2);
  39178. maxWidth = bottom - top;
  39179. rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);
  39180. }
  39181. ctx.save();
  39182. ctx.translate(titleX, titleY);
  39183. ctx.rotate(rotation);
  39184. ctx.textAlign = 'center';
  39185. ctx.textBaseline = 'middle';
  39186. ctx.fillText(opts.text, 0, 0, maxWidth);
  39187. ctx.restore();
  39188. }
  39189. }
  39190. });
  39191. function createNewTitleBlockAndAttach(chartInstance, titleOpts) {
  39192. var title = new Chart.Title({
  39193. ctx: chartInstance.chart.ctx,
  39194. options: titleOpts,
  39195. chart: chartInstance
  39196. });
  39197. chartInstance.titleBlock = title;
  39198. Chart.layoutService.addBox(chartInstance, title);
  39199. }
  39200. // Register the title plugin
  39201. Chart.plugins.register({
  39202. beforeInit: function(chartInstance) {
  39203. var titleOpts = chartInstance.options.title;
  39204. if (titleOpts) {
  39205. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  39206. }
  39207. },
  39208. beforeUpdate: function(chartInstance) {
  39209. var titleOpts = chartInstance.options.title;
  39210. if (titleOpts) {
  39211. titleOpts = helpers.configMerge(Chart.defaults.global.title, titleOpts);
  39212. if (chartInstance.titleBlock) {
  39213. chartInstance.titleBlock.options = titleOpts;
  39214. } else {
  39215. createNewTitleBlockAndAttach(chartInstance, titleOpts);
  39216. }
  39217. } else {
  39218. Chart.layoutService.removeBox(chartInstance, chartInstance.titleBlock);
  39219. delete chartInstance.titleBlock;
  39220. }
  39221. }
  39222. });
  39223. };
  39224. /***/ }),
  39225. /* 154 */
  39226. /***/ (function(module, exports, __webpack_require__) {
  39227. "use strict";
  39228. module.exports = function(Chart) {
  39229. var helpers = Chart.helpers;
  39230. /**
  39231. * Helper method to merge the opacity into a color
  39232. */
  39233. function mergeOpacity(colorString, opacity) {
  39234. var color = helpers.color(colorString);
  39235. return color.alpha(opacity * color.alpha()).rgbaString();
  39236. }
  39237. Chart.defaults.global.tooltips = {
  39238. enabled: true,
  39239. custom: null,
  39240. mode: 'nearest',
  39241. position: 'average',
  39242. intersect: true,
  39243. backgroundColor: 'rgba(0,0,0,0.8)',
  39244. titleFontStyle: 'bold',
  39245. titleSpacing: 2,
  39246. titleMarginBottom: 6,
  39247. titleFontColor: '#fff',
  39248. titleAlign: 'left',
  39249. bodySpacing: 2,
  39250. bodyFontColor: '#fff',
  39251. bodyAlign: 'left',
  39252. footerFontStyle: 'bold',
  39253. footerSpacing: 2,
  39254. footerMarginTop: 6,
  39255. footerFontColor: '#fff',
  39256. footerAlign: 'left',
  39257. yPadding: 6,
  39258. xPadding: 6,
  39259. caretSize: 5,
  39260. cornerRadius: 6,
  39261. multiKeyBackground: '#fff',
  39262. displayColors: true,
  39263. callbacks: {
  39264. // Args are: (tooltipItems, data)
  39265. beforeTitle: helpers.noop,
  39266. title: function(tooltipItems, data) {
  39267. // Pick first xLabel for now
  39268. var title = '';
  39269. var labels = data.labels;
  39270. var labelCount = labels ? labels.length : 0;
  39271. if (tooltipItems.length > 0) {
  39272. var item = tooltipItems[0];
  39273. if (item.xLabel) {
  39274. title = item.xLabel;
  39275. } else if (labelCount > 0 && item.index < labelCount) {
  39276. title = labels[item.index];
  39277. }
  39278. }
  39279. return title;
  39280. },
  39281. afterTitle: helpers.noop,
  39282. // Args are: (tooltipItems, data)
  39283. beforeBody: helpers.noop,
  39284. // Args are: (tooltipItem, data)
  39285. beforeLabel: helpers.noop,
  39286. label: function(tooltipItem, data) {
  39287. var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
  39288. return datasetLabel + ': ' + tooltipItem.yLabel;
  39289. },
  39290. labelColor: function(tooltipItem, chartInstance) {
  39291. var meta = chartInstance.getDatasetMeta(tooltipItem.datasetIndex);
  39292. var activeElement = meta.data[tooltipItem.index];
  39293. var view = activeElement._view;
  39294. return {
  39295. borderColor: view.borderColor,
  39296. backgroundColor: view.backgroundColor
  39297. };
  39298. },
  39299. afterLabel: helpers.noop,
  39300. // Args are: (tooltipItems, data)
  39301. afterBody: helpers.noop,
  39302. // Args are: (tooltipItems, data)
  39303. beforeFooter: helpers.noop,
  39304. footer: helpers.noop,
  39305. afterFooter: helpers.noop
  39306. }
  39307. };
  39308. // Helper to push or concat based on if the 2nd parameter is an array or not
  39309. function pushOrConcat(base, toPush) {
  39310. if (toPush) {
  39311. if (helpers.isArray(toPush)) {
  39312. // base = base.concat(toPush);
  39313. Array.prototype.push.apply(base, toPush);
  39314. } else {
  39315. base.push(toPush);
  39316. }
  39317. }
  39318. return base;
  39319. }
  39320. // Private helper to create a tooltip item model
  39321. // @param element : the chart element (point, arc, bar) to create the tooltip item for
  39322. // @return : new tooltip item
  39323. function createTooltipItem(element) {
  39324. var xScale = element._xScale;
  39325. var yScale = element._yScale || element._scale; // handle radar || polarArea charts
  39326. var index = element._index,
  39327. datasetIndex = element._datasetIndex;
  39328. return {
  39329. xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
  39330. yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',
  39331. index: index,
  39332. datasetIndex: datasetIndex,
  39333. x: element._model.x,
  39334. y: element._model.y
  39335. };
  39336. }
  39337. /**
  39338. * Helper to get the reset model for the tooltip
  39339. * @param tooltipOpts {Object} the tooltip options
  39340. */
  39341. function getBaseModel(tooltipOpts) {
  39342. var globalDefaults = Chart.defaults.global;
  39343. var getValueOrDefault = helpers.getValueOrDefault;
  39344. return {
  39345. // Positioning
  39346. xPadding: tooltipOpts.xPadding,
  39347. yPadding: tooltipOpts.yPadding,
  39348. xAlign: tooltipOpts.xAlign,
  39349. yAlign: tooltipOpts.yAlign,
  39350. // Body
  39351. bodyFontColor: tooltipOpts.bodyFontColor,
  39352. _bodyFontFamily: getValueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),
  39353. _bodyFontStyle: getValueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),
  39354. _bodyAlign: tooltipOpts.bodyAlign,
  39355. bodyFontSize: getValueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),
  39356. bodySpacing: tooltipOpts.bodySpacing,
  39357. // Title
  39358. titleFontColor: tooltipOpts.titleFontColor,
  39359. _titleFontFamily: getValueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),
  39360. _titleFontStyle: getValueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),
  39361. titleFontSize: getValueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),
  39362. _titleAlign: tooltipOpts.titleAlign,
  39363. titleSpacing: tooltipOpts.titleSpacing,
  39364. titleMarginBottom: tooltipOpts.titleMarginBottom,
  39365. // Footer
  39366. footerFontColor: tooltipOpts.footerFontColor,
  39367. _footerFontFamily: getValueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),
  39368. _footerFontStyle: getValueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),
  39369. footerFontSize: getValueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),
  39370. _footerAlign: tooltipOpts.footerAlign,
  39371. footerSpacing: tooltipOpts.footerSpacing,
  39372. footerMarginTop: tooltipOpts.footerMarginTop,
  39373. // Appearance
  39374. caretSize: tooltipOpts.caretSize,
  39375. cornerRadius: tooltipOpts.cornerRadius,
  39376. backgroundColor: tooltipOpts.backgroundColor,
  39377. opacity: 0,
  39378. legendColorBackground: tooltipOpts.multiKeyBackground,
  39379. displayColors: tooltipOpts.displayColors
  39380. };
  39381. }
  39382. /**
  39383. * Get the size of the tooltip
  39384. */
  39385. function getTooltipSize(tooltip, model) {
  39386. var ctx = tooltip._chart.ctx;
  39387. var height = model.yPadding * 2; // Tooltip Padding
  39388. var width = 0;
  39389. // Count of all lines in the body
  39390. var body = model.body;
  39391. var combinedBodyLength = body.reduce(function(count, bodyItem) {
  39392. return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;
  39393. }, 0);
  39394. combinedBodyLength += model.beforeBody.length + model.afterBody.length;
  39395. var titleLineCount = model.title.length;
  39396. var footerLineCount = model.footer.length;
  39397. var titleFontSize = model.titleFontSize,
  39398. bodyFontSize = model.bodyFontSize,
  39399. footerFontSize = model.footerFontSize;
  39400. height += titleLineCount * titleFontSize; // Title Lines
  39401. height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing
  39402. height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin
  39403. height += combinedBodyLength * bodyFontSize; // Body Lines
  39404. height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing
  39405. height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin
  39406. height += footerLineCount * (footerFontSize); // Footer Lines
  39407. height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing
  39408. // Title width
  39409. var widthPadding = 0;
  39410. var maxLineWidth = function(line) {
  39411. width = Math.max(width, ctx.measureText(line).width + widthPadding);
  39412. };
  39413. ctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);
  39414. helpers.each(model.title, maxLineWidth);
  39415. // Body width
  39416. ctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);
  39417. helpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);
  39418. // Body lines may include some extra width due to the color box
  39419. widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;
  39420. helpers.each(body, function(bodyItem) {
  39421. helpers.each(bodyItem.before, maxLineWidth);
  39422. helpers.each(bodyItem.lines, maxLineWidth);
  39423. helpers.each(bodyItem.after, maxLineWidth);
  39424. });
  39425. // Reset back to 0
  39426. widthPadding = 0;
  39427. // Footer width
  39428. ctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);
  39429. helpers.each(model.footer, maxLineWidth);
  39430. // Add padding
  39431. width += 2 * model.xPadding;
  39432. return {
  39433. width: width,
  39434. height: height
  39435. };
  39436. }
  39437. /**
  39438. * Helper to get the alignment of a tooltip given the size
  39439. */
  39440. function determineAlignment(tooltip, size) {
  39441. var model = tooltip._model;
  39442. var chart = tooltip._chart;
  39443. var chartArea = tooltip._chartInstance.chartArea;
  39444. var xAlign = 'center';
  39445. var yAlign = 'center';
  39446. if (model.y < size.height) {
  39447. yAlign = 'top';
  39448. } else if (model.y > (chart.height - size.height)) {
  39449. yAlign = 'bottom';
  39450. }
  39451. var lf, rf; // functions to determine left, right alignment
  39452. var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart
  39453. var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges
  39454. var midX = (chartArea.left + chartArea.right) / 2;
  39455. var midY = (chartArea.top + chartArea.bottom) / 2;
  39456. if (yAlign === 'center') {
  39457. lf = function(x) {
  39458. return x <= midX;
  39459. };
  39460. rf = function(x) {
  39461. return x > midX;
  39462. };
  39463. } else {
  39464. lf = function(x) {
  39465. return x <= (size.width / 2);
  39466. };
  39467. rf = function(x) {
  39468. return x >= (chart.width - (size.width / 2));
  39469. };
  39470. }
  39471. olf = function(x) {
  39472. return x + size.width > chart.width;
  39473. };
  39474. orf = function(x) {
  39475. return x - size.width < 0;
  39476. };
  39477. yf = function(y) {
  39478. return y <= midY ? 'top' : 'bottom';
  39479. };
  39480. if (lf(model.x)) {
  39481. xAlign = 'left';
  39482. // Is tooltip too wide and goes over the right side of the chart.?
  39483. if (olf(model.x)) {
  39484. xAlign = 'center';
  39485. yAlign = yf(model.y);
  39486. }
  39487. } else if (rf(model.x)) {
  39488. xAlign = 'right';
  39489. // Is tooltip too wide and goes outside left edge of canvas?
  39490. if (orf(model.x)) {
  39491. xAlign = 'center';
  39492. yAlign = yf(model.y);
  39493. }
  39494. }
  39495. var opts = tooltip._options;
  39496. return {
  39497. xAlign: opts.xAlign ? opts.xAlign : xAlign,
  39498. yAlign: opts.yAlign ? opts.yAlign : yAlign
  39499. };
  39500. }
  39501. /**
  39502. * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment
  39503. */
  39504. function getBackgroundPoint(vm, size, alignment) {
  39505. // Background Position
  39506. var x = vm.x;
  39507. var y = vm.y;
  39508. var caretSize = vm.caretSize,
  39509. caretPadding = vm.caretPadding,
  39510. cornerRadius = vm.cornerRadius,
  39511. xAlign = alignment.xAlign,
  39512. yAlign = alignment.yAlign,
  39513. paddingAndSize = caretSize + caretPadding,
  39514. radiusAndPadding = cornerRadius + caretPadding;
  39515. if (xAlign === 'right') {
  39516. x -= size.width;
  39517. } else if (xAlign === 'center') {
  39518. x -= (size.width / 2);
  39519. }
  39520. if (yAlign === 'top') {
  39521. y += paddingAndSize;
  39522. } else if (yAlign === 'bottom') {
  39523. y -= size.height + paddingAndSize;
  39524. } else {
  39525. y -= (size.height / 2);
  39526. }
  39527. if (yAlign === 'center') {
  39528. if (xAlign === 'left') {
  39529. x += paddingAndSize;
  39530. } else if (xAlign === 'right') {
  39531. x -= paddingAndSize;
  39532. }
  39533. } else if (xAlign === 'left') {
  39534. x -= radiusAndPadding;
  39535. } else if (xAlign === 'right') {
  39536. x += radiusAndPadding;
  39537. }
  39538. return {
  39539. x: x,
  39540. y: y
  39541. };
  39542. }
  39543. Chart.Tooltip = Chart.Element.extend({
  39544. initialize: function() {
  39545. this._model = getBaseModel(this._options);
  39546. },
  39547. // Get the title
  39548. // Args are: (tooltipItem, data)
  39549. getTitle: function() {
  39550. var me = this;
  39551. var opts = me._options;
  39552. var callbacks = opts.callbacks;
  39553. var beforeTitle = callbacks.beforeTitle.apply(me, arguments),
  39554. title = callbacks.title.apply(me, arguments),
  39555. afterTitle = callbacks.afterTitle.apply(me, arguments);
  39556. var lines = [];
  39557. lines = pushOrConcat(lines, beforeTitle);
  39558. lines = pushOrConcat(lines, title);
  39559. lines = pushOrConcat(lines, afterTitle);
  39560. return lines;
  39561. },
  39562. // Args are: (tooltipItem, data)
  39563. getBeforeBody: function() {
  39564. var lines = this._options.callbacks.beforeBody.apply(this, arguments);
  39565. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39566. },
  39567. // Args are: (tooltipItem, data)
  39568. getBody: function(tooltipItems, data) {
  39569. var me = this;
  39570. var callbacks = me._options.callbacks;
  39571. var bodyItems = [];
  39572. helpers.each(tooltipItems, function(tooltipItem) {
  39573. var bodyItem = {
  39574. before: [],
  39575. lines: [],
  39576. after: []
  39577. };
  39578. pushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));
  39579. pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));
  39580. pushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));
  39581. bodyItems.push(bodyItem);
  39582. });
  39583. return bodyItems;
  39584. },
  39585. // Args are: (tooltipItem, data)
  39586. getAfterBody: function() {
  39587. var lines = this._options.callbacks.afterBody.apply(this, arguments);
  39588. return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];
  39589. },
  39590. // Get the footer and beforeFooter and afterFooter lines
  39591. // Args are: (tooltipItem, data)
  39592. getFooter: function() {
  39593. var me = this;
  39594. var callbacks = me._options.callbacks;
  39595. var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
  39596. var footer = callbacks.footer.apply(me, arguments);
  39597. var afterFooter = callbacks.afterFooter.apply(me, arguments);
  39598. var lines = [];
  39599. lines = pushOrConcat(lines, beforeFooter);
  39600. lines = pushOrConcat(lines, footer);
  39601. lines = pushOrConcat(lines, afterFooter);
  39602. return lines;
  39603. },
  39604. update: function(changed) {
  39605. var me = this;
  39606. var opts = me._options;
  39607. // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
  39608. // that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time
  39609. // which breaks any animations.
  39610. var existingModel = me._model;
  39611. var model = me._model = getBaseModel(opts);
  39612. var active = me._active;
  39613. var data = me._data;
  39614. var chartInstance = me._chartInstance;
  39615. // In the case where active.length === 0 we need to keep these at existing values for good animations
  39616. var alignment = {
  39617. xAlign: existingModel.xAlign,
  39618. yAlign: existingModel.yAlign
  39619. };
  39620. var backgroundPoint = {
  39621. x: existingModel.x,
  39622. y: existingModel.y
  39623. };
  39624. var tooltipSize = {
  39625. width: existingModel.width,
  39626. height: existingModel.height
  39627. };
  39628. var tooltipPosition = {
  39629. x: existingModel.caretX,
  39630. y: existingModel.caretY
  39631. };
  39632. var i, len;
  39633. if (active.length) {
  39634. model.opacity = 1;
  39635. var labelColors = [];
  39636. tooltipPosition = Chart.Tooltip.positioners[opts.position](active, me._eventPosition);
  39637. var tooltipItems = [];
  39638. for (i = 0, len = active.length; i < len; ++i) {
  39639. tooltipItems.push(createTooltipItem(active[i]));
  39640. }
  39641. // If the user provided a filter function, use it to modify the tooltip items
  39642. if (opts.filter) {
  39643. tooltipItems = tooltipItems.filter(function(a) {
  39644. return opts.filter(a, data);
  39645. });
  39646. }
  39647. // If the user provided a sorting function, use it to modify the tooltip items
  39648. if (opts.itemSort) {
  39649. tooltipItems = tooltipItems.sort(function(a, b) {
  39650. return opts.itemSort(a, b, data);
  39651. });
  39652. }
  39653. // Determine colors for boxes
  39654. helpers.each(tooltipItems, function(tooltipItem) {
  39655. labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, chartInstance));
  39656. });
  39657. // Build the Text Lines
  39658. model.title = me.getTitle(tooltipItems, data);
  39659. model.beforeBody = me.getBeforeBody(tooltipItems, data);
  39660. model.body = me.getBody(tooltipItems, data);
  39661. model.afterBody = me.getAfterBody(tooltipItems, data);
  39662. model.footer = me.getFooter(tooltipItems, data);
  39663. // Initial positioning and colors
  39664. model.x = Math.round(tooltipPosition.x);
  39665. model.y = Math.round(tooltipPosition.y);
  39666. model.caretPadding = helpers.getValueOrDefault(tooltipPosition.padding, 2);
  39667. model.labelColors = labelColors;
  39668. // data points
  39669. model.dataPoints = tooltipItems;
  39670. // We need to determine alignment of the tooltip
  39671. tooltipSize = getTooltipSize(this, model);
  39672. alignment = determineAlignment(this, tooltipSize);
  39673. // Final Size and Position
  39674. backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment);
  39675. } else {
  39676. model.opacity = 0;
  39677. }
  39678. model.xAlign = alignment.xAlign;
  39679. model.yAlign = alignment.yAlign;
  39680. model.x = backgroundPoint.x;
  39681. model.y = backgroundPoint.y;
  39682. model.width = tooltipSize.width;
  39683. model.height = tooltipSize.height;
  39684. // Point where the caret on the tooltip points to
  39685. model.caretX = tooltipPosition.x;
  39686. model.caretY = tooltipPosition.y;
  39687. me._model = model;
  39688. if (changed && opts.custom) {
  39689. opts.custom.call(me, model);
  39690. }
  39691. return me;
  39692. },
  39693. drawCaret: function(tooltipPoint, size, opacity) {
  39694. var vm = this._view;
  39695. var ctx = this._chart.ctx;
  39696. var x1, x2, x3;
  39697. var y1, y2, y3;
  39698. var caretSize = vm.caretSize;
  39699. var cornerRadius = vm.cornerRadius;
  39700. var xAlign = vm.xAlign,
  39701. yAlign = vm.yAlign;
  39702. var ptX = tooltipPoint.x,
  39703. ptY = tooltipPoint.y;
  39704. var width = size.width,
  39705. height = size.height;
  39706. if (yAlign === 'center') {
  39707. // Left or right side
  39708. if (xAlign === 'left') {
  39709. x1 = ptX;
  39710. x2 = x1 - caretSize;
  39711. x3 = x1;
  39712. } else {
  39713. x1 = ptX + width;
  39714. x2 = x1 + caretSize;
  39715. x3 = x1;
  39716. }
  39717. y2 = ptY + (height / 2);
  39718. y1 = y2 - caretSize;
  39719. y3 = y2 + caretSize;
  39720. } else {
  39721. if (xAlign === 'left') {
  39722. x1 = ptX + cornerRadius;
  39723. x2 = x1 + caretSize;
  39724. x3 = x2 + caretSize;
  39725. } else if (xAlign === 'right') {
  39726. x1 = ptX + width - cornerRadius;
  39727. x2 = x1 - caretSize;
  39728. x3 = x2 - caretSize;
  39729. } else {
  39730. x2 = ptX + (width / 2);
  39731. x1 = x2 - caretSize;
  39732. x3 = x2 + caretSize;
  39733. }
  39734. if (yAlign === 'top') {
  39735. y1 = ptY;
  39736. y2 = y1 - caretSize;
  39737. y3 = y1;
  39738. } else {
  39739. y1 = ptY + height;
  39740. y2 = y1 + caretSize;
  39741. y3 = y1;
  39742. }
  39743. }
  39744. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  39745. ctx.beginPath();
  39746. ctx.moveTo(x1, y1);
  39747. ctx.lineTo(x2, y2);
  39748. ctx.lineTo(x3, y3);
  39749. ctx.closePath();
  39750. ctx.fill();
  39751. },
  39752. drawTitle: function(pt, vm, ctx, opacity) {
  39753. var title = vm.title;
  39754. if (title.length) {
  39755. ctx.textAlign = vm._titleAlign;
  39756. ctx.textBaseline = 'top';
  39757. var titleFontSize = vm.titleFontSize,
  39758. titleSpacing = vm.titleSpacing;
  39759. ctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);
  39760. ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);
  39761. var i, len;
  39762. for (i = 0, len = title.length; i < len; ++i) {
  39763. ctx.fillText(title[i], pt.x, pt.y);
  39764. pt.y += titleFontSize + titleSpacing; // Line Height and spacing
  39765. if (i + 1 === title.length) {
  39766. pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing
  39767. }
  39768. }
  39769. }
  39770. },
  39771. drawBody: function(pt, vm, ctx, opacity) {
  39772. var bodyFontSize = vm.bodyFontSize;
  39773. var bodySpacing = vm.bodySpacing;
  39774. var body = vm.body;
  39775. ctx.textAlign = vm._bodyAlign;
  39776. ctx.textBaseline = 'top';
  39777. var textColor = mergeOpacity(vm.bodyFontColor, opacity);
  39778. ctx.fillStyle = textColor;
  39779. ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
  39780. // Before Body
  39781. var xLinePadding = 0;
  39782. var fillLineOfText = function(line) {
  39783. ctx.fillText(line, pt.x + xLinePadding, pt.y);
  39784. pt.y += bodyFontSize + bodySpacing;
  39785. };
  39786. // Before body lines
  39787. helpers.each(vm.beforeBody, fillLineOfText);
  39788. var drawColorBoxes = vm.displayColors;
  39789. xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;
  39790. // Draw body lines now
  39791. helpers.each(body, function(bodyItem, i) {
  39792. helpers.each(bodyItem.before, fillLineOfText);
  39793. helpers.each(bodyItem.lines, function(line) {
  39794. // Draw Legend-like boxes if needed
  39795. if (drawColorBoxes) {
  39796. // Fill a white rect so that colours merge nicely if the opacity is < 1
  39797. ctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);
  39798. ctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  39799. // Border
  39800. ctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);
  39801. ctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);
  39802. // Inner square
  39803. ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);
  39804. ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);
  39805. ctx.fillStyle = textColor;
  39806. }
  39807. fillLineOfText(line);
  39808. });
  39809. helpers.each(bodyItem.after, fillLineOfText);
  39810. });
  39811. // Reset back to 0 for after body
  39812. xLinePadding = 0;
  39813. // After body lines
  39814. helpers.each(vm.afterBody, fillLineOfText);
  39815. pt.y -= bodySpacing; // Remove last body spacing
  39816. },
  39817. drawFooter: function(pt, vm, ctx, opacity) {
  39818. var footer = vm.footer;
  39819. if (footer.length) {
  39820. pt.y += vm.footerMarginTop;
  39821. ctx.textAlign = vm._footerAlign;
  39822. ctx.textBaseline = 'top';
  39823. ctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);
  39824. ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);
  39825. helpers.each(footer, function(line) {
  39826. ctx.fillText(line, pt.x, pt.y);
  39827. pt.y += vm.footerFontSize + vm.footerSpacing;
  39828. });
  39829. }
  39830. },
  39831. drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {
  39832. ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);
  39833. helpers.drawRoundedRectangle(ctx, pt.x, pt.y, tooltipSize.width, tooltipSize.height, vm.cornerRadius);
  39834. ctx.fill();
  39835. },
  39836. draw: function() {
  39837. var ctx = this._chart.ctx;
  39838. var vm = this._view;
  39839. if (vm.opacity === 0) {
  39840. return;
  39841. }
  39842. var tooltipSize = {
  39843. width: vm.width,
  39844. height: vm.height
  39845. };
  39846. var pt = {
  39847. x: vm.x,
  39848. y: vm.y
  39849. };
  39850. // IE11/Edge does not like very small opacities, so snap to 0
  39851. var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;
  39852. if (this._options.enabled) {
  39853. // Draw Background
  39854. this.drawBackground(pt, vm, ctx, tooltipSize, opacity);
  39855. // Draw Caret
  39856. this.drawCaret(pt, tooltipSize, opacity);
  39857. // Draw Title, Body, and Footer
  39858. pt.x += vm.xPadding;
  39859. pt.y += vm.yPadding;
  39860. // Titles
  39861. this.drawTitle(pt, vm, ctx, opacity);
  39862. // Body
  39863. this.drawBody(pt, vm, ctx, opacity);
  39864. // Footer
  39865. this.drawFooter(pt, vm, ctx, opacity);
  39866. }
  39867. },
  39868. /**
  39869. * Handle an event
  39870. * @private
  39871. * @param {IEvent} event - The event to handle
  39872. * @returns {Boolean} true if the tooltip changed
  39873. */
  39874. handleEvent: function(e) {
  39875. var me = this;
  39876. var options = me._options;
  39877. var changed = false;
  39878. me._lastActive = me._lastActive || [];
  39879. // Find Active Elements for tooltips
  39880. if (e.type === 'mouseout') {
  39881. me._active = [];
  39882. } else {
  39883. me._active = me._chartInstance.getElementsAtEventForMode(e, options.mode, options);
  39884. }
  39885. // Remember Last Actives
  39886. changed = !helpers.arrayEquals(me._active, me._lastActive);
  39887. me._lastActive = me._active;
  39888. if (options.enabled || options.custom) {
  39889. me._eventPosition = {
  39890. x: e.x,
  39891. y: e.y
  39892. };
  39893. var model = me._model;
  39894. me.update(true);
  39895. me.pivot();
  39896. // See if our tooltip position changed
  39897. changed |= (model.x !== me._model.x) || (model.y !== me._model.y);
  39898. }
  39899. return changed;
  39900. }
  39901. });
  39902. /**
  39903. * @namespace Chart.Tooltip.positioners
  39904. */
  39905. Chart.Tooltip.positioners = {
  39906. /**
  39907. * Average mode places the tooltip at the average position of the elements shown
  39908. * @function Chart.Tooltip.positioners.average
  39909. * @param elements {ChartElement[]} the elements being displayed in the tooltip
  39910. * @returns {Point} tooltip position
  39911. */
  39912. average: function(elements) {
  39913. if (!elements.length) {
  39914. return false;
  39915. }
  39916. var i, len;
  39917. var x = 0;
  39918. var y = 0;
  39919. var count = 0;
  39920. for (i = 0, len = elements.length; i < len; ++i) {
  39921. var el = elements[i];
  39922. if (el && el.hasValue()) {
  39923. var pos = el.tooltipPosition();
  39924. x += pos.x;
  39925. y += pos.y;
  39926. ++count;
  39927. }
  39928. }
  39929. return {
  39930. x: Math.round(x / count),
  39931. y: Math.round(y / count)
  39932. };
  39933. },
  39934. /**
  39935. * Gets the tooltip position nearest of the item nearest to the event position
  39936. * @function Chart.Tooltip.positioners.nearest
  39937. * @param elements {Chart.Element[]} the tooltip elements
  39938. * @param eventPosition {Point} the position of the event in canvas coordinates
  39939. * @returns {Point} the tooltip position
  39940. */
  39941. nearest: function(elements, eventPosition) {
  39942. var x = eventPosition.x;
  39943. var y = eventPosition.y;
  39944. var nearestElement;
  39945. var minDistance = Number.POSITIVE_INFINITY;
  39946. var i, len;
  39947. for (i = 0, len = elements.length; i < len; ++i) {
  39948. var el = elements[i];
  39949. if (el && el.hasValue()) {
  39950. var center = el.getCenterPoint();
  39951. var d = helpers.distanceBetweenPoints(eventPosition, center);
  39952. if (d < minDistance) {
  39953. minDistance = d;
  39954. nearestElement = el;
  39955. }
  39956. }
  39957. }
  39958. if (nearestElement) {
  39959. var tp = nearestElement.tooltipPosition();
  39960. x = tp.x;
  39961. y = tp.y;
  39962. }
  39963. return {
  39964. x: x,
  39965. y: y
  39966. };
  39967. }
  39968. };
  39969. };
  39970. /***/ }),
  39971. /* 155 */
  39972. /***/ (function(module, exports, __webpack_require__) {
  39973. "use strict";
  39974. module.exports = function(Chart) {
  39975. var helpers = Chart.helpers,
  39976. globalOpts = Chart.defaults.global;
  39977. globalOpts.elements.arc = {
  39978. backgroundColor: globalOpts.defaultColor,
  39979. borderColor: '#fff',
  39980. borderWidth: 2
  39981. };
  39982. Chart.elements.Arc = Chart.Element.extend({
  39983. inLabelRange: function(mouseX) {
  39984. var vm = this._view;
  39985. if (vm) {
  39986. return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));
  39987. }
  39988. return false;
  39989. },
  39990. inRange: function(chartX, chartY) {
  39991. var vm = this._view;
  39992. if (vm) {
  39993. var pointRelativePosition = helpers.getAngleFromPoint(vm, {
  39994. x: chartX,
  39995. y: chartY
  39996. }),
  39997. angle = pointRelativePosition.angle,
  39998. distance = pointRelativePosition.distance;
  39999. // Sanitise angle range
  40000. var startAngle = vm.startAngle;
  40001. var endAngle = vm.endAngle;
  40002. while (endAngle < startAngle) {
  40003. endAngle += 2.0 * Math.PI;
  40004. }
  40005. while (angle > endAngle) {
  40006. angle -= 2.0 * Math.PI;
  40007. }
  40008. while (angle < startAngle) {
  40009. angle += 2.0 * Math.PI;
  40010. }
  40011. // Check if within the range of the open/close angle
  40012. var betweenAngles = (angle >= startAngle && angle <= endAngle),
  40013. withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);
  40014. return (betweenAngles && withinRadius);
  40015. }
  40016. return false;
  40017. },
  40018. getCenterPoint: function() {
  40019. var vm = this._view;
  40020. var halfAngle = (vm.startAngle + vm.endAngle) / 2;
  40021. var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;
  40022. return {
  40023. x: vm.x + Math.cos(halfAngle) * halfRadius,
  40024. y: vm.y + Math.sin(halfAngle) * halfRadius
  40025. };
  40026. },
  40027. getArea: function() {
  40028. var vm = this._view;
  40029. return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));
  40030. },
  40031. tooltipPosition: function() {
  40032. var vm = this._view;
  40033. var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2),
  40034. rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;
  40035. return {
  40036. x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),
  40037. y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)
  40038. };
  40039. },
  40040. draw: function() {
  40041. var ctx = this._chart.ctx,
  40042. vm = this._view,
  40043. sA = vm.startAngle,
  40044. eA = vm.endAngle;
  40045. ctx.beginPath();
  40046. ctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);
  40047. ctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);
  40048. ctx.closePath();
  40049. ctx.strokeStyle = vm.borderColor;
  40050. ctx.lineWidth = vm.borderWidth;
  40051. ctx.fillStyle = vm.backgroundColor;
  40052. ctx.fill();
  40053. ctx.lineJoin = 'bevel';
  40054. if (vm.borderWidth) {
  40055. ctx.stroke();
  40056. }
  40057. }
  40058. });
  40059. };
  40060. /***/ }),
  40061. /* 156 */
  40062. /***/ (function(module, exports, __webpack_require__) {
  40063. "use strict";
  40064. module.exports = function(Chart) {
  40065. var helpers = Chart.helpers;
  40066. var globalDefaults = Chart.defaults.global;
  40067. Chart.defaults.global.elements.line = {
  40068. tension: 0.4,
  40069. backgroundColor: globalDefaults.defaultColor,
  40070. borderWidth: 3,
  40071. borderColor: globalDefaults.defaultColor,
  40072. borderCapStyle: 'butt',
  40073. borderDash: [],
  40074. borderDashOffset: 0.0,
  40075. borderJoinStyle: 'miter',
  40076. capBezierPoints: true,
  40077. fill: true, // do we fill in the area between the line and its base axis
  40078. };
  40079. Chart.elements.Line = Chart.Element.extend({
  40080. draw: function() {
  40081. var me = this;
  40082. var vm = me._view;
  40083. var spanGaps = vm.spanGaps;
  40084. var fillPoint = vm.scaleZero;
  40085. var loop = me._loop;
  40086. // Handle different fill modes for cartesian lines
  40087. if (!loop) {
  40088. if (vm.fill === 'top') {
  40089. fillPoint = vm.scaleTop;
  40090. } else if (vm.fill === 'bottom') {
  40091. fillPoint = vm.scaleBottom;
  40092. }
  40093. }
  40094. var ctx = me._chart.ctx;
  40095. ctx.save();
  40096. // Helper function to draw a line to a point
  40097. function lineToPoint(previousPoint, point) {
  40098. var pointVM = point._view;
  40099. if (point._view.steppedLine === true) {
  40100. ctx.lineTo(pointVM.x, previousPoint._view.y);
  40101. ctx.lineTo(pointVM.x, pointVM.y);
  40102. } else if (point._view.tension === 0) {
  40103. ctx.lineTo(pointVM.x, pointVM.y);
  40104. } else {
  40105. ctx.bezierCurveTo(
  40106. previousPoint._view.controlPointNextX,
  40107. previousPoint._view.controlPointNextY,
  40108. pointVM.controlPointPreviousX,
  40109. pointVM.controlPointPreviousY,
  40110. pointVM.x,
  40111. pointVM.y
  40112. );
  40113. }
  40114. }
  40115. var points = me._children.slice(); // clone array
  40116. var lastDrawnIndex = -1;
  40117. // If we are looping, adding the first point again
  40118. if (loop && points.length) {
  40119. points.push(points[0]);
  40120. }
  40121. var index, current, previous, currentVM;
  40122. // Fill Line
  40123. if (points.length && vm.fill) {
  40124. ctx.beginPath();
  40125. for (index = 0; index < points.length; ++index) {
  40126. current = points[index];
  40127. previous = helpers.previousItem(points, index);
  40128. currentVM = current._view;
  40129. // First point moves to it's starting position no matter what
  40130. if (index === 0) {
  40131. if (loop) {
  40132. ctx.moveTo(fillPoint.x, fillPoint.y);
  40133. } else {
  40134. ctx.moveTo(currentVM.x, fillPoint);
  40135. }
  40136. if (!currentVM.skip) {
  40137. lastDrawnIndex = index;
  40138. ctx.lineTo(currentVM.x, currentVM.y);
  40139. }
  40140. } else {
  40141. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  40142. if (currentVM.skip) {
  40143. // Only do this if this is the first point that is skipped
  40144. if (!spanGaps && lastDrawnIndex === (index - 1)) {
  40145. if (loop) {
  40146. ctx.lineTo(fillPoint.x, fillPoint.y);
  40147. } else {
  40148. ctx.lineTo(previous._view.x, fillPoint);
  40149. }
  40150. }
  40151. } else {
  40152. if (lastDrawnIndex !== (index - 1)) {
  40153. // There was a gap and this is the first point after the gap. If we've never drawn a point, this is a special case.
  40154. // If the first data point is NaN, then there is no real gap to skip
  40155. if (spanGaps && lastDrawnIndex !== -1) {
  40156. // We are spanning the gap, so simple draw a line to this point
  40157. lineToPoint(previous, current);
  40158. } else if (loop) {
  40159. ctx.lineTo(currentVM.x, currentVM.y);
  40160. } else {
  40161. ctx.lineTo(currentVM.x, fillPoint);
  40162. ctx.lineTo(currentVM.x, currentVM.y);
  40163. }
  40164. } else {
  40165. // Line to next point
  40166. lineToPoint(previous, current);
  40167. }
  40168. lastDrawnIndex = index;
  40169. }
  40170. }
  40171. }
  40172. if (!loop && lastDrawnIndex !== -1) {
  40173. ctx.lineTo(points[lastDrawnIndex]._view.x, fillPoint);
  40174. }
  40175. ctx.fillStyle = vm.backgroundColor || globalDefaults.defaultColor;
  40176. ctx.closePath();
  40177. ctx.fill();
  40178. }
  40179. // Stroke Line Options
  40180. var globalOptionLineElements = globalDefaults.elements.line;
  40181. ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;
  40182. // IE 9 and 10 do not support line dash
  40183. if (ctx.setLineDash) {
  40184. ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);
  40185. }
  40186. ctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;
  40187. ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;
  40188. ctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;
  40189. ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;
  40190. // Stroke Line
  40191. ctx.beginPath();
  40192. lastDrawnIndex = -1;
  40193. for (index = 0; index < points.length; ++index) {
  40194. current = points[index];
  40195. previous = helpers.previousItem(points, index);
  40196. currentVM = current._view;
  40197. // First point moves to it's starting position no matter what
  40198. if (index === 0) {
  40199. if (!currentVM.skip) {
  40200. ctx.moveTo(currentVM.x, currentVM.y);
  40201. lastDrawnIndex = index;
  40202. }
  40203. } else {
  40204. previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];
  40205. if (!currentVM.skip) {
  40206. if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {
  40207. // There was a gap and this is the first point after the gap
  40208. ctx.moveTo(currentVM.x, currentVM.y);
  40209. } else {
  40210. // Line to next point
  40211. lineToPoint(previous, current);
  40212. }
  40213. lastDrawnIndex = index;
  40214. }
  40215. }
  40216. }
  40217. ctx.stroke();
  40218. ctx.restore();
  40219. }
  40220. });
  40221. };
  40222. /***/ }),
  40223. /* 157 */
  40224. /***/ (function(module, exports, __webpack_require__) {
  40225. "use strict";
  40226. module.exports = function(Chart) {
  40227. var helpers = Chart.helpers,
  40228. globalOpts = Chart.defaults.global,
  40229. defaultColor = globalOpts.defaultColor;
  40230. globalOpts.elements.point = {
  40231. radius: 3,
  40232. pointStyle: 'circle',
  40233. backgroundColor: defaultColor,
  40234. borderWidth: 1,
  40235. borderColor: defaultColor,
  40236. // Hover
  40237. hitRadius: 1,
  40238. hoverRadius: 4,
  40239. hoverBorderWidth: 1
  40240. };
  40241. function xRange(mouseX) {
  40242. var vm = this._view;
  40243. return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  40244. }
  40245. function yRange(mouseY) {
  40246. var vm = this._view;
  40247. return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;
  40248. }
  40249. Chart.elements.Point = Chart.Element.extend({
  40250. inRange: function(mouseX, mouseY) {
  40251. var vm = this._view;
  40252. return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
  40253. },
  40254. inLabelRange: xRange,
  40255. inXRange: xRange,
  40256. inYRange: yRange,
  40257. getCenterPoint: function() {
  40258. var vm = this._view;
  40259. return {
  40260. x: vm.x,
  40261. y: vm.y
  40262. };
  40263. },
  40264. getArea: function() {
  40265. return Math.PI * Math.pow(this._view.radius, 2);
  40266. },
  40267. tooltipPosition: function() {
  40268. var vm = this._view;
  40269. return {
  40270. x: vm.x,
  40271. y: vm.y,
  40272. padding: vm.radius + vm.borderWidth
  40273. };
  40274. },
  40275. draw: function(chartArea) {
  40276. var vm = this._view;
  40277. var model = this._model;
  40278. var ctx = this._chart.ctx;
  40279. var pointStyle = vm.pointStyle;
  40280. var radius = vm.radius;
  40281. var x = vm.x;
  40282. var y = vm.y;
  40283. var color = Chart.helpers.color;
  40284. var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)
  40285. var ratio = 0;
  40286. if (vm.skip) {
  40287. return;
  40288. }
  40289. ctx.strokeStyle = vm.borderColor || defaultColor;
  40290. ctx.lineWidth = helpers.getValueOrDefault(vm.borderWidth, globalOpts.elements.point.borderWidth);
  40291. ctx.fillStyle = vm.backgroundColor || defaultColor;
  40292. // Cliping for Points.
  40293. // going out from inner charArea?
  40294. if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right*errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom*errMargin < model.y))) {
  40295. // Point fade out
  40296. if (model.x < chartArea.left) {
  40297. ratio = (x - model.x) / (chartArea.left - model.x);
  40298. } else if (chartArea.right*errMargin < model.x) {
  40299. ratio = (model.x - x) / (model.x - chartArea.right);
  40300. } else if (model.y < chartArea.top) {
  40301. ratio = (y - model.y) / (chartArea.top - model.y);
  40302. } else if (chartArea.bottom*errMargin < model.y) {
  40303. ratio = (model.y - y) / (model.y - chartArea.bottom);
  40304. }
  40305. ratio = Math.round(ratio*100) / 100;
  40306. ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();
  40307. ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();
  40308. }
  40309. Chart.canvasHelpers.drawPoint(ctx, pointStyle, radius, x, y);
  40310. }
  40311. });
  40312. };
  40313. /***/ }),
  40314. /* 158 */
  40315. /***/ (function(module, exports, __webpack_require__) {
  40316. "use strict";
  40317. module.exports = function(Chart) {
  40318. var globalOpts = Chart.defaults.global;
  40319. globalOpts.elements.rectangle = {
  40320. backgroundColor: globalOpts.defaultColor,
  40321. borderWidth: 0,
  40322. borderColor: globalOpts.defaultColor,
  40323. borderSkipped: 'bottom'
  40324. };
  40325. function isVertical(bar) {
  40326. return bar._view.width !== undefined;
  40327. }
  40328. /**
  40329. * Helper function to get the bounds of the bar regardless of the orientation
  40330. * @private
  40331. * @param bar {Chart.Element.Rectangle} the bar
  40332. * @return {Bounds} bounds of the bar
  40333. */
  40334. function getBarBounds(bar) {
  40335. var vm = bar._view;
  40336. var x1, x2, y1, y2;
  40337. if (isVertical(bar)) {
  40338. // vertical
  40339. var halfWidth = vm.width / 2;
  40340. x1 = vm.x - halfWidth;
  40341. x2 = vm.x + halfWidth;
  40342. y1 = Math.min(vm.y, vm.base);
  40343. y2 = Math.max(vm.y, vm.base);
  40344. } else {
  40345. // horizontal bar
  40346. var halfHeight = vm.height / 2;
  40347. x1 = Math.min(vm.x, vm.base);
  40348. x2 = Math.max(vm.x, vm.base);
  40349. y1 = vm.y - halfHeight;
  40350. y2 = vm.y + halfHeight;
  40351. }
  40352. return {
  40353. left: x1,
  40354. top: y1,
  40355. right: x2,
  40356. bottom: y2
  40357. };
  40358. }
  40359. Chart.elements.Rectangle = Chart.Element.extend({
  40360. draw: function() {
  40361. var ctx = this._chart.ctx;
  40362. var vm = this._view;
  40363. var left, right, top, bottom, signX, signY, borderSkipped;
  40364. var borderWidth = vm.borderWidth;
  40365. if (!vm.horizontal) {
  40366. // bar
  40367. left = vm.x - vm.width / 2;
  40368. right = vm.x + vm.width / 2;
  40369. top = vm.y;
  40370. bottom = vm.base;
  40371. signX = 1;
  40372. signY = bottom > top? 1: -1;
  40373. borderSkipped = vm.borderSkipped || 'bottom';
  40374. } else {
  40375. // horizontal bar
  40376. left = vm.base;
  40377. right = vm.x;
  40378. top = vm.y - vm.height / 2;
  40379. bottom = vm.y + vm.height / 2;
  40380. signX = right > left? 1: -1;
  40381. signY = 1;
  40382. borderSkipped = vm.borderSkipped || 'left';
  40383. }
  40384. // Canvas doesn't allow us to stroke inside the width so we can
  40385. // adjust the sizes to fit if we're setting a stroke on the line
  40386. if (borderWidth) {
  40387. // borderWidth shold be less than bar width and bar height.
  40388. var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));
  40389. borderWidth = borderWidth > barSize? barSize: borderWidth;
  40390. var halfStroke = borderWidth / 2;
  40391. // Adjust borderWidth when bar top position is near vm.base(zero).
  40392. var borderLeft = left + (borderSkipped !== 'left'? halfStroke * signX: 0);
  40393. var borderRight = right + (borderSkipped !== 'right'? -halfStroke * signX: 0);
  40394. var borderTop = top + (borderSkipped !== 'top'? halfStroke * signY: 0);
  40395. var borderBottom = bottom + (borderSkipped !== 'bottom'? -halfStroke * signY: 0);
  40396. // not become a vertical line?
  40397. if (borderLeft !== borderRight) {
  40398. top = borderTop;
  40399. bottom = borderBottom;
  40400. }
  40401. // not become a horizontal line?
  40402. if (borderTop !== borderBottom) {
  40403. left = borderLeft;
  40404. right = borderRight;
  40405. }
  40406. }
  40407. ctx.beginPath();
  40408. ctx.fillStyle = vm.backgroundColor;
  40409. ctx.strokeStyle = vm.borderColor;
  40410. ctx.lineWidth = borderWidth;
  40411. // Corner points, from bottom-left to bottom-right clockwise
  40412. // | 1 2 |
  40413. // | 0 3 |
  40414. var corners = [
  40415. [left, bottom],
  40416. [left, top],
  40417. [right, top],
  40418. [right, bottom]
  40419. ];
  40420. // Find first (starting) corner with fallback to 'bottom'
  40421. var borders = ['bottom', 'left', 'top', 'right'];
  40422. var startCorner = borders.indexOf(borderSkipped, 0);
  40423. if (startCorner === -1) {
  40424. startCorner = 0;
  40425. }
  40426. function cornerAt(index) {
  40427. return corners[(startCorner + index) % 4];
  40428. }
  40429. // Draw rectangle from 'startCorner'
  40430. var corner = cornerAt(0);
  40431. ctx.moveTo(corner[0], corner[1]);
  40432. for (var i = 1; i < 4; i++) {
  40433. corner = cornerAt(i);
  40434. ctx.lineTo(corner[0], corner[1]);
  40435. }
  40436. ctx.fill();
  40437. if (borderWidth) {
  40438. ctx.stroke();
  40439. }
  40440. },
  40441. height: function() {
  40442. var vm = this._view;
  40443. return vm.base - vm.y;
  40444. },
  40445. inRange: function(mouseX, mouseY) {
  40446. var inRange = false;
  40447. if (this._view) {
  40448. var bounds = getBarBounds(this);
  40449. inRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;
  40450. }
  40451. return inRange;
  40452. },
  40453. inLabelRange: function(mouseX, mouseY) {
  40454. var me = this;
  40455. if (!me._view) {
  40456. return false;
  40457. }
  40458. var inRange = false;
  40459. var bounds = getBarBounds(me);
  40460. if (isVertical(me)) {
  40461. inRange = mouseX >= bounds.left && mouseX <= bounds.right;
  40462. } else {
  40463. inRange = mouseY >= bounds.top && mouseY <= bounds.bottom;
  40464. }
  40465. return inRange;
  40466. },
  40467. inXRange: function(mouseX) {
  40468. var bounds = getBarBounds(this);
  40469. return mouseX >= bounds.left && mouseX <= bounds.right;
  40470. },
  40471. inYRange: function(mouseY) {
  40472. var bounds = getBarBounds(this);
  40473. return mouseY >= bounds.top && mouseY <= bounds.bottom;
  40474. },
  40475. getCenterPoint: function() {
  40476. var vm = this._view;
  40477. var x, y;
  40478. if (isVertical(this)) {
  40479. x = vm.x;
  40480. y = (vm.y + vm.base) / 2;
  40481. } else {
  40482. x = (vm.x + vm.base) / 2;
  40483. y = vm.y;
  40484. }
  40485. return {x: x, y: y};
  40486. },
  40487. getArea: function() {
  40488. var vm = this._view;
  40489. return vm.width * Math.abs(vm.y - vm.base);
  40490. },
  40491. tooltipPosition: function() {
  40492. var vm = this._view;
  40493. return {
  40494. x: vm.x,
  40495. y: vm.y
  40496. };
  40497. }
  40498. });
  40499. };
  40500. /***/ }),
  40501. /* 159 */
  40502. /***/ (function(module, exports, __webpack_require__) {
  40503. "use strict";
  40504. // Chart.Platform implementation for targeting a web browser
  40505. module.exports = function(Chart) {
  40506. var helpers = Chart.helpers;
  40507. // DOM event types -> Chart.js event types.
  40508. // Note: only events with different types are mapped.
  40509. // https://developer.mozilla.org/en-US/docs/Web/Events
  40510. var eventTypeMap = {
  40511. // Touch events
  40512. touchstart: 'mousedown',
  40513. touchmove: 'mousemove',
  40514. touchend: 'mouseup',
  40515. // Pointer events
  40516. pointerenter: 'mouseenter',
  40517. pointerdown: 'mousedown',
  40518. pointermove: 'mousemove',
  40519. pointerup: 'mouseup',
  40520. pointerleave: 'mouseout',
  40521. pointerout: 'mouseout'
  40522. };
  40523. /**
  40524. * The "used" size is the final value of a dimension property after all calculations have
  40525. * been performed. This method uses the computed style of `element` but returns undefined
  40526. * if the computed style is not expressed in pixels. That can happen in some cases where
  40527. * `element` has a size relative to its parent and this last one is not yet displayed,
  40528. * for example because of `display: none` on a parent node.
  40529. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
  40530. * @returns {Number} Size in pixels or undefined if unknown.
  40531. */
  40532. function readUsedSize(element, property) {
  40533. var value = helpers.getStyle(element, property);
  40534. var matches = value && value.match(/(\d+)px/);
  40535. return matches? Number(matches[1]) : undefined;
  40536. }
  40537. /**
  40538. * Initializes the canvas style and render size without modifying the canvas display size,
  40539. * since responsiveness is handled by the controller.resize() method. The config is used
  40540. * to determine the aspect ratio to apply in case no explicit height has been specified.
  40541. */
  40542. function initCanvas(canvas, config) {
  40543. var style = canvas.style;
  40544. // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
  40545. // returns null or '' if no explicit value has been set to the canvas attribute.
  40546. var renderHeight = canvas.getAttribute('height');
  40547. var renderWidth = canvas.getAttribute('width');
  40548. // Chart.js modifies some canvas values that we want to restore on destroy
  40549. canvas._chartjs = {
  40550. initial: {
  40551. height: renderHeight,
  40552. width: renderWidth,
  40553. style: {
  40554. display: style.display,
  40555. height: style.height,
  40556. width: style.width
  40557. }
  40558. }
  40559. };
  40560. // Force canvas to display as block to avoid extra space caused by inline
  40561. // elements, which would interfere with the responsive resize process.
  40562. // https://github.com/chartjs/Chart.js/issues/2538
  40563. style.display = style.display || 'block';
  40564. if (renderWidth === null || renderWidth === '') {
  40565. var displayWidth = readUsedSize(canvas, 'width');
  40566. if (displayWidth !== undefined) {
  40567. canvas.width = displayWidth;
  40568. }
  40569. }
  40570. if (renderHeight === null || renderHeight === '') {
  40571. if (canvas.style.height === '') {
  40572. // If no explicit render height and style height, let's apply the aspect ratio,
  40573. // which one can be specified by the user but also by charts as default option
  40574. // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.
  40575. canvas.height = canvas.width / (config.options.aspectRatio || 2);
  40576. } else {
  40577. var displayHeight = readUsedSize(canvas, 'height');
  40578. if (displayWidth !== undefined) {
  40579. canvas.height = displayHeight;
  40580. }
  40581. }
  40582. }
  40583. return canvas;
  40584. }
  40585. function createEvent(type, chart, x, y, native) {
  40586. return {
  40587. type: type,
  40588. chart: chart,
  40589. native: native || null,
  40590. x: x !== undefined? x : null,
  40591. y: y !== undefined? y : null,
  40592. };
  40593. }
  40594. function fromNativeEvent(event, chart) {
  40595. var type = eventTypeMap[event.type] || event.type;
  40596. var pos = helpers.getRelativePosition(event, chart);
  40597. return createEvent(type, chart, pos.x, pos.y, event);
  40598. }
  40599. function createResizer(handler) {
  40600. var iframe = document.createElement('iframe');
  40601. iframe.className = 'chartjs-hidden-iframe';
  40602. iframe.style.cssText =
  40603. 'display:block;'+
  40604. 'overflow:hidden;'+
  40605. 'border:0;'+
  40606. 'margin:0;'+
  40607. 'top:0;'+
  40608. 'left:0;'+
  40609. 'bottom:0;'+
  40610. 'right:0;'+
  40611. 'height:100%;'+
  40612. 'width:100%;'+
  40613. 'position:absolute;'+
  40614. 'pointer-events:none;'+
  40615. 'z-index:-1;';
  40616. // Prevent the iframe to gain focus on tab.
  40617. // https://github.com/chartjs/Chart.js/issues/3090
  40618. iframe.tabIndex = -1;
  40619. // If the iframe is re-attached to the DOM, the resize listener is removed because the
  40620. // content is reloaded, so make sure to install the handler after the iframe is loaded.
  40621. // https://github.com/chartjs/Chart.js/issues/3521
  40622. helpers.addEvent(iframe, 'load', function() {
  40623. helpers.addEvent(iframe.contentWindow || iframe, 'resize', handler);
  40624. // The iframe size might have changed while loading, which can also
  40625. // happen if the size has been changed while detached from the DOM.
  40626. handler();
  40627. });
  40628. return iframe;
  40629. }
  40630. function addResizeListener(node, listener, chart) {
  40631. var stub = node._chartjs = {
  40632. ticking: false
  40633. };
  40634. // Throttle the callback notification until the next animation frame.
  40635. var notify = function() {
  40636. if (!stub.ticking) {
  40637. stub.ticking = true;
  40638. helpers.requestAnimFrame.call(window, function() {
  40639. if (stub.resizer) {
  40640. stub.ticking = false;
  40641. return listener(createEvent('resize', chart));
  40642. }
  40643. });
  40644. }
  40645. };
  40646. // Let's keep track of this added iframe and thus avoid DOM query when removing it.
  40647. stub.resizer = createResizer(notify);
  40648. node.insertBefore(stub.resizer, node.firstChild);
  40649. }
  40650. function removeResizeListener(node) {
  40651. if (!node || !node._chartjs) {
  40652. return;
  40653. }
  40654. var resizer = node._chartjs.resizer;
  40655. if (resizer) {
  40656. resizer.parentNode.removeChild(resizer);
  40657. node._chartjs.resizer = null;
  40658. }
  40659. delete node._chartjs;
  40660. }
  40661. return {
  40662. acquireContext: function(item, config) {
  40663. if (typeof item === 'string') {
  40664. item = document.getElementById(item);
  40665. } else if (item.length) {
  40666. // Support for array based queries (such as jQuery)
  40667. item = item[0];
  40668. }
  40669. if (item && item.canvas) {
  40670. // Support for any object associated to a canvas (including a context2d)
  40671. item = item.canvas;
  40672. }
  40673. if (item instanceof HTMLCanvasElement) {
  40674. // To prevent canvas fingerprinting, some add-ons undefine the getContext
  40675. // method, for example: https://github.com/kkapsner/CanvasBlocker
  40676. // https://github.com/chartjs/Chart.js/issues/2807
  40677. var context = item.getContext && item.getContext('2d');
  40678. if (context instanceof CanvasRenderingContext2D) {
  40679. initCanvas(item, config);
  40680. return context;
  40681. }
  40682. }
  40683. return null;
  40684. },
  40685. releaseContext: function(context) {
  40686. var canvas = context.canvas;
  40687. if (!canvas._chartjs) {
  40688. return;
  40689. }
  40690. var initial = canvas._chartjs.initial;
  40691. ['height', 'width'].forEach(function(prop) {
  40692. var value = initial[prop];
  40693. if (value === undefined || value === null) {
  40694. canvas.removeAttribute(prop);
  40695. } else {
  40696. canvas.setAttribute(prop, value);
  40697. }
  40698. });
  40699. helpers.each(initial.style || {}, function(value, key) {
  40700. canvas.style[key] = value;
  40701. });
  40702. // The canvas render size might have been changed (and thus the state stack discarded),
  40703. // we can't use save() and restore() to restore the initial state. So make sure that at
  40704. // least the canvas context is reset to the default state by setting the canvas width.
  40705. // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
  40706. canvas.width = canvas.width;
  40707. delete canvas._chartjs;
  40708. },
  40709. addEventListener: function(chart, type, listener) {
  40710. var canvas = chart.chart.canvas;
  40711. if (type === 'resize') {
  40712. // Note: the resize event is not supported on all browsers.
  40713. addResizeListener(canvas.parentNode, listener, chart.chart);
  40714. return;
  40715. }
  40716. var stub = listener._chartjs || (listener._chartjs = {});
  40717. var proxies = stub.proxies || (stub.proxies = {});
  40718. var proxy = proxies[chart.id + '_' + type] = function(event) {
  40719. listener(fromNativeEvent(event, chart.chart));
  40720. };
  40721. helpers.addEvent(canvas, type, proxy);
  40722. },
  40723. removeEventListener: function(chart, type, listener) {
  40724. var canvas = chart.chart.canvas;
  40725. if (type === 'resize') {
  40726. // Note: the resize event is not supported on all browsers.
  40727. removeResizeListener(canvas.parentNode, listener);
  40728. return;
  40729. }
  40730. var stub = listener._chartjs || {};
  40731. var proxies = stub.proxies || {};
  40732. var proxy = proxies[chart.id + '_' + type];
  40733. if (!proxy) {
  40734. return;
  40735. }
  40736. helpers.removeEvent(canvas, type, proxy);
  40737. }
  40738. };
  40739. };
  40740. /***/ }),
  40741. /* 160 */
  40742. /***/ (function(module, exports, __webpack_require__) {
  40743. "use strict";
  40744. // By default, select the browser (DOM) platform.
  40745. // @TODO Make possible to select another platform at build time.
  40746. var implementation = __webpack_require__(159);
  40747. module.exports = function(Chart) {
  40748. /**
  40749. * @namespace Chart.platform
  40750. * @see https://chartjs.gitbooks.io/proposals/content/Platform.html
  40751. * @since 2.4.0
  40752. */
  40753. Chart.platform = {
  40754. /**
  40755. * Called at chart construction time, returns a context2d instance implementing
  40756. * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.
  40757. * @param {*} item - The native item from which to acquire context (platform specific)
  40758. * @param {Object} options - The chart options
  40759. * @returns {CanvasRenderingContext2D} context2d instance
  40760. */
  40761. acquireContext: function() {},
  40762. /**
  40763. * Called at chart destruction time, releases any resources associated to the context
  40764. * previously returned by the acquireContext() method.
  40765. * @param {CanvasRenderingContext2D} context - The context2d instance
  40766. * @returns {Boolean} true if the method succeeded, else false
  40767. */
  40768. releaseContext: function() {},
  40769. /**
  40770. * Registers the specified listener on the given chart.
  40771. * @param {Chart} chart - Chart from which to listen for event
  40772. * @param {String} type - The ({@link IEvent}) type to listen for
  40773. * @param {Function} listener - Receives a notification (an object that implements
  40774. * the {@link IEvent} interface) when an event of the specified type occurs.
  40775. */
  40776. addEventListener: function() {},
  40777. /**
  40778. * Removes the specified listener previously registered with addEventListener.
  40779. * @param {Chart} chart -Chart from which to remove the listener
  40780. * @param {String} type - The ({@link IEvent}) type to remove
  40781. * @param {Function} listener - The listener function to remove from the event target.
  40782. */
  40783. removeEventListener: function() {}
  40784. };
  40785. /**
  40786. * @interface IPlatform
  40787. * Allows abstracting platform dependencies away from the chart
  40788. * @borrows Chart.platform.acquireContext as acquireContext
  40789. * @borrows Chart.platform.releaseContext as releaseContext
  40790. * @borrows Chart.platform.addEventListener as addEventListener
  40791. * @borrows Chart.platform.removeEventListener as removeEventListener
  40792. */
  40793. /**
  40794. * @interface IEvent
  40795. * @prop {String} type - The event type name, possible values are:
  40796. * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',
  40797. * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'
  40798. * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')
  40799. * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)
  40800. * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)
  40801. */
  40802. Chart.helpers.extend(Chart.platform, implementation(Chart));
  40803. };
  40804. /***/ }),
  40805. /* 161 */
  40806. /***/ (function(module, exports, __webpack_require__) {
  40807. "use strict";
  40808. module.exports = function(Chart) {
  40809. var helpers = Chart.helpers;
  40810. // Default config for a category scale
  40811. var defaultConfig = {
  40812. position: 'bottom'
  40813. };
  40814. var DatasetScale = Chart.Scale.extend({
  40815. /**
  40816. * Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those
  40817. * else fall back to data.labels
  40818. * @private
  40819. */
  40820. getLabels: function() {
  40821. var data = this.chart.data;
  40822. return (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;
  40823. },
  40824. // Implement this so that
  40825. determineDataLimits: function() {
  40826. var me = this;
  40827. var labels = me.getLabels();
  40828. me.minIndex = 0;
  40829. me.maxIndex = labels.length - 1;
  40830. var findIndex;
  40831. if (me.options.ticks.min !== undefined) {
  40832. // user specified min value
  40833. findIndex = helpers.indexOf(labels, me.options.ticks.min);
  40834. me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
  40835. }
  40836. if (me.options.ticks.max !== undefined) {
  40837. // user specified max value
  40838. findIndex = helpers.indexOf(labels, me.options.ticks.max);
  40839. me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
  40840. }
  40841. me.min = labels[me.minIndex];
  40842. me.max = labels[me.maxIndex];
  40843. },
  40844. buildTicks: function() {
  40845. var me = this;
  40846. var labels = me.getLabels();
  40847. // If we are viewing some subset of labels, slice the original array
  40848. me.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);
  40849. },
  40850. getLabelForIndex: function(index, datasetIndex) {
  40851. var me = this;
  40852. var data = me.chart.data;
  40853. var isHorizontal = me.isHorizontal();
  40854. if (data.yLabels && !isHorizontal) {
  40855. return me.getRightValue(data.datasets[datasetIndex].data[index]);
  40856. }
  40857. return me.ticks[index - me.minIndex];
  40858. },
  40859. // Used to get data value locations. Value can either be an index or a numerical value
  40860. getPixelForValue: function(value, index, datasetIndex, includeOffset) {
  40861. var me = this;
  40862. // 1 is added because we need the length but we have the indexes
  40863. var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  40864. if (value !== undefined && isNaN(index)) {
  40865. var labels = me.getLabels();
  40866. var idx = labels.indexOf(value);
  40867. index = idx !== -1 ? idx : index;
  40868. }
  40869. if (me.isHorizontal()) {
  40870. var valueWidth = me.width / offsetAmt;
  40871. var widthOffset = (valueWidth * (index - me.minIndex));
  40872. if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) {
  40873. widthOffset += (valueWidth / 2);
  40874. }
  40875. return me.left + Math.round(widthOffset);
  40876. }
  40877. var valueHeight = me.height / offsetAmt;
  40878. var heightOffset = (valueHeight * (index - me.minIndex));
  40879. if (me.options.gridLines.offsetGridLines && includeOffset) {
  40880. heightOffset += (valueHeight / 2);
  40881. }
  40882. return me.top + Math.round(heightOffset);
  40883. },
  40884. getPixelForTick: function(index, includeOffset) {
  40885. return this.getPixelForValue(this.ticks[index], index + this.minIndex, null, includeOffset);
  40886. },
  40887. getValueForPixel: function(pixel) {
  40888. var me = this;
  40889. var value;
  40890. var offsetAmt = Math.max((me.ticks.length - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
  40891. var horz = me.isHorizontal();
  40892. var valueDimension = (horz ? me.width : me.height) / offsetAmt;
  40893. pixel -= horz ? me.left : me.top;
  40894. if (me.options.gridLines.offsetGridLines) {
  40895. pixel -= (valueDimension / 2);
  40896. }
  40897. if (pixel <= 0) {
  40898. value = 0;
  40899. } else {
  40900. value = Math.round(pixel / valueDimension);
  40901. }
  40902. return value;
  40903. },
  40904. getBasePixel: function() {
  40905. return this.bottom;
  40906. }
  40907. });
  40908. Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);
  40909. };
  40910. /***/ }),
  40911. /* 162 */
  40912. /***/ (function(module, exports, __webpack_require__) {
  40913. "use strict";
  40914. module.exports = function(Chart) {
  40915. var helpers = Chart.helpers;
  40916. var defaultConfig = {
  40917. position: 'left',
  40918. ticks: {
  40919. callback: Chart.Ticks.formatters.linear
  40920. }
  40921. };
  40922. var LinearScale = Chart.LinearScaleBase.extend({
  40923. determineDataLimits: function() {
  40924. var me = this;
  40925. var opts = me.options;
  40926. var chart = me.chart;
  40927. var data = chart.data;
  40928. var datasets = data.datasets;
  40929. var isHorizontal = me.isHorizontal();
  40930. function IDMatches(meta) {
  40931. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  40932. }
  40933. // First Calculate the range
  40934. me.min = null;
  40935. me.max = null;
  40936. var hasStacks = opts.stacked;
  40937. if (hasStacks === undefined) {
  40938. helpers.each(datasets, function(dataset, datasetIndex) {
  40939. if (hasStacks) {
  40940. return;
  40941. }
  40942. var meta = chart.getDatasetMeta(datasetIndex);
  40943. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  40944. meta.stack !== undefined) {
  40945. hasStacks = true;
  40946. }
  40947. });
  40948. }
  40949. if (opts.stacked || hasStacks) {
  40950. var valuesPerStack = {};
  40951. helpers.each(datasets, function(dataset, datasetIndex) {
  40952. var meta = chart.getDatasetMeta(datasetIndex);
  40953. var key = [
  40954. meta.type,
  40955. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  40956. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  40957. meta.stack
  40958. ].join('.');
  40959. if (valuesPerStack[key] === undefined) {
  40960. valuesPerStack[key] = {
  40961. positiveValues: [],
  40962. negativeValues: []
  40963. };
  40964. }
  40965. // Store these per type
  40966. var positiveValues = valuesPerStack[key].positiveValues;
  40967. var negativeValues = valuesPerStack[key].negativeValues;
  40968. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40969. helpers.each(dataset.data, function(rawValue, index) {
  40970. var value = +me.getRightValue(rawValue);
  40971. if (isNaN(value) || meta.data[index].hidden) {
  40972. return;
  40973. }
  40974. positiveValues[index] = positiveValues[index] || 0;
  40975. negativeValues[index] = negativeValues[index] || 0;
  40976. if (opts.relativePoints) {
  40977. positiveValues[index] = 100;
  40978. } else if (value < 0) {
  40979. negativeValues[index] += value;
  40980. } else {
  40981. positiveValues[index] += value;
  40982. }
  40983. });
  40984. }
  40985. });
  40986. helpers.each(valuesPerStack, function(valuesForType) {
  40987. var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);
  40988. var minVal = helpers.min(values);
  40989. var maxVal = helpers.max(values);
  40990. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  40991. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  40992. });
  40993. } else {
  40994. helpers.each(datasets, function(dataset, datasetIndex) {
  40995. var meta = chart.getDatasetMeta(datasetIndex);
  40996. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  40997. helpers.each(dataset.data, function(rawValue, index) {
  40998. var value = +me.getRightValue(rawValue);
  40999. if (isNaN(value) || meta.data[index].hidden) {
  41000. return;
  41001. }
  41002. if (me.min === null) {
  41003. me.min = value;
  41004. } else if (value < me.min) {
  41005. me.min = value;
  41006. }
  41007. if (me.max === null) {
  41008. me.max = value;
  41009. } else if (value > me.max) {
  41010. me.max = value;
  41011. }
  41012. });
  41013. }
  41014. });
  41015. }
  41016. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  41017. this.handleTickRangeOptions();
  41018. },
  41019. getTickLimit: function() {
  41020. var maxTicks;
  41021. var me = this;
  41022. var tickOpts = me.options.ticks;
  41023. if (me.isHorizontal()) {
  41024. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));
  41025. } else {
  41026. // The factor of 2 used to scale the font size has been experimentally determined.
  41027. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, Chart.defaults.global.defaultFontSize);
  41028. maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));
  41029. }
  41030. return maxTicks;
  41031. },
  41032. // Called after the ticks are built. We need
  41033. handleDirectionalChanges: function() {
  41034. if (!this.isHorizontal()) {
  41035. // We are in a vertical orientation. The top value is the highest. So reverse the array
  41036. this.ticks.reverse();
  41037. }
  41038. },
  41039. getLabelForIndex: function(index, datasetIndex) {
  41040. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41041. },
  41042. // Utils
  41043. getPixelForValue: function(value) {
  41044. // This must be called after fit has been run so that
  41045. // this.left, this.top, this.right, and this.bottom have been defined
  41046. var me = this;
  41047. var start = me.start;
  41048. var rightValue = +me.getRightValue(value);
  41049. var pixel;
  41050. var range = me.end - start;
  41051. if (me.isHorizontal()) {
  41052. pixel = me.left + (me.width / range * (rightValue - start));
  41053. return Math.round(pixel);
  41054. }
  41055. pixel = me.bottom - (me.height / range * (rightValue - start));
  41056. return Math.round(pixel);
  41057. },
  41058. getValueForPixel: function(pixel) {
  41059. var me = this;
  41060. var isHorizontal = me.isHorizontal();
  41061. var innerDimension = isHorizontal ? me.width : me.height;
  41062. var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;
  41063. return me.start + ((me.end - me.start) * offset);
  41064. },
  41065. getPixelForTick: function(index) {
  41066. return this.getPixelForValue(this.ticksAsNumbers[index]);
  41067. }
  41068. });
  41069. Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);
  41070. };
  41071. /***/ }),
  41072. /* 163 */
  41073. /***/ (function(module, exports, __webpack_require__) {
  41074. "use strict";
  41075. module.exports = function(Chart) {
  41076. var helpers = Chart.helpers,
  41077. noop = helpers.noop;
  41078. Chart.LinearScaleBase = Chart.Scale.extend({
  41079. handleTickRangeOptions: function() {
  41080. var me = this;
  41081. var opts = me.options;
  41082. var tickOpts = opts.ticks;
  41083. // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
  41084. // do nothing since that would make the chart weird. If the user really wants a weird chart
  41085. // axis, they can manually override it
  41086. if (tickOpts.beginAtZero) {
  41087. var minSign = helpers.sign(me.min);
  41088. var maxSign = helpers.sign(me.max);
  41089. if (minSign < 0 && maxSign < 0) {
  41090. // move the top up to 0
  41091. me.max = 0;
  41092. } else if (minSign > 0 && maxSign > 0) {
  41093. // move the bottom down to 0
  41094. me.min = 0;
  41095. }
  41096. }
  41097. if (tickOpts.min !== undefined) {
  41098. me.min = tickOpts.min;
  41099. } else if (tickOpts.suggestedMin !== undefined) {
  41100. me.min = Math.min(me.min, tickOpts.suggestedMin);
  41101. }
  41102. if (tickOpts.max !== undefined) {
  41103. me.max = tickOpts.max;
  41104. } else if (tickOpts.suggestedMax !== undefined) {
  41105. me.max = Math.max(me.max, tickOpts.suggestedMax);
  41106. }
  41107. if (me.min === me.max) {
  41108. me.max++;
  41109. if (!tickOpts.beginAtZero) {
  41110. me.min--;
  41111. }
  41112. }
  41113. },
  41114. getTickLimit: noop,
  41115. handleDirectionalChanges: noop,
  41116. buildTicks: function() {
  41117. var me = this;
  41118. var opts = me.options;
  41119. var tickOpts = opts.ticks;
  41120. // Figure out what the max number of ticks we can support it is based on the size of
  41121. // the axis area. For now, we say that the minimum tick spacing in pixels must be 50
  41122. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  41123. // the graph. Make sure we always have at least 2 ticks
  41124. var maxTicks = me.getTickLimit();
  41125. maxTicks = Math.max(2, maxTicks);
  41126. var numericGeneratorOptions = {
  41127. maxTicks: maxTicks,
  41128. min: tickOpts.min,
  41129. max: tickOpts.max,
  41130. stepSize: helpers.getValueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)
  41131. };
  41132. var ticks = me.ticks = Chart.Ticks.generators.linear(numericGeneratorOptions, me);
  41133. me.handleDirectionalChanges();
  41134. // At this point, we need to update our max and min given the tick values since we have expanded the
  41135. // range of the scale
  41136. me.max = helpers.max(ticks);
  41137. me.min = helpers.min(ticks);
  41138. if (tickOpts.reverse) {
  41139. ticks.reverse();
  41140. me.start = me.max;
  41141. me.end = me.min;
  41142. } else {
  41143. me.start = me.min;
  41144. me.end = me.max;
  41145. }
  41146. },
  41147. convertTicksToLabels: function() {
  41148. var me = this;
  41149. me.ticksAsNumbers = me.ticks.slice();
  41150. me.zeroLineIndex = me.ticks.indexOf(0);
  41151. Chart.Scale.prototype.convertTicksToLabels.call(me);
  41152. }
  41153. });
  41154. };
  41155. /***/ }),
  41156. /* 164 */
  41157. /***/ (function(module, exports, __webpack_require__) {
  41158. "use strict";
  41159. module.exports = function(Chart) {
  41160. var helpers = Chart.helpers;
  41161. var defaultConfig = {
  41162. position: 'left',
  41163. // label settings
  41164. ticks: {
  41165. callback: Chart.Ticks.formatters.logarithmic
  41166. }
  41167. };
  41168. var LogarithmicScale = Chart.Scale.extend({
  41169. determineDataLimits: function() {
  41170. var me = this;
  41171. var opts = me.options;
  41172. var tickOpts = opts.ticks;
  41173. var chart = me.chart;
  41174. var data = chart.data;
  41175. var datasets = data.datasets;
  41176. var getValueOrDefault = helpers.getValueOrDefault;
  41177. var isHorizontal = me.isHorizontal();
  41178. function IDMatches(meta) {
  41179. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  41180. }
  41181. // Calculate Range
  41182. me.min = null;
  41183. me.max = null;
  41184. me.minNotZero = null;
  41185. var hasStacks = opts.stacked;
  41186. if (hasStacks === undefined) {
  41187. helpers.each(datasets, function(dataset, datasetIndex) {
  41188. if (hasStacks) {
  41189. return;
  41190. }
  41191. var meta = chart.getDatasetMeta(datasetIndex);
  41192. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  41193. meta.stack !== undefined) {
  41194. hasStacks = true;
  41195. }
  41196. });
  41197. }
  41198. if (opts.stacked || hasStacks) {
  41199. var valuesPerStack = {};
  41200. helpers.each(datasets, function(dataset, datasetIndex) {
  41201. var meta = chart.getDatasetMeta(datasetIndex);
  41202. var key = [
  41203. meta.type,
  41204. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  41205. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  41206. meta.stack
  41207. ].join('.');
  41208. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41209. if (valuesPerStack[key] === undefined) {
  41210. valuesPerStack[key] = [];
  41211. }
  41212. helpers.each(dataset.data, function(rawValue, index) {
  41213. var values = valuesPerStack[key];
  41214. var value = +me.getRightValue(rawValue);
  41215. if (isNaN(value) || meta.data[index].hidden) {
  41216. return;
  41217. }
  41218. values[index] = values[index] || 0;
  41219. if (opts.relativePoints) {
  41220. values[index] = 100;
  41221. } else {
  41222. // Don't need to split positive and negative since the log scale can't handle a 0 crossing
  41223. values[index] += value;
  41224. }
  41225. });
  41226. }
  41227. });
  41228. helpers.each(valuesPerStack, function(valuesForType) {
  41229. var minVal = helpers.min(valuesForType);
  41230. var maxVal = helpers.max(valuesForType);
  41231. me.min = me.min === null ? minVal : Math.min(me.min, minVal);
  41232. me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);
  41233. });
  41234. } else {
  41235. helpers.each(datasets, function(dataset, datasetIndex) {
  41236. var meta = chart.getDatasetMeta(datasetIndex);
  41237. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  41238. helpers.each(dataset.data, function(rawValue, index) {
  41239. var value = +me.getRightValue(rawValue);
  41240. if (isNaN(value) || meta.data[index].hidden) {
  41241. return;
  41242. }
  41243. if (me.min === null) {
  41244. me.min = value;
  41245. } else if (value < me.min) {
  41246. me.min = value;
  41247. }
  41248. if (me.max === null) {
  41249. me.max = value;
  41250. } else if (value > me.max) {
  41251. me.max = value;
  41252. }
  41253. if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {
  41254. me.minNotZero = value;
  41255. }
  41256. });
  41257. }
  41258. });
  41259. }
  41260. me.min = getValueOrDefault(tickOpts.min, me.min);
  41261. me.max = getValueOrDefault(tickOpts.max, me.max);
  41262. if (me.min === me.max) {
  41263. if (me.min !== 0 && me.min !== null) {
  41264. me.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);
  41265. me.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);
  41266. } else {
  41267. me.min = 1;
  41268. me.max = 10;
  41269. }
  41270. }
  41271. },
  41272. buildTicks: function() {
  41273. var me = this;
  41274. var opts = me.options;
  41275. var tickOpts = opts.ticks;
  41276. var generationOptions = {
  41277. min: tickOpts.min,
  41278. max: tickOpts.max
  41279. };
  41280. var ticks = me.ticks = Chart.Ticks.generators.logarithmic(generationOptions, me);
  41281. if (!me.isHorizontal()) {
  41282. // We are in a vertical orientation. The top value is the highest. So reverse the array
  41283. ticks.reverse();
  41284. }
  41285. // At this point, we need to update our max and min given the tick values since we have expanded the
  41286. // range of the scale
  41287. me.max = helpers.max(ticks);
  41288. me.min = helpers.min(ticks);
  41289. if (tickOpts.reverse) {
  41290. ticks.reverse();
  41291. me.start = me.max;
  41292. me.end = me.min;
  41293. } else {
  41294. me.start = me.min;
  41295. me.end = me.max;
  41296. }
  41297. },
  41298. convertTicksToLabels: function() {
  41299. this.tickValues = this.ticks.slice();
  41300. Chart.Scale.prototype.convertTicksToLabels.call(this);
  41301. },
  41302. // Get the correct tooltip label
  41303. getLabelForIndex: function(index, datasetIndex) {
  41304. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41305. },
  41306. getPixelForTick: function(index) {
  41307. return this.getPixelForValue(this.tickValues[index]);
  41308. },
  41309. getPixelForValue: function(value) {
  41310. var me = this;
  41311. var innerDimension;
  41312. var pixel;
  41313. var start = me.start;
  41314. var newVal = +me.getRightValue(value);
  41315. var range;
  41316. var opts = me.options;
  41317. var tickOpts = opts.ticks;
  41318. if (me.isHorizontal()) {
  41319. range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0
  41320. if (newVal === 0) {
  41321. pixel = me.left;
  41322. } else {
  41323. innerDimension = me.width;
  41324. pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41325. }
  41326. } else {
  41327. // Bottom - top since pixels increase downward on a screen
  41328. innerDimension = me.height;
  41329. if (start === 0 && !tickOpts.reverse) {
  41330. range = helpers.log10(me.end) - helpers.log10(me.minNotZero);
  41331. if (newVal === start) {
  41332. pixel = me.bottom;
  41333. } else if (newVal === me.minNotZero) {
  41334. pixel = me.bottom - innerDimension * 0.02;
  41335. } else {
  41336. pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41337. }
  41338. } else if (me.end === 0 && tickOpts.reverse) {
  41339. range = helpers.log10(me.start) - helpers.log10(me.minNotZero);
  41340. if (newVal === me.end) {
  41341. pixel = me.top;
  41342. } else if (newVal === me.minNotZero) {
  41343. pixel = me.top + innerDimension * 0.02;
  41344. } else {
  41345. pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98/ range * (helpers.log10(newVal)-helpers.log10(me.minNotZero)));
  41346. }
  41347. } else {
  41348. range = helpers.log10(me.end) - helpers.log10(start);
  41349. innerDimension = me.height;
  41350. pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));
  41351. }
  41352. }
  41353. return pixel;
  41354. },
  41355. getValueForPixel: function(pixel) {
  41356. var me = this;
  41357. var range = helpers.log10(me.end) - helpers.log10(me.start);
  41358. var value, innerDimension;
  41359. if (me.isHorizontal()) {
  41360. innerDimension = me.width;
  41361. value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension);
  41362. } else { // todo: if start === 0
  41363. innerDimension = me.height;
  41364. value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start;
  41365. }
  41366. return value;
  41367. }
  41368. });
  41369. Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);
  41370. };
  41371. /***/ }),
  41372. /* 165 */
  41373. /***/ (function(module, exports, __webpack_require__) {
  41374. "use strict";
  41375. module.exports = function(Chart) {
  41376. var helpers = Chart.helpers;
  41377. var globalDefaults = Chart.defaults.global;
  41378. var defaultConfig = {
  41379. display: true,
  41380. // Boolean - Whether to animate scaling the chart from the centre
  41381. animate: true,
  41382. lineArc: false,
  41383. position: 'chartArea',
  41384. angleLines: {
  41385. display: true,
  41386. color: 'rgba(0, 0, 0, 0.1)',
  41387. lineWidth: 1
  41388. },
  41389. // label settings
  41390. ticks: {
  41391. // Boolean - Show a backdrop to the scale label
  41392. showLabelBackdrop: true,
  41393. // String - The colour of the label backdrop
  41394. backdropColor: 'rgba(255,255,255,0.75)',
  41395. // Number - The backdrop padding above & below the label in pixels
  41396. backdropPaddingY: 2,
  41397. // Number - The backdrop padding to the side of the label in pixels
  41398. backdropPaddingX: 2,
  41399. callback: Chart.Ticks.formatters.linear
  41400. },
  41401. pointLabels: {
  41402. // Number - Point label font size in pixels
  41403. fontSize: 10,
  41404. // Function - Used to convert point labels
  41405. callback: function(label) {
  41406. return label;
  41407. }
  41408. }
  41409. };
  41410. function getValueCount(scale) {
  41411. return !scale.options.lineArc ? scale.chart.data.labels.length : 0;
  41412. }
  41413. function getPointLabelFontOptions(scale) {
  41414. var pointLabelOptions = scale.options.pointLabels;
  41415. var fontSize = helpers.getValueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);
  41416. var fontStyle = helpers.getValueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);
  41417. var fontFamily = helpers.getValueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);
  41418. var font = helpers.fontString(fontSize, fontStyle, fontFamily);
  41419. return {
  41420. size: fontSize,
  41421. style: fontStyle,
  41422. family: fontFamily,
  41423. font: font
  41424. };
  41425. }
  41426. function measureLabelSize(ctx, fontSize, label) {
  41427. if (helpers.isArray(label)) {
  41428. return {
  41429. w: helpers.longestText(ctx, ctx.font, label),
  41430. h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)
  41431. };
  41432. }
  41433. return {
  41434. w: ctx.measureText(label).width,
  41435. h: fontSize
  41436. };
  41437. }
  41438. function determineLimits(angle, pos, size, min, max) {
  41439. if (angle === min || angle === max) {
  41440. return {
  41441. start: pos - (size / 2),
  41442. end: pos + (size / 2)
  41443. };
  41444. } else if (angle < min || angle > max) {
  41445. return {
  41446. start: pos - size - 5,
  41447. end: pos
  41448. };
  41449. }
  41450. return {
  41451. start: pos,
  41452. end: pos + size + 5
  41453. };
  41454. }
  41455. /**
  41456. * Helper function to fit a radial linear scale with point labels
  41457. */
  41458. function fitWithPointLabels(scale) {
  41459. /*
  41460. * Right, this is really confusing and there is a lot of maths going on here
  41461. * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
  41462. *
  41463. * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
  41464. *
  41465. * Solution:
  41466. *
  41467. * We assume the radius of the polygon is half the size of the canvas at first
  41468. * at each index we check if the text overlaps.
  41469. *
  41470. * Where it does, we store that angle and that index.
  41471. *
  41472. * After finding the largest index and angle we calculate how much we need to remove
  41473. * from the shape radius to move the point inwards by that x.
  41474. *
  41475. * We average the left and right distances to get the maximum shape radius that can fit in the box
  41476. * along with labels.
  41477. *
  41478. * Once we have that, we can find the centre point for the chart, by taking the x text protrusion
  41479. * on each side, removing that from the size, halving it and adding the left x protrusion width.
  41480. *
  41481. * This will mean we have a shape fitted to the canvas, as large as it can be with the labels
  41482. * and position it in the most space efficient manner
  41483. *
  41484. * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif
  41485. */
  41486. var plFont = getPointLabelFontOptions(scale);
  41487. // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.
  41488. // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points
  41489. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41490. var furthestLimits = {
  41491. l: scale.width,
  41492. r: 0,
  41493. t: scale.height,
  41494. b: 0
  41495. };
  41496. var furthestAngles = {};
  41497. var i;
  41498. var textSize;
  41499. var pointPosition;
  41500. scale.ctx.font = plFont.font;
  41501. scale._pointLabelSizes = [];
  41502. var valueCount = getValueCount(scale);
  41503. for (i = 0; i < valueCount; i++) {
  41504. pointPosition = scale.getPointPosition(i, largestPossibleRadius);
  41505. textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');
  41506. scale._pointLabelSizes[i] = textSize;
  41507. // Add quarter circle to make degree 0 mean top of circle
  41508. var angleRadians = scale.getIndexAngle(i);
  41509. var angle = helpers.toDegrees(angleRadians) % 360;
  41510. var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
  41511. var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
  41512. if (hLimits.start < furthestLimits.l) {
  41513. furthestLimits.l = hLimits.start;
  41514. furthestAngles.l = angleRadians;
  41515. }
  41516. if (hLimits.end > furthestLimits.r) {
  41517. furthestLimits.r = hLimits.end;
  41518. furthestAngles.r = angleRadians;
  41519. }
  41520. if (vLimits.start < furthestLimits.t) {
  41521. furthestLimits.t = vLimits.start;
  41522. furthestAngles.t = angleRadians;
  41523. }
  41524. if (vLimits.end > furthestLimits.b) {
  41525. furthestLimits.b = vLimits.end;
  41526. furthestAngles.b = angleRadians;
  41527. }
  41528. }
  41529. scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);
  41530. }
  41531. /**
  41532. * Helper function to fit a radial linear scale with no point labels
  41533. */
  41534. function fit(scale) {
  41535. var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);
  41536. scale.drawingArea = Math.round(largestPossibleRadius);
  41537. scale.setCenterPoint(0, 0, 0, 0);
  41538. }
  41539. function getTextAlignForAngle(angle) {
  41540. if (angle === 0 || angle === 180) {
  41541. return 'center';
  41542. } else if (angle < 180) {
  41543. return 'left';
  41544. }
  41545. return 'right';
  41546. }
  41547. function fillText(ctx, text, position, fontSize) {
  41548. if (helpers.isArray(text)) {
  41549. var y = position.y;
  41550. var spacing = 1.5 * fontSize;
  41551. for (var i = 0; i < text.length; ++i) {
  41552. ctx.fillText(text[i], position.x, y);
  41553. y+= spacing;
  41554. }
  41555. } else {
  41556. ctx.fillText(text, position.x, position.y);
  41557. }
  41558. }
  41559. function adjustPointPositionForLabelHeight(angle, textSize, position) {
  41560. if (angle === 90 || angle === 270) {
  41561. position.y -= (textSize.h / 2);
  41562. } else if (angle > 270 || angle < 90) {
  41563. position.y -= textSize.h;
  41564. }
  41565. }
  41566. function drawPointLabels(scale) {
  41567. var ctx = scale.ctx;
  41568. var getValueOrDefault = helpers.getValueOrDefault;
  41569. var opts = scale.options;
  41570. var angleLineOpts = opts.angleLines;
  41571. var pointLabelOpts = opts.pointLabels;
  41572. ctx.lineWidth = angleLineOpts.lineWidth;
  41573. ctx.strokeStyle = angleLineOpts.color;
  41574. var outerDistance = scale.getDistanceFromCenterForValue(opts.reverse ? scale.min : scale.max);
  41575. // Point Label Font
  41576. var plFont = getPointLabelFontOptions(scale);
  41577. ctx.textBaseline = 'top';
  41578. for (var i = getValueCount(scale) - 1; i >= 0; i--) {
  41579. if (angleLineOpts.display) {
  41580. var outerPosition = scale.getPointPosition(i, outerDistance);
  41581. ctx.beginPath();
  41582. ctx.moveTo(scale.xCenter, scale.yCenter);
  41583. ctx.lineTo(outerPosition.x, outerPosition.y);
  41584. ctx.stroke();
  41585. ctx.closePath();
  41586. }
  41587. // Extra 3px out for some label spacing
  41588. var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);
  41589. // Keep this in loop since we may support array properties here
  41590. var pointLabelFontColor = getValueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor);
  41591. ctx.font = plFont.font;
  41592. ctx.fillStyle = pointLabelFontColor;
  41593. var angleRadians = scale.getIndexAngle(i);
  41594. var angle = helpers.toDegrees(angleRadians);
  41595. ctx.textAlign = getTextAlignForAngle(angle);
  41596. adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);
  41597. fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);
  41598. }
  41599. }
  41600. function drawRadiusLine(scale, gridLineOpts, radius, index) {
  41601. var ctx = scale.ctx;
  41602. ctx.strokeStyle = helpers.getValueAtIndexOrDefault(gridLineOpts.color, index - 1);
  41603. ctx.lineWidth = helpers.getValueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);
  41604. if (scale.options.lineArc) {
  41605. // Draw circular arcs between the points
  41606. ctx.beginPath();
  41607. ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);
  41608. ctx.closePath();
  41609. ctx.stroke();
  41610. } else {
  41611. // Draw straight lines connecting each index
  41612. var valueCount = getValueCount(scale);
  41613. if (valueCount === 0) {
  41614. return;
  41615. }
  41616. ctx.beginPath();
  41617. var pointPosition = scale.getPointPosition(0, radius);
  41618. ctx.moveTo(pointPosition.x, pointPosition.y);
  41619. for (var i = 1; i < valueCount; i++) {
  41620. pointPosition = scale.getPointPosition(i, radius);
  41621. ctx.lineTo(pointPosition.x, pointPosition.y);
  41622. }
  41623. ctx.closePath();
  41624. ctx.stroke();
  41625. }
  41626. }
  41627. function numberOrZero(param) {
  41628. return helpers.isNumber(param) ? param : 0;
  41629. }
  41630. var LinearRadialScale = Chart.LinearScaleBase.extend({
  41631. setDimensions: function() {
  41632. var me = this;
  41633. var opts = me.options;
  41634. var tickOpts = opts.ticks;
  41635. // Set the unconstrained dimension before label rotation
  41636. me.width = me.maxWidth;
  41637. me.height = me.maxHeight;
  41638. me.xCenter = Math.round(me.width / 2);
  41639. me.yCenter = Math.round(me.height / 2);
  41640. var minSize = helpers.min([me.height, me.width]);
  41641. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41642. me.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);
  41643. },
  41644. determineDataLimits: function() {
  41645. var me = this;
  41646. var chart = me.chart;
  41647. var min = Number.POSITIVE_INFINITY;
  41648. var max = Number.NEGATIVE_INFINITY;
  41649. helpers.each(chart.data.datasets, function(dataset, datasetIndex) {
  41650. if (chart.isDatasetVisible(datasetIndex)) {
  41651. var meta = chart.getDatasetMeta(datasetIndex);
  41652. helpers.each(dataset.data, function(rawValue, index) {
  41653. var value = +me.getRightValue(rawValue);
  41654. if (isNaN(value) || meta.data[index].hidden) {
  41655. return;
  41656. }
  41657. min = Math.min(value, min);
  41658. max = Math.max(value, max);
  41659. });
  41660. }
  41661. });
  41662. me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);
  41663. me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);
  41664. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  41665. me.handleTickRangeOptions();
  41666. },
  41667. getTickLimit: function() {
  41668. var tickOpts = this.options.ticks;
  41669. var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41670. return Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));
  41671. },
  41672. convertTicksToLabels: function() {
  41673. var me = this;
  41674. Chart.LinearScaleBase.prototype.convertTicksToLabels.call(me);
  41675. // Point labels
  41676. me.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);
  41677. },
  41678. getLabelForIndex: function(index, datasetIndex) {
  41679. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  41680. },
  41681. fit: function() {
  41682. if (this.options.lineArc) {
  41683. fit(this);
  41684. } else {
  41685. fitWithPointLabels(this);
  41686. }
  41687. },
  41688. /**
  41689. * Set radius reductions and determine new radius and center point
  41690. * @private
  41691. */
  41692. setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {
  41693. var me = this;
  41694. var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);
  41695. var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);
  41696. var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);
  41697. var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);
  41698. radiusReductionLeft = numberOrZero(radiusReductionLeft);
  41699. radiusReductionRight = numberOrZero(radiusReductionRight);
  41700. radiusReductionTop = numberOrZero(radiusReductionTop);
  41701. radiusReductionBottom = numberOrZero(radiusReductionBottom);
  41702. me.drawingArea = Math.min(
  41703. Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),
  41704. Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));
  41705. me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);
  41706. },
  41707. setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {
  41708. var me = this;
  41709. var maxRight = me.width - rightMovement - me.drawingArea,
  41710. maxLeft = leftMovement + me.drawingArea,
  41711. maxTop = topMovement + me.drawingArea,
  41712. maxBottom = me.height - bottomMovement - me.drawingArea;
  41713. me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);
  41714. me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);
  41715. },
  41716. getIndexAngle: function(index) {
  41717. var angleMultiplier = (Math.PI * 2) / getValueCount(this);
  41718. var startAngle = this.chart.options && this.chart.options.startAngle ?
  41719. this.chart.options.startAngle :
  41720. 0;
  41721. var startAngleRadians = startAngle * Math.PI * 2 / 360;
  41722. // Start from the top instead of right, so remove a quarter of the circle
  41723. return index * angleMultiplier + startAngleRadians;
  41724. },
  41725. getDistanceFromCenterForValue: function(value) {
  41726. var me = this;
  41727. if (value === null) {
  41728. return 0; // null always in center
  41729. }
  41730. // Take into account half font size + the yPadding of the top value
  41731. var scalingFactor = me.drawingArea / (me.max - me.min);
  41732. if (me.options.reverse) {
  41733. return (me.max - value) * scalingFactor;
  41734. }
  41735. return (value - me.min) * scalingFactor;
  41736. },
  41737. getPointPosition: function(index, distanceFromCenter) {
  41738. var me = this;
  41739. var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);
  41740. return {
  41741. x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,
  41742. y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter
  41743. };
  41744. },
  41745. getPointPositionForValue: function(index, value) {
  41746. return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));
  41747. },
  41748. getBasePosition: function() {
  41749. var me = this;
  41750. var min = me.min;
  41751. var max = me.max;
  41752. return me.getPointPositionForValue(0,
  41753. me.beginAtZero? 0:
  41754. min < 0 && max < 0? max :
  41755. min > 0 && max > 0? min :
  41756. 0);
  41757. },
  41758. draw: function() {
  41759. var me = this;
  41760. var opts = me.options;
  41761. var gridLineOpts = opts.gridLines;
  41762. var tickOpts = opts.ticks;
  41763. var getValueOrDefault = helpers.getValueOrDefault;
  41764. if (opts.display) {
  41765. var ctx = me.ctx;
  41766. // Tick Font
  41767. var tickFontSize = getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);
  41768. var tickFontStyle = getValueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);
  41769. var tickFontFamily = getValueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);
  41770. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  41771. helpers.each(me.ticks, function(label, index) {
  41772. // Don't draw a centre value (if it is minimum)
  41773. if (index > 0 || opts.reverse) {
  41774. var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);
  41775. var yHeight = me.yCenter - yCenterOffset;
  41776. // Draw circular lines around the scale
  41777. if (gridLineOpts.display && index !== 0) {
  41778. drawRadiusLine(me, gridLineOpts, yCenterOffset, index);
  41779. }
  41780. if (tickOpts.display) {
  41781. var tickFontColor = getValueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);
  41782. ctx.font = tickLabelFont;
  41783. if (tickOpts.showLabelBackdrop) {
  41784. var labelWidth = ctx.measureText(label).width;
  41785. ctx.fillStyle = tickOpts.backdropColor;
  41786. ctx.fillRect(
  41787. me.xCenter - labelWidth / 2 - tickOpts.backdropPaddingX,
  41788. yHeight - tickFontSize / 2 - tickOpts.backdropPaddingY,
  41789. labelWidth + tickOpts.backdropPaddingX * 2,
  41790. tickFontSize + tickOpts.backdropPaddingY * 2
  41791. );
  41792. }
  41793. ctx.textAlign = 'center';
  41794. ctx.textBaseline = 'middle';
  41795. ctx.fillStyle = tickFontColor;
  41796. ctx.fillText(label, me.xCenter, yHeight);
  41797. }
  41798. }
  41799. });
  41800. if (!opts.lineArc) {
  41801. drawPointLabels(me);
  41802. }
  41803. }
  41804. }
  41805. });
  41806. Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);
  41807. };
  41808. /***/ }),
  41809. /* 166 */
  41810. /***/ (function(module, exports, __webpack_require__) {
  41811. "use strict";
  41812. /* global window: false */
  41813. var moment = __webpack_require__(0);
  41814. moment = typeof(moment) === 'function' ? moment : window.moment;
  41815. module.exports = function(Chart) {
  41816. var helpers = Chart.helpers;
  41817. var time = {
  41818. units: [{
  41819. name: 'millisecond',
  41820. steps: [1, 2, 5, 10, 20, 50, 100, 250, 500]
  41821. }, {
  41822. name: 'second',
  41823. steps: [1, 2, 5, 10, 30]
  41824. }, {
  41825. name: 'minute',
  41826. steps: [1, 2, 5, 10, 30]
  41827. }, {
  41828. name: 'hour',
  41829. steps: [1, 2, 3, 6, 12]
  41830. }, {
  41831. name: 'day',
  41832. steps: [1, 2, 5]
  41833. }, {
  41834. name: 'week',
  41835. maxStep: 4
  41836. }, {
  41837. name: 'month',
  41838. maxStep: 3
  41839. }, {
  41840. name: 'quarter',
  41841. maxStep: 4
  41842. }, {
  41843. name: 'year',
  41844. maxStep: false
  41845. }]
  41846. };
  41847. var defaultConfig = {
  41848. position: 'bottom',
  41849. time: {
  41850. parser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
  41851. format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/
  41852. unit: false, // false == automatic or override with week, month, year, etc.
  41853. round: false, // none, or override with week, month, year, etc.
  41854. displayFormat: false, // DEPRECATED
  41855. isoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/
  41856. minUnit: 'millisecond',
  41857. // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/
  41858. displayFormats: {
  41859. millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,
  41860. second: 'h:mm:ss a', // 11:20:01 AM
  41861. minute: 'h:mm:ss a', // 11:20:01 AM
  41862. hour: 'MMM D, hA', // Sept 4, 5PM
  41863. day: 'll', // Sep 4 2015
  41864. week: 'll', // Week 46, or maybe "[W]WW - YYYY" ?
  41865. month: 'MMM YYYY', // Sept 2015
  41866. quarter: '[Q]Q - YYYY', // Q3
  41867. year: 'YYYY' // 2015
  41868. }
  41869. },
  41870. ticks: {
  41871. autoSkip: false
  41872. }
  41873. };
  41874. var TimeScale = Chart.Scale.extend({
  41875. initialize: function() {
  41876. if (!moment) {
  41877. throw new Error('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com');
  41878. }
  41879. Chart.Scale.prototype.initialize.call(this);
  41880. },
  41881. getLabelMoment: function(datasetIndex, index) {
  41882. if (datasetIndex === null || index === null) {
  41883. return null;
  41884. }
  41885. if (typeof this.labelMoments[datasetIndex] !== 'undefined') {
  41886. return this.labelMoments[datasetIndex][index];
  41887. }
  41888. return null;
  41889. },
  41890. getLabelDiff: function(datasetIndex, index) {
  41891. var me = this;
  41892. if (datasetIndex === null || index === null) {
  41893. return null;
  41894. }
  41895. if (me.labelDiffs === undefined) {
  41896. me.buildLabelDiffs();
  41897. }
  41898. if (typeof me.labelDiffs[datasetIndex] !== 'undefined') {
  41899. return me.labelDiffs[datasetIndex][index];
  41900. }
  41901. return null;
  41902. },
  41903. getMomentStartOf: function(tick) {
  41904. var me = this;
  41905. if (me.options.time.unit === 'week' && me.options.time.isoWeekday !== false) {
  41906. return tick.clone().startOf('isoWeek').isoWeekday(me.options.time.isoWeekday);
  41907. }
  41908. return tick.clone().startOf(me.tickUnit);
  41909. },
  41910. determineDataLimits: function() {
  41911. var me = this;
  41912. me.labelMoments = [];
  41913. // Only parse these once. If the dataset does not have data as x,y pairs, we will use
  41914. // these
  41915. var scaleLabelMoments = [];
  41916. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  41917. helpers.each(me.chart.data.labels, function(label) {
  41918. var labelMoment = me.parseTime(label);
  41919. if (labelMoment.isValid()) {
  41920. if (me.options.time.round) {
  41921. labelMoment.startOf(me.options.time.round);
  41922. }
  41923. scaleLabelMoments.push(labelMoment);
  41924. }
  41925. }, me);
  41926. me.firstTick = moment.min.call(me, scaleLabelMoments);
  41927. me.lastTick = moment.max.call(me, scaleLabelMoments);
  41928. } else {
  41929. me.firstTick = null;
  41930. me.lastTick = null;
  41931. }
  41932. helpers.each(me.chart.data.datasets, function(dataset, datasetIndex) {
  41933. var momentsForDataset = [];
  41934. var datasetVisible = me.chart.isDatasetVisible(datasetIndex);
  41935. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  41936. helpers.each(dataset.data, function(value) {
  41937. var labelMoment = me.parseTime(me.getRightValue(value));
  41938. if (labelMoment.isValid()) {
  41939. if (me.options.time.round) {
  41940. labelMoment.startOf(me.options.time.round);
  41941. }
  41942. momentsForDataset.push(labelMoment);
  41943. if (datasetVisible) {
  41944. // May have gone outside the scale ranges, make sure we keep the first and last ticks updated
  41945. me.firstTick = me.firstTick !== null ? moment.min(me.firstTick, labelMoment) : labelMoment;
  41946. me.lastTick = me.lastTick !== null ? moment.max(me.lastTick, labelMoment) : labelMoment;
  41947. }
  41948. }
  41949. }, me);
  41950. } else {
  41951. // We have no labels. Use the ones from the scale
  41952. momentsForDataset = scaleLabelMoments;
  41953. }
  41954. me.labelMoments.push(momentsForDataset);
  41955. }, me);
  41956. // Set these after we've done all the data
  41957. if (me.options.time.min) {
  41958. me.firstTick = me.parseTime(me.options.time.min);
  41959. }
  41960. if (me.options.time.max) {
  41961. me.lastTick = me.parseTime(me.options.time.max);
  41962. }
  41963. // We will modify these, so clone for later
  41964. me.firstTick = (me.firstTick || moment()).clone();
  41965. me.lastTick = (me.lastTick || moment()).clone();
  41966. },
  41967. buildLabelDiffs: function() {
  41968. var me = this;
  41969. me.labelDiffs = [];
  41970. var scaleLabelDiffs = [];
  41971. // Parse common labels once
  41972. if (me.chart.data.labels && me.chart.data.labels.length > 0) {
  41973. helpers.each(me.chart.data.labels, function(label) {
  41974. var labelMoment = me.parseTime(label);
  41975. if (labelMoment.isValid()) {
  41976. if (me.options.time.round) {
  41977. labelMoment.startOf(me.options.time.round);
  41978. }
  41979. scaleLabelDiffs.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  41980. }
  41981. }, me);
  41982. }
  41983. helpers.each(me.chart.data.datasets, function(dataset) {
  41984. var diffsForDataset = [];
  41985. if (typeof dataset.data[0] === 'object' && dataset.data[0] !== null) {
  41986. helpers.each(dataset.data, function(value) {
  41987. var labelMoment = me.parseTime(me.getRightValue(value));
  41988. if (labelMoment.isValid()) {
  41989. if (me.options.time.round) {
  41990. labelMoment.startOf(me.options.time.round);
  41991. }
  41992. diffsForDataset.push(labelMoment.diff(me.firstTick, me.tickUnit, true));
  41993. }
  41994. }, me);
  41995. } else {
  41996. // We have no labels. Use common ones
  41997. diffsForDataset = scaleLabelDiffs;
  41998. }
  41999. me.labelDiffs.push(diffsForDataset);
  42000. }, me);
  42001. },
  42002. buildTicks: function() {
  42003. var me = this;
  42004. me.ctx.save();
  42005. var tickFontSize = helpers.getValueOrDefault(me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize);
  42006. var tickFontStyle = helpers.getValueOrDefault(me.options.ticks.fontStyle, Chart.defaults.global.defaultFontStyle);
  42007. var tickFontFamily = helpers.getValueOrDefault(me.options.ticks.fontFamily, Chart.defaults.global.defaultFontFamily);
  42008. var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);
  42009. me.ctx.font = tickLabelFont;
  42010. me.ticks = [];
  42011. me.unitScale = 1; // How much we scale the unit by, ie 2 means 2x unit per step
  42012. me.scaleSizeInUnits = 0; // How large the scale is in the base unit (seconds, minutes, etc)
  42013. // Set unit override if applicable
  42014. if (me.options.time.unit) {
  42015. me.tickUnit = me.options.time.unit || 'day';
  42016. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  42017. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42018. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, 1);
  42019. } else {
  42020. // Determine the smallest needed unit of the time
  42021. var innerWidth = me.isHorizontal() ? me.width : me.height;
  42022. // Crude approximation of what the label length might be
  42023. var tempFirstLabel = me.tickFormatFunction(me.firstTick, 0, []);
  42024. var tickLabelWidth = me.ctx.measureText(tempFirstLabel).width;
  42025. var cosRotation = Math.cos(helpers.toRadians(me.options.ticks.maxRotation));
  42026. var sinRotation = Math.sin(helpers.toRadians(me.options.ticks.maxRotation));
  42027. tickLabelWidth = (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);
  42028. var labelCapacity = innerWidth / (tickLabelWidth);
  42029. // Start as small as possible
  42030. me.tickUnit = me.options.time.minUnit;
  42031. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42032. me.displayFormat = me.options.time.displayFormats[me.tickUnit];
  42033. var unitDefinitionIndex = 0;
  42034. var unitDefinition = time.units[unitDefinitionIndex];
  42035. // While we aren't ideal and we don't have units left
  42036. while (unitDefinitionIndex < time.units.length) {
  42037. // Can we scale this unit. If `false` we can scale infinitely
  42038. me.unitScale = 1;
  42039. if (helpers.isArray(unitDefinition.steps) && Math.ceil(me.scaleSizeInUnits / labelCapacity) < helpers.max(unitDefinition.steps)) {
  42040. // Use one of the predefined steps
  42041. for (var idx = 0; idx < unitDefinition.steps.length; ++idx) {
  42042. if (unitDefinition.steps[idx] >= Math.ceil(me.scaleSizeInUnits / labelCapacity)) {
  42043. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, unitDefinition.steps[idx]);
  42044. break;
  42045. }
  42046. }
  42047. break;
  42048. } else if ((unitDefinition.maxStep === false) || (Math.ceil(me.scaleSizeInUnits / labelCapacity) < unitDefinition.maxStep)) {
  42049. // We have a max step. Scale this unit
  42050. me.unitScale = helpers.getValueOrDefault(me.options.time.unitStepSize, Math.ceil(me.scaleSizeInUnits / labelCapacity));
  42051. break;
  42052. } else {
  42053. // Move to the next unit up
  42054. ++unitDefinitionIndex;
  42055. unitDefinition = time.units[unitDefinitionIndex];
  42056. me.tickUnit = unitDefinition.name;
  42057. var leadingUnitBuffer = me.firstTick.diff(me.getMomentStartOf(me.firstTick), me.tickUnit, true);
  42058. var trailingUnitBuffer = me.getMomentStartOf(me.lastTick.clone().add(1, me.tickUnit)).diff(me.lastTick, me.tickUnit, true);
  42059. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true) + leadingUnitBuffer + trailingUnitBuffer;
  42060. me.displayFormat = me.options.time.displayFormats[unitDefinition.name];
  42061. }
  42062. }
  42063. }
  42064. var roundedStart;
  42065. // Only round the first tick if we have no hard minimum
  42066. if (!me.options.time.min) {
  42067. me.firstTick = me.getMomentStartOf(me.firstTick);
  42068. roundedStart = me.firstTick;
  42069. } else {
  42070. roundedStart = me.getMomentStartOf(me.firstTick);
  42071. }
  42072. // Only round the last tick if we have no hard maximum
  42073. if (!me.options.time.max) {
  42074. var roundedEnd = me.getMomentStartOf(me.lastTick);
  42075. var delta = roundedEnd.diff(me.lastTick, me.tickUnit, true);
  42076. if (delta < 0) {
  42077. // Do not use end of because we need me to be in the next time unit
  42078. me.lastTick = me.getMomentStartOf(me.lastTick.add(1, me.tickUnit));
  42079. } else if (delta >= 0) {
  42080. me.lastTick = roundedEnd;
  42081. }
  42082. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42083. }
  42084. // Tick displayFormat override
  42085. if (me.options.time.displayFormat) {
  42086. me.displayFormat = me.options.time.displayFormat;
  42087. }
  42088. // first tick. will have been rounded correctly if options.time.min is not specified
  42089. me.ticks.push(me.firstTick.clone());
  42090. // For every unit in between the first and last moment, create a moment and add it to the ticks tick
  42091. for (var i = me.unitScale; i <= me.scaleSizeInUnits; i += me.unitScale) {
  42092. var newTick = roundedStart.clone().add(i, me.tickUnit);
  42093. // Are we greater than the max time
  42094. if (me.options.time.max && newTick.diff(me.lastTick, me.tickUnit, true) >= 0) {
  42095. break;
  42096. }
  42097. me.ticks.push(newTick);
  42098. }
  42099. // Always show the right tick
  42100. var diff = me.ticks[me.ticks.length - 1].diff(me.lastTick, me.tickUnit);
  42101. if (diff !== 0 || me.scaleSizeInUnits === 0) {
  42102. // this is a weird case. If the <max> option is the same as the end option, we can't just diff the times because the tick was created from the roundedStart
  42103. // but the last tick was not rounded.
  42104. if (me.options.time.max) {
  42105. me.ticks.push(me.lastTick.clone());
  42106. me.scaleSizeInUnits = me.lastTick.diff(me.ticks[0], me.tickUnit, true);
  42107. } else {
  42108. me.ticks.push(me.lastTick.clone());
  42109. me.scaleSizeInUnits = me.lastTick.diff(me.firstTick, me.tickUnit, true);
  42110. }
  42111. }
  42112. me.ctx.restore();
  42113. // Invalidate label diffs cache
  42114. me.labelDiffs = undefined;
  42115. },
  42116. // Get tooltip label
  42117. getLabelForIndex: function(index, datasetIndex) {
  42118. var me = this;
  42119. var label = me.chart.data.labels && index < me.chart.data.labels.length ? me.chart.data.labels[index] : '';
  42120. var value = me.chart.data.datasets[datasetIndex].data[index];
  42121. if (value !== null && typeof value === 'object') {
  42122. label = me.getRightValue(value);
  42123. }
  42124. // Format nicely
  42125. if (me.options.time.tooltipFormat) {
  42126. label = me.parseTime(label).format(me.options.time.tooltipFormat);
  42127. }
  42128. return label;
  42129. },
  42130. // Function to format an individual tick mark
  42131. tickFormatFunction: function(tick, index, ticks) {
  42132. var formattedTick = tick.format(this.displayFormat);
  42133. var tickOpts = this.options.ticks;
  42134. var callback = helpers.getValueOrDefault(tickOpts.callback, tickOpts.userCallback);
  42135. if (callback) {
  42136. return callback(formattedTick, index, ticks);
  42137. }
  42138. return formattedTick;
  42139. },
  42140. convertTicksToLabels: function() {
  42141. var me = this;
  42142. me.tickMoments = me.ticks;
  42143. me.ticks = me.ticks.map(me.tickFormatFunction, me);
  42144. },
  42145. getPixelForValue: function(value, index, datasetIndex) {
  42146. var me = this;
  42147. var offset = null;
  42148. if (index !== undefined && datasetIndex !== undefined) {
  42149. offset = me.getLabelDiff(datasetIndex, index);
  42150. }
  42151. if (offset === null) {
  42152. if (!value || !value.isValid) {
  42153. // not already a moment object
  42154. value = me.parseTime(me.getRightValue(value));
  42155. }
  42156. if (value && value.isValid && value.isValid()) {
  42157. offset = value.diff(me.firstTick, me.tickUnit, true);
  42158. }
  42159. }
  42160. if (offset !== null) {
  42161. var decimal = offset !== 0 ? offset / me.scaleSizeInUnits : offset;
  42162. if (me.isHorizontal()) {
  42163. var valueOffset = (me.width * decimal);
  42164. return me.left + Math.round(valueOffset);
  42165. }
  42166. var heightOffset = (me.height * decimal);
  42167. return me.top + Math.round(heightOffset);
  42168. }
  42169. },
  42170. getPixelForTick: function(index) {
  42171. return this.getPixelForValue(this.tickMoments[index], null, null);
  42172. },
  42173. getValueForPixel: function(pixel) {
  42174. var me = this;
  42175. var innerDimension = me.isHorizontal() ? me.width : me.height;
  42176. var offset = (pixel - (me.isHorizontal() ? me.left : me.top)) / innerDimension;
  42177. offset *= me.scaleSizeInUnits;
  42178. return me.firstTick.clone().add(moment.duration(offset, me.tickUnit).asSeconds(), 'seconds');
  42179. },
  42180. parseTime: function(label) {
  42181. var me = this;
  42182. if (typeof me.options.time.parser === 'string') {
  42183. return moment(label, me.options.time.parser);
  42184. }
  42185. if (typeof me.options.time.parser === 'function') {
  42186. return me.options.time.parser(label);
  42187. }
  42188. // Date objects
  42189. if (typeof label.getMonth === 'function' || typeof label === 'number') {
  42190. return moment(label);
  42191. }
  42192. // Moment support
  42193. if (label.isValid && label.isValid()) {
  42194. return label;
  42195. }
  42196. // Custom parsing (return an instance of moment)
  42197. if (typeof me.options.time.format !== 'string' && me.options.time.format.call) {
  42198. console.warn('options.time.format is deprecated and replaced by options.time.parser. See http://nnnick.github.io/Chart.js/docs-v2/#scales-time-scale');
  42199. return me.options.time.format(label);
  42200. }
  42201. // Moment format parsing
  42202. return moment(label, me.options.time.format);
  42203. }
  42204. });
  42205. Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);
  42206. };
  42207. /***/ }),
  42208. /* 167 */
  42209. /***/ (function(module, exports, __webpack_require__) {
  42210. /* MIT license */
  42211. var colorNames = __webpack_require__(171);
  42212. module.exports = {
  42213. getRgba: getRgba,
  42214. getHsla: getHsla,
  42215. getRgb: getRgb,
  42216. getHsl: getHsl,
  42217. getHwb: getHwb,
  42218. getAlpha: getAlpha,
  42219. hexString: hexString,
  42220. rgbString: rgbString,
  42221. rgbaString: rgbaString,
  42222. percentString: percentString,
  42223. percentaString: percentaString,
  42224. hslString: hslString,
  42225. hslaString: hslaString,
  42226. hwbString: hwbString,
  42227. keyword: keyword
  42228. }
  42229. function getRgba(string) {
  42230. if (!string) {
  42231. return;
  42232. }
  42233. var abbr = /^#([a-fA-F0-9]{3})$/,
  42234. hex = /^#([a-fA-F0-9]{6})$/,
  42235. rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  42236. per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
  42237. keyword = /(\w+)/;
  42238. var rgb = [0, 0, 0],
  42239. a = 1,
  42240. match = string.match(abbr);
  42241. if (match) {
  42242. match = match[1];
  42243. for (var i = 0; i < rgb.length; i++) {
  42244. rgb[i] = parseInt(match[i] + match[i], 16);
  42245. }
  42246. }
  42247. else if (match = string.match(hex)) {
  42248. match = match[1];
  42249. for (var i = 0; i < rgb.length; i++) {
  42250. rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
  42251. }
  42252. }
  42253. else if (match = string.match(rgba)) {
  42254. for (var i = 0; i < rgb.length; i++) {
  42255. rgb[i] = parseInt(match[i + 1]);
  42256. }
  42257. a = parseFloat(match[4]);
  42258. }
  42259. else if (match = string.match(per)) {
  42260. for (var i = 0; i < rgb.length; i++) {
  42261. rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
  42262. }
  42263. a = parseFloat(match[4]);
  42264. }
  42265. else if (match = string.match(keyword)) {
  42266. if (match[1] == "transparent") {
  42267. return [0, 0, 0, 0];
  42268. }
  42269. rgb = colorNames[match[1]];
  42270. if (!rgb) {
  42271. return;
  42272. }
  42273. }
  42274. for (var i = 0; i < rgb.length; i++) {
  42275. rgb[i] = scale(rgb[i], 0, 255);
  42276. }
  42277. if (!a && a != 0) {
  42278. a = 1;
  42279. }
  42280. else {
  42281. a = scale(a, 0, 1);
  42282. }
  42283. rgb[3] = a;
  42284. return rgb;
  42285. }
  42286. function getHsla(string) {
  42287. if (!string) {
  42288. return;
  42289. }
  42290. var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42291. var match = string.match(hsl);
  42292. if (match) {
  42293. var alpha = parseFloat(match[4]);
  42294. var h = scale(parseInt(match[1]), 0, 360),
  42295. s = scale(parseFloat(match[2]), 0, 100),
  42296. l = scale(parseFloat(match[3]), 0, 100),
  42297. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42298. return [h, s, l, a];
  42299. }
  42300. }
  42301. function getHwb(string) {
  42302. if (!string) {
  42303. return;
  42304. }
  42305. var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  42306. var match = string.match(hwb);
  42307. if (match) {
  42308. var alpha = parseFloat(match[4]);
  42309. var h = scale(parseInt(match[1]), 0, 360),
  42310. w = scale(parseFloat(match[2]), 0, 100),
  42311. b = scale(parseFloat(match[3]), 0, 100),
  42312. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  42313. return [h, w, b, a];
  42314. }
  42315. }
  42316. function getRgb(string) {
  42317. var rgba = getRgba(string);
  42318. return rgba && rgba.slice(0, 3);
  42319. }
  42320. function getHsl(string) {
  42321. var hsla = getHsla(string);
  42322. return hsla && hsla.slice(0, 3);
  42323. }
  42324. function getAlpha(string) {
  42325. var vals = getRgba(string);
  42326. if (vals) {
  42327. return vals[3];
  42328. }
  42329. else if (vals = getHsla(string)) {
  42330. return vals[3];
  42331. }
  42332. else if (vals = getHwb(string)) {
  42333. return vals[3];
  42334. }
  42335. }
  42336. // generators
  42337. function hexString(rgb) {
  42338. return "#" + hexDouble(rgb[0]) + hexDouble(rgb[1])
  42339. + hexDouble(rgb[2]);
  42340. }
  42341. function rgbString(rgba, alpha) {
  42342. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42343. return rgbaString(rgba, alpha);
  42344. }
  42345. return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
  42346. }
  42347. function rgbaString(rgba, alpha) {
  42348. if (alpha === undefined) {
  42349. alpha = (rgba[3] !== undefined ? rgba[3] : 1);
  42350. }
  42351. return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
  42352. + ", " + alpha + ")";
  42353. }
  42354. function percentString(rgba, alpha) {
  42355. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  42356. return percentaString(rgba, alpha);
  42357. }
  42358. var r = Math.round(rgba[0]/255 * 100),
  42359. g = Math.round(rgba[1]/255 * 100),
  42360. b = Math.round(rgba[2]/255 * 100);
  42361. return "rgb(" + r + "%, " + g + "%, " + b + "%)";
  42362. }
  42363. function percentaString(rgba, alpha) {
  42364. var r = Math.round(rgba[0]/255 * 100),
  42365. g = Math.round(rgba[1]/255 * 100),
  42366. b = Math.round(rgba[2]/255 * 100);
  42367. return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
  42368. }
  42369. function hslString(hsla, alpha) {
  42370. if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
  42371. return hslaString(hsla, alpha);
  42372. }
  42373. return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
  42374. }
  42375. function hslaString(hsla, alpha) {
  42376. if (alpha === undefined) {
  42377. alpha = (hsla[3] !== undefined ? hsla[3] : 1);
  42378. }
  42379. return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
  42380. + alpha + ")";
  42381. }
  42382. // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
  42383. // (hwb have alpha optional & 1 is default value)
  42384. function hwbString(hwb, alpha) {
  42385. if (alpha === undefined) {
  42386. alpha = (hwb[3] !== undefined ? hwb[3] : 1);
  42387. }
  42388. return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
  42389. + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
  42390. }
  42391. function keyword(rgb) {
  42392. return reverseNames[rgb.slice(0, 3)];
  42393. }
  42394. // helpers
  42395. function scale(num, min, max) {
  42396. return Math.min(Math.max(min, num), max);
  42397. }
  42398. function hexDouble(num) {
  42399. var str = num.toString(16).toUpperCase();
  42400. return (str.length < 2) ? "0" + str : str;
  42401. }
  42402. //create a list of reverse color names
  42403. var reverseNames = {};
  42404. for (var name in colorNames) {
  42405. reverseNames[colorNames[name]] = name;
  42406. }
  42407. /***/ }),
  42408. /* 168 */
  42409. /***/ (function(module, exports, __webpack_require__) {
  42410. /* MIT license */
  42411. var convert = __webpack_require__(170);
  42412. var string = __webpack_require__(167);
  42413. var Color = function (obj) {
  42414. if (obj instanceof Color) {
  42415. return obj;
  42416. }
  42417. if (!(this instanceof Color)) {
  42418. return new Color(obj);
  42419. }
  42420. this.valid = false;
  42421. this.values = {
  42422. rgb: [0, 0, 0],
  42423. hsl: [0, 0, 0],
  42424. hsv: [0, 0, 0],
  42425. hwb: [0, 0, 0],
  42426. cmyk: [0, 0, 0, 0],
  42427. alpha: 1
  42428. };
  42429. // parse Color() argument
  42430. var vals;
  42431. if (typeof obj === 'string') {
  42432. vals = string.getRgba(obj);
  42433. if (vals) {
  42434. this.setValues('rgb', vals);
  42435. } else if (vals = string.getHsla(obj)) {
  42436. this.setValues('hsl', vals);
  42437. } else if (vals = string.getHwb(obj)) {
  42438. this.setValues('hwb', vals);
  42439. }
  42440. } else if (typeof obj === 'object') {
  42441. vals = obj;
  42442. if (vals.r !== undefined || vals.red !== undefined) {
  42443. this.setValues('rgb', vals);
  42444. } else if (vals.l !== undefined || vals.lightness !== undefined) {
  42445. this.setValues('hsl', vals);
  42446. } else if (vals.v !== undefined || vals.value !== undefined) {
  42447. this.setValues('hsv', vals);
  42448. } else if (vals.w !== undefined || vals.whiteness !== undefined) {
  42449. this.setValues('hwb', vals);
  42450. } else if (vals.c !== undefined || vals.cyan !== undefined) {
  42451. this.setValues('cmyk', vals);
  42452. }
  42453. }
  42454. };
  42455. Color.prototype = {
  42456. isValid: function () {
  42457. return this.valid;
  42458. },
  42459. rgb: function () {
  42460. return this.setSpace('rgb', arguments);
  42461. },
  42462. hsl: function () {
  42463. return this.setSpace('hsl', arguments);
  42464. },
  42465. hsv: function () {
  42466. return this.setSpace('hsv', arguments);
  42467. },
  42468. hwb: function () {
  42469. return this.setSpace('hwb', arguments);
  42470. },
  42471. cmyk: function () {
  42472. return this.setSpace('cmyk', arguments);
  42473. },
  42474. rgbArray: function () {
  42475. return this.values.rgb;
  42476. },
  42477. hslArray: function () {
  42478. return this.values.hsl;
  42479. },
  42480. hsvArray: function () {
  42481. return this.values.hsv;
  42482. },
  42483. hwbArray: function () {
  42484. var values = this.values;
  42485. if (values.alpha !== 1) {
  42486. return values.hwb.concat([values.alpha]);
  42487. }
  42488. return values.hwb;
  42489. },
  42490. cmykArray: function () {
  42491. return this.values.cmyk;
  42492. },
  42493. rgbaArray: function () {
  42494. var values = this.values;
  42495. return values.rgb.concat([values.alpha]);
  42496. },
  42497. hslaArray: function () {
  42498. var values = this.values;
  42499. return values.hsl.concat([values.alpha]);
  42500. },
  42501. alpha: function (val) {
  42502. if (val === undefined) {
  42503. return this.values.alpha;
  42504. }
  42505. this.setValues('alpha', val);
  42506. return this;
  42507. },
  42508. red: function (val) {
  42509. return this.setChannel('rgb', 0, val);
  42510. },
  42511. green: function (val) {
  42512. return this.setChannel('rgb', 1, val);
  42513. },
  42514. blue: function (val) {
  42515. return this.setChannel('rgb', 2, val);
  42516. },
  42517. hue: function (val) {
  42518. if (val) {
  42519. val %= 360;
  42520. val = val < 0 ? 360 + val : val;
  42521. }
  42522. return this.setChannel('hsl', 0, val);
  42523. },
  42524. saturation: function (val) {
  42525. return this.setChannel('hsl', 1, val);
  42526. },
  42527. lightness: function (val) {
  42528. return this.setChannel('hsl', 2, val);
  42529. },
  42530. saturationv: function (val) {
  42531. return this.setChannel('hsv', 1, val);
  42532. },
  42533. whiteness: function (val) {
  42534. return this.setChannel('hwb', 1, val);
  42535. },
  42536. blackness: function (val) {
  42537. return this.setChannel('hwb', 2, val);
  42538. },
  42539. value: function (val) {
  42540. return this.setChannel('hsv', 2, val);
  42541. },
  42542. cyan: function (val) {
  42543. return this.setChannel('cmyk', 0, val);
  42544. },
  42545. magenta: function (val) {
  42546. return this.setChannel('cmyk', 1, val);
  42547. },
  42548. yellow: function (val) {
  42549. return this.setChannel('cmyk', 2, val);
  42550. },
  42551. black: function (val) {
  42552. return this.setChannel('cmyk', 3, val);
  42553. },
  42554. hexString: function () {
  42555. return string.hexString(this.values.rgb);
  42556. },
  42557. rgbString: function () {
  42558. return string.rgbString(this.values.rgb, this.values.alpha);
  42559. },
  42560. rgbaString: function () {
  42561. return string.rgbaString(this.values.rgb, this.values.alpha);
  42562. },
  42563. percentString: function () {
  42564. return string.percentString(this.values.rgb, this.values.alpha);
  42565. },
  42566. hslString: function () {
  42567. return string.hslString(this.values.hsl, this.values.alpha);
  42568. },
  42569. hslaString: function () {
  42570. return string.hslaString(this.values.hsl, this.values.alpha);
  42571. },
  42572. hwbString: function () {
  42573. return string.hwbString(this.values.hwb, this.values.alpha);
  42574. },
  42575. keyword: function () {
  42576. return string.keyword(this.values.rgb, this.values.alpha);
  42577. },
  42578. rgbNumber: function () {
  42579. var rgb = this.values.rgb;
  42580. return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];
  42581. },
  42582. luminosity: function () {
  42583. // http://www.w3.org/TR/WCAG20/#relativeluminancedef
  42584. var rgb = this.values.rgb;
  42585. var lum = [];
  42586. for (var i = 0; i < rgb.length; i++) {
  42587. var chan = rgb[i] / 255;
  42588. lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
  42589. }
  42590. return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
  42591. },
  42592. contrast: function (color2) {
  42593. // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
  42594. var lum1 = this.luminosity();
  42595. var lum2 = color2.luminosity();
  42596. if (lum1 > lum2) {
  42597. return (lum1 + 0.05) / (lum2 + 0.05);
  42598. }
  42599. return (lum2 + 0.05) / (lum1 + 0.05);
  42600. },
  42601. level: function (color2) {
  42602. var contrastRatio = this.contrast(color2);
  42603. if (contrastRatio >= 7.1) {
  42604. return 'AAA';
  42605. }
  42606. return (contrastRatio >= 4.5) ? 'AA' : '';
  42607. },
  42608. dark: function () {
  42609. // YIQ equation from http://24ways.org/2010/calculating-color-contrast
  42610. var rgb = this.values.rgb;
  42611. var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
  42612. return yiq < 128;
  42613. },
  42614. light: function () {
  42615. return !this.dark();
  42616. },
  42617. negate: function () {
  42618. var rgb = [];
  42619. for (var i = 0; i < 3; i++) {
  42620. rgb[i] = 255 - this.values.rgb[i];
  42621. }
  42622. this.setValues('rgb', rgb);
  42623. return this;
  42624. },
  42625. lighten: function (ratio) {
  42626. var hsl = this.values.hsl;
  42627. hsl[2] += hsl[2] * ratio;
  42628. this.setValues('hsl', hsl);
  42629. return this;
  42630. },
  42631. darken: function (ratio) {
  42632. var hsl = this.values.hsl;
  42633. hsl[2] -= hsl[2] * ratio;
  42634. this.setValues('hsl', hsl);
  42635. return this;
  42636. },
  42637. saturate: function (ratio) {
  42638. var hsl = this.values.hsl;
  42639. hsl[1] += hsl[1] * ratio;
  42640. this.setValues('hsl', hsl);
  42641. return this;
  42642. },
  42643. desaturate: function (ratio) {
  42644. var hsl = this.values.hsl;
  42645. hsl[1] -= hsl[1] * ratio;
  42646. this.setValues('hsl', hsl);
  42647. return this;
  42648. },
  42649. whiten: function (ratio) {
  42650. var hwb = this.values.hwb;
  42651. hwb[1] += hwb[1] * ratio;
  42652. this.setValues('hwb', hwb);
  42653. return this;
  42654. },
  42655. blacken: function (ratio) {
  42656. var hwb = this.values.hwb;
  42657. hwb[2] += hwb[2] * ratio;
  42658. this.setValues('hwb', hwb);
  42659. return this;
  42660. },
  42661. greyscale: function () {
  42662. var rgb = this.values.rgb;
  42663. // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
  42664. var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
  42665. this.setValues('rgb', [val, val, val]);
  42666. return this;
  42667. },
  42668. clearer: function (ratio) {
  42669. var alpha = this.values.alpha;
  42670. this.setValues('alpha', alpha - (alpha * ratio));
  42671. return this;
  42672. },
  42673. opaquer: function (ratio) {
  42674. var alpha = this.values.alpha;
  42675. this.setValues('alpha', alpha + (alpha * ratio));
  42676. return this;
  42677. },
  42678. rotate: function (degrees) {
  42679. var hsl = this.values.hsl;
  42680. var hue = (hsl[0] + degrees) % 360;
  42681. hsl[0] = hue < 0 ? 360 + hue : hue;
  42682. this.setValues('hsl', hsl);
  42683. return this;
  42684. },
  42685. /**
  42686. * Ported from sass implementation in C
  42687. * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
  42688. */
  42689. mix: function (mixinColor, weight) {
  42690. var color1 = this;
  42691. var color2 = mixinColor;
  42692. var p = weight === undefined ? 0.5 : weight;
  42693. var w = 2 * p - 1;
  42694. var a = color1.alpha() - color2.alpha();
  42695. var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  42696. var w2 = 1 - w1;
  42697. return this
  42698. .rgb(
  42699. w1 * color1.red() + w2 * color2.red(),
  42700. w1 * color1.green() + w2 * color2.green(),
  42701. w1 * color1.blue() + w2 * color2.blue()
  42702. )
  42703. .alpha(color1.alpha() * p + color2.alpha() * (1 - p));
  42704. },
  42705. toJSON: function () {
  42706. return this.rgb();
  42707. },
  42708. clone: function () {
  42709. // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,
  42710. // making the final build way to big to embed in Chart.js. So let's do it manually,
  42711. // assuming that values to clone are 1 dimension arrays containing only numbers,
  42712. // except 'alpha' which is a number.
  42713. var result = new Color();
  42714. var source = this.values;
  42715. var target = result.values;
  42716. var value, type;
  42717. for (var prop in source) {
  42718. if (source.hasOwnProperty(prop)) {
  42719. value = source[prop];
  42720. type = ({}).toString.call(value);
  42721. if (type === '[object Array]') {
  42722. target[prop] = value.slice(0);
  42723. } else if (type === '[object Number]') {
  42724. target[prop] = value;
  42725. } else {
  42726. console.error('unexpected color value:', value);
  42727. }
  42728. }
  42729. }
  42730. return result;
  42731. }
  42732. };
  42733. Color.prototype.spaces = {
  42734. rgb: ['red', 'green', 'blue'],
  42735. hsl: ['hue', 'saturation', 'lightness'],
  42736. hsv: ['hue', 'saturation', 'value'],
  42737. hwb: ['hue', 'whiteness', 'blackness'],
  42738. cmyk: ['cyan', 'magenta', 'yellow', 'black']
  42739. };
  42740. Color.prototype.maxes = {
  42741. rgb: [255, 255, 255],
  42742. hsl: [360, 100, 100],
  42743. hsv: [360, 100, 100],
  42744. hwb: [360, 100, 100],
  42745. cmyk: [100, 100, 100, 100]
  42746. };
  42747. Color.prototype.getValues = function (space) {
  42748. var values = this.values;
  42749. var vals = {};
  42750. for (var i = 0; i < space.length; i++) {
  42751. vals[space.charAt(i)] = values[space][i];
  42752. }
  42753. if (values.alpha !== 1) {
  42754. vals.a = values.alpha;
  42755. }
  42756. // {r: 255, g: 255, b: 255, a: 0.4}
  42757. return vals;
  42758. };
  42759. Color.prototype.setValues = function (space, vals) {
  42760. var values = this.values;
  42761. var spaces = this.spaces;
  42762. var maxes = this.maxes;
  42763. var alpha = 1;
  42764. var i;
  42765. this.valid = true;
  42766. if (space === 'alpha') {
  42767. alpha = vals;
  42768. } else if (vals.length) {
  42769. // [10, 10, 10]
  42770. values[space] = vals.slice(0, space.length);
  42771. alpha = vals[space.length];
  42772. } else if (vals[space.charAt(0)] !== undefined) {
  42773. // {r: 10, g: 10, b: 10}
  42774. for (i = 0; i < space.length; i++) {
  42775. values[space][i] = vals[space.charAt(i)];
  42776. }
  42777. alpha = vals.a;
  42778. } else if (vals[spaces[space][0]] !== undefined) {
  42779. // {red: 10, green: 10, blue: 10}
  42780. var chans = spaces[space];
  42781. for (i = 0; i < space.length; i++) {
  42782. values[space][i] = vals[chans[i]];
  42783. }
  42784. alpha = vals.alpha;
  42785. }
  42786. values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));
  42787. if (space === 'alpha') {
  42788. return false;
  42789. }
  42790. var capped;
  42791. // cap values of the space prior converting all values
  42792. for (i = 0; i < space.length; i++) {
  42793. capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));
  42794. values[space][i] = Math.round(capped);
  42795. }
  42796. // convert to all the other color spaces
  42797. for (var sname in spaces) {
  42798. if (sname !== space) {
  42799. values[sname] = convert[space][sname](values[space]);
  42800. }
  42801. }
  42802. return true;
  42803. };
  42804. Color.prototype.setSpace = function (space, args) {
  42805. var vals = args[0];
  42806. if (vals === undefined) {
  42807. // color.rgb()
  42808. return this.getValues(space);
  42809. }
  42810. // color.rgb(10, 10, 10)
  42811. if (typeof vals === 'number') {
  42812. vals = Array.prototype.slice.call(args);
  42813. }
  42814. this.setValues(space, vals);
  42815. return this;
  42816. };
  42817. Color.prototype.setChannel = function (space, index, val) {
  42818. var svalues = this.values[space];
  42819. if (val === undefined) {
  42820. // color.red()
  42821. return svalues[index];
  42822. } else if (val === svalues[index]) {
  42823. // color.red(color.red())
  42824. return this;
  42825. }
  42826. // color.red(100)
  42827. svalues[index] = val;
  42828. this.setValues(space, svalues);
  42829. return this;
  42830. };
  42831. if (typeof window !== 'undefined') {
  42832. window.Color = Color;
  42833. }
  42834. module.exports = Color;
  42835. /***/ }),
  42836. /* 169 */
  42837. /***/ (function(module, exports) {
  42838. /* MIT license */
  42839. module.exports = {
  42840. rgb2hsl: rgb2hsl,
  42841. rgb2hsv: rgb2hsv,
  42842. rgb2hwb: rgb2hwb,
  42843. rgb2cmyk: rgb2cmyk,
  42844. rgb2keyword: rgb2keyword,
  42845. rgb2xyz: rgb2xyz,
  42846. rgb2lab: rgb2lab,
  42847. rgb2lch: rgb2lch,
  42848. hsl2rgb: hsl2rgb,
  42849. hsl2hsv: hsl2hsv,
  42850. hsl2hwb: hsl2hwb,
  42851. hsl2cmyk: hsl2cmyk,
  42852. hsl2keyword: hsl2keyword,
  42853. hsv2rgb: hsv2rgb,
  42854. hsv2hsl: hsv2hsl,
  42855. hsv2hwb: hsv2hwb,
  42856. hsv2cmyk: hsv2cmyk,
  42857. hsv2keyword: hsv2keyword,
  42858. hwb2rgb: hwb2rgb,
  42859. hwb2hsl: hwb2hsl,
  42860. hwb2hsv: hwb2hsv,
  42861. hwb2cmyk: hwb2cmyk,
  42862. hwb2keyword: hwb2keyword,
  42863. cmyk2rgb: cmyk2rgb,
  42864. cmyk2hsl: cmyk2hsl,
  42865. cmyk2hsv: cmyk2hsv,
  42866. cmyk2hwb: cmyk2hwb,
  42867. cmyk2keyword: cmyk2keyword,
  42868. keyword2rgb: keyword2rgb,
  42869. keyword2hsl: keyword2hsl,
  42870. keyword2hsv: keyword2hsv,
  42871. keyword2hwb: keyword2hwb,
  42872. keyword2cmyk: keyword2cmyk,
  42873. keyword2lab: keyword2lab,
  42874. keyword2xyz: keyword2xyz,
  42875. xyz2rgb: xyz2rgb,
  42876. xyz2lab: xyz2lab,
  42877. xyz2lch: xyz2lch,
  42878. lab2xyz: lab2xyz,
  42879. lab2rgb: lab2rgb,
  42880. lab2lch: lab2lch,
  42881. lch2lab: lch2lab,
  42882. lch2xyz: lch2xyz,
  42883. lch2rgb: lch2rgb
  42884. }
  42885. function rgb2hsl(rgb) {
  42886. var r = rgb[0]/255,
  42887. g = rgb[1]/255,
  42888. b = rgb[2]/255,
  42889. min = Math.min(r, g, b),
  42890. max = Math.max(r, g, b),
  42891. delta = max - min,
  42892. h, s, l;
  42893. if (max == min)
  42894. h = 0;
  42895. else if (r == max)
  42896. h = (g - b) / delta;
  42897. else if (g == max)
  42898. h = 2 + (b - r) / delta;
  42899. else if (b == max)
  42900. h = 4 + (r - g)/ delta;
  42901. h = Math.min(h * 60, 360);
  42902. if (h < 0)
  42903. h += 360;
  42904. l = (min + max) / 2;
  42905. if (max == min)
  42906. s = 0;
  42907. else if (l <= 0.5)
  42908. s = delta / (max + min);
  42909. else
  42910. s = delta / (2 - max - min);
  42911. return [h, s * 100, l * 100];
  42912. }
  42913. function rgb2hsv(rgb) {
  42914. var r = rgb[0],
  42915. g = rgb[1],
  42916. b = rgb[2],
  42917. min = Math.min(r, g, b),
  42918. max = Math.max(r, g, b),
  42919. delta = max - min,
  42920. h, s, v;
  42921. if (max == 0)
  42922. s = 0;
  42923. else
  42924. s = (delta/max * 1000)/10;
  42925. if (max == min)
  42926. h = 0;
  42927. else if (r == max)
  42928. h = (g - b) / delta;
  42929. else if (g == max)
  42930. h = 2 + (b - r) / delta;
  42931. else if (b == max)
  42932. h = 4 + (r - g) / delta;
  42933. h = Math.min(h * 60, 360);
  42934. if (h < 0)
  42935. h += 360;
  42936. v = ((max / 255) * 1000) / 10;
  42937. return [h, s, v];
  42938. }
  42939. function rgb2hwb(rgb) {
  42940. var r = rgb[0],
  42941. g = rgb[1],
  42942. b = rgb[2],
  42943. h = rgb2hsl(rgb)[0],
  42944. w = 1/255 * Math.min(r, Math.min(g, b)),
  42945. b = 1 - 1/255 * Math.max(r, Math.max(g, b));
  42946. return [h, w * 100, b * 100];
  42947. }
  42948. function rgb2cmyk(rgb) {
  42949. var r = rgb[0] / 255,
  42950. g = rgb[1] / 255,
  42951. b = rgb[2] / 255,
  42952. c, m, y, k;
  42953. k = Math.min(1 - r, 1 - g, 1 - b);
  42954. c = (1 - r - k) / (1 - k) || 0;
  42955. m = (1 - g - k) / (1 - k) || 0;
  42956. y = (1 - b - k) / (1 - k) || 0;
  42957. return [c * 100, m * 100, y * 100, k * 100];
  42958. }
  42959. function rgb2keyword(rgb) {
  42960. return reverseKeywords[JSON.stringify(rgb)];
  42961. }
  42962. function rgb2xyz(rgb) {
  42963. var r = rgb[0] / 255,
  42964. g = rgb[1] / 255,
  42965. b = rgb[2] / 255;
  42966. // assume sRGB
  42967. r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
  42968. g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
  42969. b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
  42970. var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
  42971. var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
  42972. var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
  42973. return [x * 100, y *100, z * 100];
  42974. }
  42975. function rgb2lab(rgb) {
  42976. var xyz = rgb2xyz(rgb),
  42977. x = xyz[0],
  42978. y = xyz[1],
  42979. z = xyz[2],
  42980. l, a, b;
  42981. x /= 95.047;
  42982. y /= 100;
  42983. z /= 108.883;
  42984. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  42985. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  42986. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  42987. l = (116 * y) - 16;
  42988. a = 500 * (x - y);
  42989. b = 200 * (y - z);
  42990. return [l, a, b];
  42991. }
  42992. function rgb2lch(args) {
  42993. return lab2lch(rgb2lab(args));
  42994. }
  42995. function hsl2rgb(hsl) {
  42996. var h = hsl[0] / 360,
  42997. s = hsl[1] / 100,
  42998. l = hsl[2] / 100,
  42999. t1, t2, t3, rgb, val;
  43000. if (s == 0) {
  43001. val = l * 255;
  43002. return [val, val, val];
  43003. }
  43004. if (l < 0.5)
  43005. t2 = l * (1 + s);
  43006. else
  43007. t2 = l + s - l * s;
  43008. t1 = 2 * l - t2;
  43009. rgb = [0, 0, 0];
  43010. for (var i = 0; i < 3; i++) {
  43011. t3 = h + 1 / 3 * - (i - 1);
  43012. t3 < 0 && t3++;
  43013. t3 > 1 && t3--;
  43014. if (6 * t3 < 1)
  43015. val = t1 + (t2 - t1) * 6 * t3;
  43016. else if (2 * t3 < 1)
  43017. val = t2;
  43018. else if (3 * t3 < 2)
  43019. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  43020. else
  43021. val = t1;
  43022. rgb[i] = val * 255;
  43023. }
  43024. return rgb;
  43025. }
  43026. function hsl2hsv(hsl) {
  43027. var h = hsl[0],
  43028. s = hsl[1] / 100,
  43029. l = hsl[2] / 100,
  43030. sv, v;
  43031. if(l === 0) {
  43032. // no need to do calc on black
  43033. // also avoids divide by 0 error
  43034. return [0, 0, 0];
  43035. }
  43036. l *= 2;
  43037. s *= (l <= 1) ? l : 2 - l;
  43038. v = (l + s) / 2;
  43039. sv = (2 * s) / (l + s);
  43040. return [h, sv * 100, v * 100];
  43041. }
  43042. function hsl2hwb(args) {
  43043. return rgb2hwb(hsl2rgb(args));
  43044. }
  43045. function hsl2cmyk(args) {
  43046. return rgb2cmyk(hsl2rgb(args));
  43047. }
  43048. function hsl2keyword(args) {
  43049. return rgb2keyword(hsl2rgb(args));
  43050. }
  43051. function hsv2rgb(hsv) {
  43052. var h = hsv[0] / 60,
  43053. s = hsv[1] / 100,
  43054. v = hsv[2] / 100,
  43055. hi = Math.floor(h) % 6;
  43056. var f = h - Math.floor(h),
  43057. p = 255 * v * (1 - s),
  43058. q = 255 * v * (1 - (s * f)),
  43059. t = 255 * v * (1 - (s * (1 - f))),
  43060. v = 255 * v;
  43061. switch(hi) {
  43062. case 0:
  43063. return [v, t, p];
  43064. case 1:
  43065. return [q, v, p];
  43066. case 2:
  43067. return [p, v, t];
  43068. case 3:
  43069. return [p, q, v];
  43070. case 4:
  43071. return [t, p, v];
  43072. case 5:
  43073. return [v, p, q];
  43074. }
  43075. }
  43076. function hsv2hsl(hsv) {
  43077. var h = hsv[0],
  43078. s = hsv[1] / 100,
  43079. v = hsv[2] / 100,
  43080. sl, l;
  43081. l = (2 - s) * v;
  43082. sl = s * v;
  43083. sl /= (l <= 1) ? l : 2 - l;
  43084. sl = sl || 0;
  43085. l /= 2;
  43086. return [h, sl * 100, l * 100];
  43087. }
  43088. function hsv2hwb(args) {
  43089. return rgb2hwb(hsv2rgb(args))
  43090. }
  43091. function hsv2cmyk(args) {
  43092. return rgb2cmyk(hsv2rgb(args));
  43093. }
  43094. function hsv2keyword(args) {
  43095. return rgb2keyword(hsv2rgb(args));
  43096. }
  43097. // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  43098. function hwb2rgb(hwb) {
  43099. var h = hwb[0] / 360,
  43100. wh = hwb[1] / 100,
  43101. bl = hwb[2] / 100,
  43102. ratio = wh + bl,
  43103. i, v, f, n;
  43104. // wh + bl cant be > 1
  43105. if (ratio > 1) {
  43106. wh /= ratio;
  43107. bl /= ratio;
  43108. }
  43109. i = Math.floor(6 * h);
  43110. v = 1 - bl;
  43111. f = 6 * h - i;
  43112. if ((i & 0x01) != 0) {
  43113. f = 1 - f;
  43114. }
  43115. n = wh + f * (v - wh); // linear interpolation
  43116. switch (i) {
  43117. default:
  43118. case 6:
  43119. case 0: r = v; g = n; b = wh; break;
  43120. case 1: r = n; g = v; b = wh; break;
  43121. case 2: r = wh; g = v; b = n; break;
  43122. case 3: r = wh; g = n; b = v; break;
  43123. case 4: r = n; g = wh; b = v; break;
  43124. case 5: r = v; g = wh; b = n; break;
  43125. }
  43126. return [r * 255, g * 255, b * 255];
  43127. }
  43128. function hwb2hsl(args) {
  43129. return rgb2hsl(hwb2rgb(args));
  43130. }
  43131. function hwb2hsv(args) {
  43132. return rgb2hsv(hwb2rgb(args));
  43133. }
  43134. function hwb2cmyk(args) {
  43135. return rgb2cmyk(hwb2rgb(args));
  43136. }
  43137. function hwb2keyword(args) {
  43138. return rgb2keyword(hwb2rgb(args));
  43139. }
  43140. function cmyk2rgb(cmyk) {
  43141. var c = cmyk[0] / 100,
  43142. m = cmyk[1] / 100,
  43143. y = cmyk[2] / 100,
  43144. k = cmyk[3] / 100,
  43145. r, g, b;
  43146. r = 1 - Math.min(1, c * (1 - k) + k);
  43147. g = 1 - Math.min(1, m * (1 - k) + k);
  43148. b = 1 - Math.min(1, y * (1 - k) + k);
  43149. return [r * 255, g * 255, b * 255];
  43150. }
  43151. function cmyk2hsl(args) {
  43152. return rgb2hsl(cmyk2rgb(args));
  43153. }
  43154. function cmyk2hsv(args) {
  43155. return rgb2hsv(cmyk2rgb(args));
  43156. }
  43157. function cmyk2hwb(args) {
  43158. return rgb2hwb(cmyk2rgb(args));
  43159. }
  43160. function cmyk2keyword(args) {
  43161. return rgb2keyword(cmyk2rgb(args));
  43162. }
  43163. function xyz2rgb(xyz) {
  43164. var x = xyz[0] / 100,
  43165. y = xyz[1] / 100,
  43166. z = xyz[2] / 100,
  43167. r, g, b;
  43168. r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
  43169. g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
  43170. b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
  43171. // assume sRGB
  43172. r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
  43173. : r = (r * 12.92);
  43174. g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
  43175. : g = (g * 12.92);
  43176. b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
  43177. : b = (b * 12.92);
  43178. r = Math.min(Math.max(0, r), 1);
  43179. g = Math.min(Math.max(0, g), 1);
  43180. b = Math.min(Math.max(0, b), 1);
  43181. return [r * 255, g * 255, b * 255];
  43182. }
  43183. function xyz2lab(xyz) {
  43184. var x = xyz[0],
  43185. y = xyz[1],
  43186. z = xyz[2],
  43187. l, a, b;
  43188. x /= 95.047;
  43189. y /= 100;
  43190. z /= 108.883;
  43191. x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);
  43192. y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);
  43193. z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);
  43194. l = (116 * y) - 16;
  43195. a = 500 * (x - y);
  43196. b = 200 * (y - z);
  43197. return [l, a, b];
  43198. }
  43199. function xyz2lch(args) {
  43200. return lab2lch(xyz2lab(args));
  43201. }
  43202. function lab2xyz(lab) {
  43203. var l = lab[0],
  43204. a = lab[1],
  43205. b = lab[2],
  43206. x, y, z, y2;
  43207. if (l <= 8) {
  43208. y = (l * 100) / 903.3;
  43209. y2 = (7.787 * (y / 100)) + (16 / 116);
  43210. } else {
  43211. y = 100 * Math.pow((l + 16) / 116, 3);
  43212. y2 = Math.pow(y / 100, 1/3);
  43213. }
  43214. x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);
  43215. z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);
  43216. return [x, y, z];
  43217. }
  43218. function lab2lch(lab) {
  43219. var l = lab[0],
  43220. a = lab[1],
  43221. b = lab[2],
  43222. hr, h, c;
  43223. hr = Math.atan2(b, a);
  43224. h = hr * 360 / 2 / Math.PI;
  43225. if (h < 0) {
  43226. h += 360;
  43227. }
  43228. c = Math.sqrt(a * a + b * b);
  43229. return [l, c, h];
  43230. }
  43231. function lab2rgb(args) {
  43232. return xyz2rgb(lab2xyz(args));
  43233. }
  43234. function lch2lab(lch) {
  43235. var l = lch[0],
  43236. c = lch[1],
  43237. h = lch[2],
  43238. a, b, hr;
  43239. hr = h / 360 * 2 * Math.PI;
  43240. a = c * Math.cos(hr);
  43241. b = c * Math.sin(hr);
  43242. return [l, a, b];
  43243. }
  43244. function lch2xyz(args) {
  43245. return lab2xyz(lch2lab(args));
  43246. }
  43247. function lch2rgb(args) {
  43248. return lab2rgb(lch2lab(args));
  43249. }
  43250. function keyword2rgb(keyword) {
  43251. return cssKeywords[keyword];
  43252. }
  43253. function keyword2hsl(args) {
  43254. return rgb2hsl(keyword2rgb(args));
  43255. }
  43256. function keyword2hsv(args) {
  43257. return rgb2hsv(keyword2rgb(args));
  43258. }
  43259. function keyword2hwb(args) {
  43260. return rgb2hwb(keyword2rgb(args));
  43261. }
  43262. function keyword2cmyk(args) {
  43263. return rgb2cmyk(keyword2rgb(args));
  43264. }
  43265. function keyword2lab(args) {
  43266. return rgb2lab(keyword2rgb(args));
  43267. }
  43268. function keyword2xyz(args) {
  43269. return rgb2xyz(keyword2rgb(args));
  43270. }
  43271. var cssKeywords = {
  43272. aliceblue: [240,248,255],
  43273. antiquewhite: [250,235,215],
  43274. aqua: [0,255,255],
  43275. aquamarine: [127,255,212],
  43276. azure: [240,255,255],
  43277. beige: [245,245,220],
  43278. bisque: [255,228,196],
  43279. black: [0,0,0],
  43280. blanchedalmond: [255,235,205],
  43281. blue: [0,0,255],
  43282. blueviolet: [138,43,226],
  43283. brown: [165,42,42],
  43284. burlywood: [222,184,135],
  43285. cadetblue: [95,158,160],
  43286. chartreuse: [127,255,0],
  43287. chocolate: [210,105,30],
  43288. coral: [255,127,80],
  43289. cornflowerblue: [100,149,237],
  43290. cornsilk: [255,248,220],
  43291. crimson: [220,20,60],
  43292. cyan: [0,255,255],
  43293. darkblue: [0,0,139],
  43294. darkcyan: [0,139,139],
  43295. darkgoldenrod: [184,134,11],
  43296. darkgray: [169,169,169],
  43297. darkgreen: [0,100,0],
  43298. darkgrey: [169,169,169],
  43299. darkkhaki: [189,183,107],
  43300. darkmagenta: [139,0,139],
  43301. darkolivegreen: [85,107,47],
  43302. darkorange: [255,140,0],
  43303. darkorchid: [153,50,204],
  43304. darkred: [139,0,0],
  43305. darksalmon: [233,150,122],
  43306. darkseagreen: [143,188,143],
  43307. darkslateblue: [72,61,139],
  43308. darkslategray: [47,79,79],
  43309. darkslategrey: [47,79,79],
  43310. darkturquoise: [0,206,209],
  43311. darkviolet: [148,0,211],
  43312. deeppink: [255,20,147],
  43313. deepskyblue: [0,191,255],
  43314. dimgray: [105,105,105],
  43315. dimgrey: [105,105,105],
  43316. dodgerblue: [30,144,255],
  43317. firebrick: [178,34,34],
  43318. floralwhite: [255,250,240],
  43319. forestgreen: [34,139,34],
  43320. fuchsia: [255,0,255],
  43321. gainsboro: [220,220,220],
  43322. ghostwhite: [248,248,255],
  43323. gold: [255,215,0],
  43324. goldenrod: [218,165,32],
  43325. gray: [128,128,128],
  43326. green: [0,128,0],
  43327. greenyellow: [173,255,47],
  43328. grey: [128,128,128],
  43329. honeydew: [240,255,240],
  43330. hotpink: [255,105,180],
  43331. indianred: [205,92,92],
  43332. indigo: [75,0,130],
  43333. ivory: [255,255,240],
  43334. khaki: [240,230,140],
  43335. lavender: [230,230,250],
  43336. lavenderblush: [255,240,245],
  43337. lawngreen: [124,252,0],
  43338. lemonchiffon: [255,250,205],
  43339. lightblue: [173,216,230],
  43340. lightcoral: [240,128,128],
  43341. lightcyan: [224,255,255],
  43342. lightgoldenrodyellow: [250,250,210],
  43343. lightgray: [211,211,211],
  43344. lightgreen: [144,238,144],
  43345. lightgrey: [211,211,211],
  43346. lightpink: [255,182,193],
  43347. lightsalmon: [255,160,122],
  43348. lightseagreen: [32,178,170],
  43349. lightskyblue: [135,206,250],
  43350. lightslategray: [119,136,153],
  43351. lightslategrey: [119,136,153],
  43352. lightsteelblue: [176,196,222],
  43353. lightyellow: [255,255,224],
  43354. lime: [0,255,0],
  43355. limegreen: [50,205,50],
  43356. linen: [250,240,230],
  43357. magenta: [255,0,255],
  43358. maroon: [128,0,0],
  43359. mediumaquamarine: [102,205,170],
  43360. mediumblue: [0,0,205],
  43361. mediumorchid: [186,85,211],
  43362. mediumpurple: [147,112,219],
  43363. mediumseagreen: [60,179,113],
  43364. mediumslateblue: [123,104,238],
  43365. mediumspringgreen: [0,250,154],
  43366. mediumturquoise: [72,209,204],
  43367. mediumvioletred: [199,21,133],
  43368. midnightblue: [25,25,112],
  43369. mintcream: [245,255,250],
  43370. mistyrose: [255,228,225],
  43371. moccasin: [255,228,181],
  43372. navajowhite: [255,222,173],
  43373. navy: [0,0,128],
  43374. oldlace: [253,245,230],
  43375. olive: [128,128,0],
  43376. olivedrab: [107,142,35],
  43377. orange: [255,165,0],
  43378. orangered: [255,69,0],
  43379. orchid: [218,112,214],
  43380. palegoldenrod: [238,232,170],
  43381. palegreen: [152,251,152],
  43382. paleturquoise: [175,238,238],
  43383. palevioletred: [219,112,147],
  43384. papayawhip: [255,239,213],
  43385. peachpuff: [255,218,185],
  43386. peru: [205,133,63],
  43387. pink: [255,192,203],
  43388. plum: [221,160,221],
  43389. powderblue: [176,224,230],
  43390. purple: [128,0,128],
  43391. rebeccapurple: [102, 51, 153],
  43392. red: [255,0,0],
  43393. rosybrown: [188,143,143],
  43394. royalblue: [65,105,225],
  43395. saddlebrown: [139,69,19],
  43396. salmon: [250,128,114],
  43397. sandybrown: [244,164,96],
  43398. seagreen: [46,139,87],
  43399. seashell: [255,245,238],
  43400. sienna: [160,82,45],
  43401. silver: [192,192,192],
  43402. skyblue: [135,206,235],
  43403. slateblue: [106,90,205],
  43404. slategray: [112,128,144],
  43405. slategrey: [112,128,144],
  43406. snow: [255,250,250],
  43407. springgreen: [0,255,127],
  43408. steelblue: [70,130,180],
  43409. tan: [210,180,140],
  43410. teal: [0,128,128],
  43411. thistle: [216,191,216],
  43412. tomato: [255,99,71],
  43413. turquoise: [64,224,208],
  43414. violet: [238,130,238],
  43415. wheat: [245,222,179],
  43416. white: [255,255,255],
  43417. whitesmoke: [245,245,245],
  43418. yellow: [255,255,0],
  43419. yellowgreen: [154,205,50]
  43420. };
  43421. var reverseKeywords = {};
  43422. for (var key in cssKeywords) {
  43423. reverseKeywords[JSON.stringify(cssKeywords[key])] = key;
  43424. }
  43425. /***/ }),
  43426. /* 170 */
  43427. /***/ (function(module, exports, __webpack_require__) {
  43428. var conversions = __webpack_require__(169);
  43429. var convert = function() {
  43430. return new Converter();
  43431. }
  43432. for (var func in conversions) {
  43433. // export Raw versions
  43434. convert[func + "Raw"] = (function(func) {
  43435. // accept array or plain args
  43436. return function(arg) {
  43437. if (typeof arg == "number")
  43438. arg = Array.prototype.slice.call(arguments);
  43439. return conversions[func](arg);
  43440. }
  43441. })(func);
  43442. var pair = /(\w+)2(\w+)/.exec(func),
  43443. from = pair[1],
  43444. to = pair[2];
  43445. // export rgb2hsl and ["rgb"]["hsl"]
  43446. convert[from] = convert[from] || {};
  43447. convert[from][to] = convert[func] = (function(func) {
  43448. return function(arg) {
  43449. if (typeof arg == "number")
  43450. arg = Array.prototype.slice.call(arguments);
  43451. var val = conversions[func](arg);
  43452. if (typeof val == "string" || val === undefined)
  43453. return val; // keyword
  43454. for (var i = 0; i < val.length; i++)
  43455. val[i] = Math.round(val[i]);
  43456. return val;
  43457. }
  43458. })(func);
  43459. }
  43460. /* Converter does lazy conversion and caching */
  43461. var Converter = function() {
  43462. this.convs = {};
  43463. };
  43464. /* Either get the values for a space or
  43465. set the values for a space, depending on args */
  43466. Converter.prototype.routeSpace = function(space, args) {
  43467. var values = args[0];
  43468. if (values === undefined) {
  43469. // color.rgb()
  43470. return this.getValues(space);
  43471. }
  43472. // color.rgb(10, 10, 10)
  43473. if (typeof values == "number") {
  43474. values = Array.prototype.slice.call(args);
  43475. }
  43476. return this.setValues(space, values);
  43477. };
  43478. /* Set the values for a space, invalidating cache */
  43479. Converter.prototype.setValues = function(space, values) {
  43480. this.space = space;
  43481. this.convs = {};
  43482. this.convs[space] = values;
  43483. return this;
  43484. };
  43485. /* Get the values for a space. If there's already
  43486. a conversion for the space, fetch it, otherwise
  43487. compute it */
  43488. Converter.prototype.getValues = function(space) {
  43489. var vals = this.convs[space];
  43490. if (!vals) {
  43491. var fspace = this.space,
  43492. from = this.convs[fspace];
  43493. vals = convert[fspace][space](from);
  43494. this.convs[space] = vals;
  43495. }
  43496. return vals;
  43497. };
  43498. ["rgb", "hsl", "hsv", "cmyk", "keyword"].forEach(function(space) {
  43499. Converter.prototype[space] = function(vals) {
  43500. return this.routeSpace(space, arguments);
  43501. }
  43502. });
  43503. module.exports = convert;
  43504. /***/ }),
  43505. /* 171 */
  43506. /***/ (function(module, exports) {
  43507. module.exports = {
  43508. "aliceblue": [240, 248, 255],
  43509. "antiquewhite": [250, 235, 215],
  43510. "aqua": [0, 255, 255],
  43511. "aquamarine": [127, 255, 212],
  43512. "azure": [240, 255, 255],
  43513. "beige": [245, 245, 220],
  43514. "bisque": [255, 228, 196],
  43515. "black": [0, 0, 0],
  43516. "blanchedalmond": [255, 235, 205],
  43517. "blue": [0, 0, 255],
  43518. "blueviolet": [138, 43, 226],
  43519. "brown": [165, 42, 42],
  43520. "burlywood": [222, 184, 135],
  43521. "cadetblue": [95, 158, 160],
  43522. "chartreuse": [127, 255, 0],
  43523. "chocolate": [210, 105, 30],
  43524. "coral": [255, 127, 80],
  43525. "cornflowerblue": [100, 149, 237],
  43526. "cornsilk": [255, 248, 220],
  43527. "crimson": [220, 20, 60],
  43528. "cyan": [0, 255, 255],
  43529. "darkblue": [0, 0, 139],
  43530. "darkcyan": [0, 139, 139],
  43531. "darkgoldenrod": [184, 134, 11],
  43532. "darkgray": [169, 169, 169],
  43533. "darkgreen": [0, 100, 0],
  43534. "darkgrey": [169, 169, 169],
  43535. "darkkhaki": [189, 183, 107],
  43536. "darkmagenta": [139, 0, 139],
  43537. "darkolivegreen": [85, 107, 47],
  43538. "darkorange": [255, 140, 0],
  43539. "darkorchid": [153, 50, 204],
  43540. "darkred": [139, 0, 0],
  43541. "darksalmon": [233, 150, 122],
  43542. "darkseagreen": [143, 188, 143],
  43543. "darkslateblue": [72, 61, 139],
  43544. "darkslategray": [47, 79, 79],
  43545. "darkslategrey": [47, 79, 79],
  43546. "darkturquoise": [0, 206, 209],
  43547. "darkviolet": [148, 0, 211],
  43548. "deeppink": [255, 20, 147],
  43549. "deepskyblue": [0, 191, 255],
  43550. "dimgray": [105, 105, 105],
  43551. "dimgrey": [105, 105, 105],
  43552. "dodgerblue": [30, 144, 255],
  43553. "firebrick": [178, 34, 34],
  43554. "floralwhite": [255, 250, 240],
  43555. "forestgreen": [34, 139, 34],
  43556. "fuchsia": [255, 0, 255],
  43557. "gainsboro": [220, 220, 220],
  43558. "ghostwhite": [248, 248, 255],
  43559. "gold": [255, 215, 0],
  43560. "goldenrod": [218, 165, 32],
  43561. "gray": [128, 128, 128],
  43562. "green": [0, 128, 0],
  43563. "greenyellow": [173, 255, 47],
  43564. "grey": [128, 128, 128],
  43565. "honeydew": [240, 255, 240],
  43566. "hotpink": [255, 105, 180],
  43567. "indianred": [205, 92, 92],
  43568. "indigo": [75, 0, 130],
  43569. "ivory": [255, 255, 240],
  43570. "khaki": [240, 230, 140],
  43571. "lavender": [230, 230, 250],
  43572. "lavenderblush": [255, 240, 245],
  43573. "lawngreen": [124, 252, 0],
  43574. "lemonchiffon": [255, 250, 205],
  43575. "lightblue": [173, 216, 230],
  43576. "lightcoral": [240, 128, 128],
  43577. "lightcyan": [224, 255, 255],
  43578. "lightgoldenrodyellow": [250, 250, 210],
  43579. "lightgray": [211, 211, 211],
  43580. "lightgreen": [144, 238, 144],
  43581. "lightgrey": [211, 211, 211],
  43582. "lightpink": [255, 182, 193],
  43583. "lightsalmon": [255, 160, 122],
  43584. "lightseagreen": [32, 178, 170],
  43585. "lightskyblue": [135, 206, 250],
  43586. "lightslategray": [119, 136, 153],
  43587. "lightslategrey": [119, 136, 153],
  43588. "lightsteelblue": [176, 196, 222],
  43589. "lightyellow": [255, 255, 224],
  43590. "lime": [0, 255, 0],
  43591. "limegreen": [50, 205, 50],
  43592. "linen": [250, 240, 230],
  43593. "magenta": [255, 0, 255],
  43594. "maroon": [128, 0, 0],
  43595. "mediumaquamarine": [102, 205, 170],
  43596. "mediumblue": [0, 0, 205],
  43597. "mediumorchid": [186, 85, 211],
  43598. "mediumpurple": [147, 112, 219],
  43599. "mediumseagreen": [60, 179, 113],
  43600. "mediumslateblue": [123, 104, 238],
  43601. "mediumspringgreen": [0, 250, 154],
  43602. "mediumturquoise": [72, 209, 204],
  43603. "mediumvioletred": [199, 21, 133],
  43604. "midnightblue": [25, 25, 112],
  43605. "mintcream": [245, 255, 250],
  43606. "mistyrose": [255, 228, 225],
  43607. "moccasin": [255, 228, 181],
  43608. "navajowhite": [255, 222, 173],
  43609. "navy": [0, 0, 128],
  43610. "oldlace": [253, 245, 230],
  43611. "olive": [128, 128, 0],
  43612. "olivedrab": [107, 142, 35],
  43613. "orange": [255, 165, 0],
  43614. "orangered": [255, 69, 0],
  43615. "orchid": [218, 112, 214],
  43616. "palegoldenrod": [238, 232, 170],
  43617. "palegreen": [152, 251, 152],
  43618. "paleturquoise": [175, 238, 238],
  43619. "palevioletred": [219, 112, 147],
  43620. "papayawhip": [255, 239, 213],
  43621. "peachpuff": [255, 218, 185],
  43622. "peru": [205, 133, 63],
  43623. "pink": [255, 192, 203],
  43624. "plum": [221, 160, 221],
  43625. "powderblue": [176, 224, 230],
  43626. "purple": [128, 0, 128],
  43627. "rebeccapurple": [102, 51, 153],
  43628. "red": [255, 0, 0],
  43629. "rosybrown": [188, 143, 143],
  43630. "royalblue": [65, 105, 225],
  43631. "saddlebrown": [139, 69, 19],
  43632. "salmon": [250, 128, 114],
  43633. "sandybrown": [244, 164, 96],
  43634. "seagreen": [46, 139, 87],
  43635. "seashell": [255, 245, 238],
  43636. "sienna": [160, 82, 45],
  43637. "silver": [192, 192, 192],
  43638. "skyblue": [135, 206, 235],
  43639. "slateblue": [106, 90, 205],
  43640. "slategray": [112, 128, 144],
  43641. "slategrey": [112, 128, 144],
  43642. "snow": [255, 250, 250],
  43643. "springgreen": [0, 255, 127],
  43644. "steelblue": [70, 130, 180],
  43645. "tan": [210, 180, 140],
  43646. "teal": [0, 128, 128],
  43647. "thistle": [216, 191, 216],
  43648. "tomato": [255, 99, 71],
  43649. "turquoise": [64, 224, 208],
  43650. "violet": [238, 130, 238],
  43651. "wheat": [245, 222, 179],
  43652. "white": [255, 255, 255],
  43653. "whitesmoke": [245, 245, 245],
  43654. "yellow": [255, 255, 0],
  43655. "yellowgreen": [154, 205, 50]
  43656. };
  43657. /***/ }),
  43658. /* 172 */
  43659. /***/ (function(module, exports, __webpack_require__) {
  43660. exports = module.exports = __webpack_require__(4)();
  43661. // imports
  43662. // module
  43663. 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", ""]);
  43664. // exports
  43665. /***/ }),
  43666. /* 173 */
  43667. /***/ (function(module, exports, __webpack_require__) {
  43668. exports = module.exports = __webpack_require__(4)();
  43669. // imports
  43670. // module
  43671. 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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
  43672. // exports
  43673. /***/ }),
  43674. /* 174 */
  43675. /***/ (function(module, exports, __webpack_require__) {
  43676. var map = {
  43677. "./af": 5,
  43678. "./af.js": 5,
  43679. "./ar": 11,
  43680. "./ar-dz": 6,
  43681. "./ar-dz.js": 6,
  43682. "./ar-ly": 7,
  43683. "./ar-ly.js": 7,
  43684. "./ar-ma": 8,
  43685. "./ar-ma.js": 8,
  43686. "./ar-sa": 9,
  43687. "./ar-sa.js": 9,
  43688. "./ar-tn": 10,
  43689. "./ar-tn.js": 10,
  43690. "./ar.js": 11,
  43691. "./az": 12,
  43692. "./az.js": 12,
  43693. "./be": 13,
  43694. "./be.js": 13,
  43695. "./bg": 14,
  43696. "./bg.js": 14,
  43697. "./bn": 15,
  43698. "./bn.js": 15,
  43699. "./bo": 16,
  43700. "./bo.js": 16,
  43701. "./br": 17,
  43702. "./br.js": 17,
  43703. "./bs": 18,
  43704. "./bs.js": 18,
  43705. "./ca": 19,
  43706. "./ca.js": 19,
  43707. "./cs": 20,
  43708. "./cs.js": 20,
  43709. "./cv": 21,
  43710. "./cv.js": 21,
  43711. "./cy": 22,
  43712. "./cy.js": 22,
  43713. "./da": 23,
  43714. "./da.js": 23,
  43715. "./de": 25,
  43716. "./de-at": 24,
  43717. "./de-at.js": 24,
  43718. "./de.js": 25,
  43719. "./dv": 26,
  43720. "./dv.js": 26,
  43721. "./el": 27,
  43722. "./el.js": 27,
  43723. "./en-au": 28,
  43724. "./en-au.js": 28,
  43725. "./en-ca": 29,
  43726. "./en-ca.js": 29,
  43727. "./en-gb": 30,
  43728. "./en-gb.js": 30,
  43729. "./en-ie": 31,
  43730. "./en-ie.js": 31,
  43731. "./en-nz": 32,
  43732. "./en-nz.js": 32,
  43733. "./eo": 33,
  43734. "./eo.js": 33,
  43735. "./es": 35,
  43736. "./es-do": 34,
  43737. "./es-do.js": 34,
  43738. "./es.js": 35,
  43739. "./et": 36,
  43740. "./et.js": 36,
  43741. "./eu": 37,
  43742. "./eu.js": 37,
  43743. "./fa": 38,
  43744. "./fa.js": 38,
  43745. "./fi": 39,
  43746. "./fi.js": 39,
  43747. "./fo": 40,
  43748. "./fo.js": 40,
  43749. "./fr": 43,
  43750. "./fr-ca": 41,
  43751. "./fr-ca.js": 41,
  43752. "./fr-ch": 42,
  43753. "./fr-ch.js": 42,
  43754. "./fr.js": 43,
  43755. "./fy": 44,
  43756. "./fy.js": 44,
  43757. "./gd": 45,
  43758. "./gd.js": 45,
  43759. "./gl": 46,
  43760. "./gl.js": 46,
  43761. "./he": 47,
  43762. "./he.js": 47,
  43763. "./hi": 48,
  43764. "./hi.js": 48,
  43765. "./hr": 49,
  43766. "./hr.js": 49,
  43767. "./hu": 50,
  43768. "./hu.js": 50,
  43769. "./hy-am": 51,
  43770. "./hy-am.js": 51,
  43771. "./id": 52,
  43772. "./id.js": 52,
  43773. "./is": 53,
  43774. "./is.js": 53,
  43775. "./it": 54,
  43776. "./it.js": 54,
  43777. "./ja": 55,
  43778. "./ja.js": 55,
  43779. "./jv": 56,
  43780. "./jv.js": 56,
  43781. "./ka": 57,
  43782. "./ka.js": 57,
  43783. "./kk": 58,
  43784. "./kk.js": 58,
  43785. "./km": 59,
  43786. "./km.js": 59,
  43787. "./ko": 60,
  43788. "./ko.js": 60,
  43789. "./ky": 61,
  43790. "./ky.js": 61,
  43791. "./lb": 62,
  43792. "./lb.js": 62,
  43793. "./lo": 63,
  43794. "./lo.js": 63,
  43795. "./lt": 64,
  43796. "./lt.js": 64,
  43797. "./lv": 65,
  43798. "./lv.js": 65,
  43799. "./me": 66,
  43800. "./me.js": 66,
  43801. "./mi": 67,
  43802. "./mi.js": 67,
  43803. "./mk": 68,
  43804. "./mk.js": 68,
  43805. "./ml": 69,
  43806. "./ml.js": 69,
  43807. "./mr": 70,
  43808. "./mr.js": 70,
  43809. "./ms": 72,
  43810. "./ms-my": 71,
  43811. "./ms-my.js": 71,
  43812. "./ms.js": 72,
  43813. "./my": 73,
  43814. "./my.js": 73,
  43815. "./nb": 74,
  43816. "./nb.js": 74,
  43817. "./ne": 75,
  43818. "./ne.js": 75,
  43819. "./nl": 77,
  43820. "./nl-be": 76,
  43821. "./nl-be.js": 76,
  43822. "./nl.js": 77,
  43823. "./nn": 78,
  43824. "./nn.js": 78,
  43825. "./pa-in": 79,
  43826. "./pa-in.js": 79,
  43827. "./pl": 80,
  43828. "./pl.js": 80,
  43829. "./pt": 82,
  43830. "./pt-br": 81,
  43831. "./pt-br.js": 81,
  43832. "./pt.js": 82,
  43833. "./ro": 83,
  43834. "./ro.js": 83,
  43835. "./ru": 84,
  43836. "./ru.js": 84,
  43837. "./se": 85,
  43838. "./se.js": 85,
  43839. "./si": 86,
  43840. "./si.js": 86,
  43841. "./sk": 87,
  43842. "./sk.js": 87,
  43843. "./sl": 88,
  43844. "./sl.js": 88,
  43845. "./sq": 89,
  43846. "./sq.js": 89,
  43847. "./sr": 91,
  43848. "./sr-cyrl": 90,
  43849. "./sr-cyrl.js": 90,
  43850. "./sr.js": 91,
  43851. "./ss": 92,
  43852. "./ss.js": 92,
  43853. "./sv": 93,
  43854. "./sv.js": 93,
  43855. "./sw": 94,
  43856. "./sw.js": 94,
  43857. "./ta": 95,
  43858. "./ta.js": 95,
  43859. "./te": 96,
  43860. "./te.js": 96,
  43861. "./tet": 97,
  43862. "./tet.js": 97,
  43863. "./th": 98,
  43864. "./th.js": 98,
  43865. "./tl-ph": 99,
  43866. "./tl-ph.js": 99,
  43867. "./tlh": 100,
  43868. "./tlh.js": 100,
  43869. "./tr": 101,
  43870. "./tr.js": 101,
  43871. "./tzl": 102,
  43872. "./tzl.js": 102,
  43873. "./tzm": 104,
  43874. "./tzm-latn": 103,
  43875. "./tzm-latn.js": 103,
  43876. "./tzm.js": 104,
  43877. "./uk": 105,
  43878. "./uk.js": 105,
  43879. "./uz": 106,
  43880. "./uz.js": 106,
  43881. "./vi": 107,
  43882. "./vi.js": 107,
  43883. "./x-pseudo": 108,
  43884. "./x-pseudo.js": 108,
  43885. "./yo": 109,
  43886. "./yo.js": 109,
  43887. "./zh-cn": 110,
  43888. "./zh-cn.js": 110,
  43889. "./zh-hk": 111,
  43890. "./zh-hk.js": 111,
  43891. "./zh-tw": 112,
  43892. "./zh-tw.js": 112
  43893. };
  43894. function webpackContext(req) {
  43895. return __webpack_require__(webpackContextResolve(req));
  43896. };
  43897. function webpackContextResolve(req) {
  43898. var id = map[req];
  43899. if(!(id + 1)) // check for number
  43900. throw new Error("Cannot find module '" + req + "'.");
  43901. return id;
  43902. };
  43903. webpackContext.keys = function webpackContextKeys() {
  43904. return Object.keys(map);
  43905. };
  43906. webpackContext.resolve = webpackContextResolve;
  43907. module.exports = webpackContext;
  43908. webpackContext.id = 174;
  43909. /***/ }),
  43910. /* 175 */
  43911. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43912. "use strict";
  43913. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43914. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(2);
  43915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);
  43916. //
  43917. //
  43918. //
  43919. //
  43920. //
  43921. //
  43922. //
  43923. //
  43924. //
  43925. //
  43926. //
  43927. //
  43928. //
  43929. //
  43930. //
  43931. //
  43932. //
  43933. //
  43934. //
  43935. //
  43936. //
  43937. //
  43938. //
  43939. //
  43940. //
  43941. //
  43942. //
  43943. //
  43944. //
  43945. //
  43946. /* harmony default export */ __webpack_exports__["default"] = {
  43947. data: function () {
  43948. return {
  43949. options: {
  43950. updateInterval: null,
  43951. port: null,
  43952. updateState: null
  43953. }
  43954. }
  43955. },
  43956. created: function () {
  43957. var config = new XMLHttpRequest();
  43958. var form = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.$el);
  43959. var self = this;
  43960. config.open('GET', '/api/config');
  43961. config.onreadystatechange = function () {
  43962. if (config.readyState == XMLHttpRequest.DONE &&
  43963. config.status === 200) {
  43964. self.options = JSON.parse(config.response);
  43965. }
  43966. };
  43967. config.send(form.serialize());
  43968. },
  43969. methods: {
  43970. send(){
  43971. var self = this;
  43972. var config = new XMLHttpRequest();
  43973. config.open('POST', '/api/config');
  43974. config.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  43975. config.onreadystatechange = function () {
  43976. if (config.readyState == XMLHttpRequest.DONE &&
  43977. config.status === 200) {
  43978. // self.$router.push("/");
  43979. console.log(JSON.parse(config.response));
  43980. }
  43981. };
  43982. config.send(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a.param(self.options));
  43983. }
  43984. }
  43985. };
  43986. /***/ }),
  43987. /* 176 */
  43988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43989. "use strict";
  43990. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  43991. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  43992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  43993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  43994. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  43995. //
  43996. //
  43997. //
  43998. //
  43999. //
  44000. //
  44001. //
  44002. //
  44003. //
  44004. //
  44005. //
  44006. //
  44007. //
  44008. //
  44009. //
  44010. //
  44011. //
  44012. //
  44013. //
  44014. //
  44015. //
  44016. //
  44017. /* harmony default export */ __webpack_exports__["default"] = {
  44018. props: {
  44019. server: {
  44020. type: Object,
  44021. default:function () {
  44022. return {
  44023. id:0,
  44024. name: "Name",
  44025. address: "Address",
  44026. players: 0,
  44027. maxPlayers: 0,
  44028. isPassword: false
  44029. };
  44030. }
  44031. },
  44032. update: {
  44033. type: Function
  44034. }
  44035. },
  44036. data: function () {
  44037. return {};
  44038. },
  44039. methods: {
  44040. remove: function (id) {
  44041. var self = this;
  44042. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44043. title: 'Are you sure?',
  44044. text: "You won't be able to revert this!",
  44045. type: 'warning',
  44046. showCancelButton: true,
  44047. confirmButtonColor: '#3085d6',
  44048. cancelButtonColor: '#d33',
  44049. confirmButtonText: 'Yes, delete it!'
  44050. }).then(function () {
  44051. var req = new XMLHttpRequest();
  44052. __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.getJSON('/api/servers/remove/'+ id)
  44053. .done(function (res) {
  44054. self.update();
  44055. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(self.$el);
  44056. el.css("opacity", 0.5);
  44057. var actions = el.find("#actions");
  44058. actions.children().hide();
  44059. actions.append('<img src="svg/loading.svg"></img>');
  44060. });
  44061. }, function () {
  44062. }).catch(console.log);
  44063. }
  44064. }
  44065. };
  44066. /***/ }),
  44067. /* 177 */
  44068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44069. "use strict";
  44070. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  44072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  44073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  44074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  44075. //
  44076. //
  44077. //
  44078. //
  44079. //
  44080. //
  44081. //
  44082. //
  44083. //
  44084. //
  44085. //
  44086. //
  44087. //
  44088. //
  44089. //
  44090. //
  44091. //
  44092. //
  44093. //
  44094. //
  44095. //
  44096. //
  44097. //
  44098. //
  44099. //
  44100. //
  44101. //
  44102. //
  44103. //
  44104. //
  44105. //
  44106. //
  44107. //
  44108. //
  44109. //
  44110. //
  44111. //
  44112. //
  44113. //
  44114. /* harmony default export */ __webpack_exports__["default"] = {
  44115. created: function () {
  44116. this.update();
  44117. },
  44118. data: function () {
  44119. return {
  44120. details: {
  44121. traffic: {
  44122. }
  44123. },
  44124. server: {}
  44125. }
  44126. },
  44127. watch: {
  44128. "$root.servers": function () {
  44129. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  44130. }
  44131. },
  44132. methods: {
  44133. update: function () {
  44134. if(this.$root.servers.length !== 0 && this.$root.serversId){
  44135. this.server = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])];
  44136. }
  44137. var self = this;
  44138. __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.getJSON('/api/servers/get/'+this.$route.params.id)
  44139. .done(function (details) {
  44140. self.details = details;
  44141. });
  44142. },
  44143. remove: function (id) {
  44144. var self = this;
  44145. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44146. title: 'Are you sure?',
  44147. text: "You won't be able to revert this!",
  44148. type: 'warning',
  44149. showCancelButton: true,
  44150. confirmButtonColor: '#3085d6',
  44151. cancelButtonColor: '#d33',
  44152. confirmButtonText: 'Yes, delete it!'
  44153. }).then(function () {
  44154. __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.getJSON('/api/servers/remove/'+ id)
  44155. .done(function (res) {
  44156. });
  44157. self.$router.push("/");
  44158. }).catch(console.log);
  44159. }
  44160. }
  44161. };
  44162. /***/ }),
  44163. /* 178 */
  44164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44165. "use strict";
  44166. /* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44167. //
  44168. //
  44169. //
  44170. //
  44171. //
  44172. //
  44173. //
  44174. //
  44175. //
  44176. //
  44177. //
  44178. //
  44179. //
  44180. //
  44181. //
  44182. //
  44183. //
  44184. //
  44185. //
  44186. //
  44187. //
  44188. /* harmony default export */ __webpack_exports__["default"] = {
  44189. created: function () {
  44190. this.servers = this.$root.servers;
  44191. this.update();
  44192. },
  44193. watch: {
  44194. "$root.servers": function (val, old) {
  44195. this.servers = val;
  44196. }
  44197. },
  44198. data: function () {
  44199. return {
  44200. servers: [],
  44201. serversId: {}
  44202. }
  44203. },
  44204. methods: {
  44205. update: function () {
  44206. var self = this;
  44207. $.getJSON('/api/details')
  44208. .done(function () {
  44209. self.servers = JSON.parse(req.response);
  44210. var a;
  44211. self.$root.servers = self.servers;
  44212. self.$root.serversId = {};
  44213. for (a in self.servers) {
  44214. if (!self.servers.hasOwnProperty(a)) {
  44215. continue;
  44216. }
  44217. var obj = self.servers[a];
  44218. self.$root.serversId[obj.id] = a;
  44219. }
  44220. });
  44221. }
  44222. }
  44223. };
  44224. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(2)))
  44225. /***/ }),
  44226. /* 179 */
  44227. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44228. "use strict";
  44229. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44230. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2__ = __webpack_require__(3);
  44231. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sweetalert2__);
  44232. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(2);
  44233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);
  44234. //
  44235. //
  44236. //
  44237. //
  44238. //
  44239. //
  44240. //
  44241. //
  44242. //
  44243. //
  44244. //
  44245. //
  44246. //
  44247. //
  44248. //
  44249. //
  44250. //
  44251. //
  44252. //
  44253. //
  44254. //
  44255. //
  44256. //
  44257. //
  44258. //
  44259. /* harmony default export */ __webpack_exports__["default"] = {
  44260. mounted: function () {
  44261. this.request();
  44262. },
  44263. props: {
  44264. server: {
  44265. type: Object,
  44266. default:function () {
  44267. return {
  44268. id:0,
  44269. name: "Name",
  44270. address: "Address",
  44271. players: 0,
  44272. maxPlayers: 0,
  44273. isPassword: false
  44274. };
  44275. }
  44276. },
  44277. update: {
  44278. type: Function
  44279. },
  44280. onSubmit: {
  44281. type: Function,
  44282. default: function () {
  44283. }
  44284. },
  44285. buttonText: {
  44286. type: String,
  44287. default: function () {
  44288. return "Add";
  44289. }
  44290. }
  44291. },
  44292. data: function () {
  44293. return {};
  44294. },
  44295. methods: {
  44296. request: function () {
  44297. var self = this;
  44298. var form = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.$el);
  44299. form.submit(function(e){
  44300. e.preventDefault();
  44301. // Validation
  44302. var ar = form.serializeArray();
  44303. var flags = {
  44304. name: 0,
  44305. type: 0,
  44306. address: 0
  44307. }
  44308. ar.forEach(function (obj) {
  44309. if(!obj.value){
  44310. flags[obj.name] = 1;
  44311. }
  44312. });
  44313. var wrong = false;
  44314. for (var name in flags) {
  44315. var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('[name="'+name+'"]')
  44316. if (!flags.hasOwnProperty(name)) {
  44317. continue;
  44318. }
  44319. if(flags[name]){
  44320. wrong = true;
  44321. el.addClass("form-control-danger");
  44322. el.parent().addClass("has-danger");
  44323. }else{
  44324. el.removeClass("form-control-danger");
  44325. el.parent().removeClass("has-danger")
  44326. }
  44327. }
  44328. if(wrong){
  44329. __WEBPACK_IMPORTED_MODULE_0_sweetalert2___default()({
  44330. titleText: "Wrong input",
  44331. text:"Provide all data about server",
  44332. type:"error"
  44333. });
  44334. return;
  44335. }
  44336. // Request
  44337. __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.post('/api/servers/add', form.serialize())
  44338. .done(function () {
  44339. self.$router.push("/");
  44340. form.find("input, select").val("");
  44341. self.onSubmit();
  44342. });
  44343. });
  44344. }
  44345. }
  44346. };
  44347. /***/ }),
  44348. /* 180 */
  44349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44350. "use strict";
  44351. /* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  44352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js__ = __webpack_require__(125);
  44353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_chart_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_chart_js__);
  44354. //
  44355. //
  44356. //
  44357. var generateTemplate = function(){
  44358. var rand = function(){
  44359. return Math.floor(Math.random()*256);
  44360. }
  44361. var color = "rgba("+rand()+","+rand()+","+rand()+",0.1)";
  44362. // console.log(color);
  44363. return {
  44364. label: "Traffic",
  44365. fill: true,
  44366. lineTension: 0.1,
  44367. backgroundColor: "rgba(75,192,192,0.4)",
  44368. borderColor: color,
  44369. borderCapStyle: 'butt',
  44370. borderDash: [],
  44371. borderDashOffset: 0.0,
  44372. borderJoinStyle: 'miter',
  44373. pointBorderColor: color, //"rgba(75,192,192,1)",
  44374. pointBackgroundColor: "#fff",
  44375. // pointBorderWidth: 1,
  44376. // pointHoverRadius: 5,
  44377. // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44378. // pointHoverBorderColor: "rgba(220,220,220,1)",
  44379. // pointHoverBorderWidth: 2,
  44380. pointRadius: 1,
  44381. pointHitRadius: 10,
  44382. data: [],
  44383. spanGaps: true,
  44384. };
  44385. };
  44386. /* harmony default export */ __webpack_exports__["default"] = {
  44387. created: function () {
  44388. this.updateData();
  44389. },
  44390. mounted: function () {
  44391. //this.update();
  44392. },
  44393. props: {
  44394. server: {
  44395. type: Number,
  44396. default:-1
  44397. },
  44398. maxplayers: {
  44399. type: Number,
  44400. default:-1
  44401. }
  44402. },
  44403. data: function () {
  44404. return {
  44405. chart: {},
  44406. labels: {},
  44407. stamp: null
  44408. // datasetTempalte:{
  44409. // label: "Traffic",
  44410. // fill: true,
  44411. // // lineTension: 0.1,
  44412. // // backgroundColor: "rgba(75,192,192,0.4)",
  44413. // // borderColor: "rgba(75,192,192,1)",
  44414. // // borderCapStyle: 'butt',
  44415. // // borderDash: [],
  44416. // // borderDashOffset: 0.0,
  44417. // // borderJoinStyle: 'miter',
  44418. // // pointBorderColor: "rgba(75,192,192,1)",
  44419. // // pointBackgroundColor: "#fff",
  44420. // // pointBorderWidth: 1,
  44421. // // pointHoverRadius: 5,
  44422. // // pointHoverBackgroundColor: "rgba(75,192,192,1)",
  44423. // // pointHoverBorderColor: "rgba(220,220,220,1)",
  44424. // // pointHoverBorderWidth: 2,
  44425. // // pointRadius: 1,
  44426. // // pointHitRadius: 10,
  44427. // data: [],
  44428. // // spanGaps: false,
  44429. // },
  44430. }
  44431. },
  44432. methods: {
  44433. update: function () {
  44434. this.params = {
  44435. type: 'line',
  44436. data: this.graphdata,
  44437. options: {
  44438. responsive: true,
  44439. legend:{
  44440. display: false
  44441. },
  44442. scales: {
  44443. yAxes: [{
  44444. ticks: {
  44445. beginAtZero:true
  44446. }
  44447. }],
  44448. xAxes: [{
  44449. display: true,
  44450. type: 'time',
  44451. time: {
  44452. tooltipFormat: "H:mm:ss",
  44453. displayFormat: "H:mm:ss"
  44454. },
  44455. position: 'bottom'
  44456. }]
  44457. }
  44458. }
  44459. };
  44460. if(this.maxplayers > 0){
  44461. this.params.options.scales.yAxes[0].ticks.max = parseInt(this.maxplayers);
  44462. }else if(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers){
  44463. this.params.options.scales.yAxes[0].ticks.max = this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])].maxPlayers;
  44464. }
  44465. // console.log(this.$root.servers[parseInt(this.$root.serversId[this.$route.params.id])]);
  44466. // console.log(this.$root);
  44467. // console.log("Params ", this.params);
  44468. // console.log(JSON.stringify(this.params));
  44469. this.chart = new __WEBPACK_IMPORTED_MODULE_0_chart_js___default.a(this.$el, this.params);
  44470. },
  44471. updateData: function () {
  44472. this.graphdata = {
  44473. labels: [],
  44474. datasets: [
  44475. {
  44476. label: "Traffic",
  44477. data: null
  44478. }
  44479. ]
  44480. };
  44481. if(this.server === -1){
  44482. return -1;
  44483. }
  44484. var self = this;
  44485. var date = new Date();
  44486. var year = date.getUTCFullYear();
  44487. var month = date.getUTCMonth() + 1;
  44488. var day = date.getUTCDate();
  44489. var url = '/api/trafic/';
  44490. url += this.server;
  44491. url += "/";
  44492. url += day;
  44493. url += "/";
  44494. url += month;
  44495. url += "/";
  44496. url += year;
  44497. url += "/day";
  44498. // console.log(url);
  44499. $.getJSON(url)
  44500. .done(function (obj) {
  44501. if(obj.length <= 0){
  44502. return -1;
  44503. }
  44504. self.graphdata.datasets[0].data = [];
  44505. self.graphdata.datasets = [];
  44506. var firstStamp = new Date(obj[0].createdAt);
  44507. self.stamp = firstStamp;
  44508. var dataset = {
  44509. label: "Traffic",
  44510. data: [],
  44511. labels: []
  44512. };
  44513. // console.log(dataset);
  44514. dataset = Object.assign({}, generateTemplate(), dataset)
  44515. var lastStamp = firstStamp/1000;
  44516. var gap = firstStamp/1000 - new Date(obj[1].createdAt)/1000;
  44517. gap = Math.abs(Math.floor(gap));
  44518. obj.forEach(function (el) {
  44519. var stamp = new Date(el.createdAt) - firstStamp;
  44520. stamp /= 1000;
  44521. // console.log("Gap: ", gap);
  44522. // console.log("Stamp: ", stamp);
  44523. // console.log("lastStamp: ", lastStamp);
  44524. // console.log(stamp-lastStamp);
  44525. if(stamp-lastStamp > 2*gap){
  44526. // console.log("Dataset ", dataset);
  44527. self.graphdata.datasets.push(dataset);
  44528. dataset = {
  44529. label: "Traffic",
  44530. data: [],
  44531. labels: []
  44532. };
  44533. dataset = Object.assign({}, generateTemplate(), dataset)
  44534. }
  44535. lastStamp = stamp;
  44536. stamp /= 60;
  44537. stamp = Math.floor(stamp);
  44538. stamp = new Date(el.createdAt);
  44539. dataset.data.push({
  44540. x: stamp,
  44541. y: el.players
  44542. });
  44543. // self.graphdata.datasets[0].data.push({
  44544. // x: stamp,
  44545. // y: el.players
  44546. // });
  44547. // dataset.labels.push(new Date(el.createdAt).toLocaleTimeString());
  44548. self.labels[stamp] = new Date(el.createdAt).toLocaleTimeString();
  44549. });
  44550. // console.log("Dataset ", dataset);
  44551. // self.graphdata.datasets.push(dataset);
  44552. self.graphdata.datasets.push(dataset);
  44553. self.graphdata = JSON.parse(JSON.stringify(self.graphdata));
  44554. // console.log("Graphdata ", self.graphdata);
  44555. self.update();
  44556. });
  44557. }
  44558. }
  44559. };
  44560. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(2)))
  44561. /***/ }),
  44562. /* 181 */
  44563. /***/ (function(module, exports, __webpack_require__) {
  44564. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44565. return _c('div', {
  44566. staticClass: "container no-gutters"
  44567. }, [_c('div', {
  44568. staticClass: "row"
  44569. }, [_c('h1', [_vm._v(_vm._s(_vm.server.name) + " "), _c('small', {
  44570. staticClass: "text-muted"
  44571. }, [_vm._v(_vm._s(_vm.details.name))])])]), _vm._v(" "), _c('div', {
  44572. staticClass: "row"
  44573. }, [_c('div', {
  44574. staticClass: "col-5"
  44575. }, [_c('ul', {
  44576. staticClass: "list-unstyled"
  44577. }, [(_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', {
  44578. staticClass: "col-5"
  44579. }, [(_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', {
  44580. staticClass: "list-group"
  44581. }, _vm._l((_vm.details.players), function(player) {
  44582. return _c('li', {
  44583. staticClass: "list-group-item"
  44584. }, [_vm._v(_vm._s(player.name))])
  44585. })) : _vm._e()]), _vm._v(" "), _c('div', {
  44586. staticClass: "col-2"
  44587. }, [_c('button', {
  44588. staticClass: "btn btn-danger",
  44589. attrs: {
  44590. "type": "button"
  44591. },
  44592. on: {
  44593. "click": function($event) {
  44594. _vm.remove(_vm.$route.params.id)
  44595. }
  44596. }
  44597. }, [_vm._v("Remove")])])]), _vm._v(" "), _c('div', {
  44598. staticClass: "row"
  44599. }, [_c('servergraph', {
  44600. attrs: {
  44601. "server": parseInt(_vm.$route.params.id),
  44602. "maxplayers": _vm.server.maxPlayers
  44603. }
  44604. })], 1)])
  44605. },staticRenderFns: []}
  44606. module.exports.render._withStripped = true
  44607. if (false) {
  44608. module.hot.accept()
  44609. if (module.hot.data) {
  44610. require("vue-hot-reload-api").rerender("data-v-04a2f200", module.exports)
  44611. }
  44612. }
  44613. /***/ }),
  44614. /* 182 */
  44615. /***/ (function(module, exports, __webpack_require__) {
  44616. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44617. return _c('div', {
  44618. staticClass: "row"
  44619. }, [_c('div', {
  44620. staticClass: "col-4"
  44621. }, [_c('div', {
  44622. attrs: {
  44623. "id": "actions"
  44624. }
  44625. }, [_c('a', {
  44626. on: {
  44627. "click": function($event) {
  44628. _vm.remove(_vm.server.id)
  44629. }
  44630. }
  44631. }, [_c('img', {
  44632. attrs: {
  44633. "src": "svg/x.svg"
  44634. }
  44635. })]), _vm._v(" "), _vm._m(0)]), _vm._v(" "), _c('router-link', {
  44636. attrs: {
  44637. "server": _vm.server,
  44638. "to": {
  44639. path: '/server/' + _vm.server.id
  44640. }
  44641. }
  44642. }, [_vm._v("\n " + _vm._s(_vm.server.name) + " "), _c('img', {
  44643. directives: [{
  44644. name: "show",
  44645. rawName: "v-show",
  44646. value: (_vm.server.isPassword),
  44647. expression: "server.isPassword"
  44648. }],
  44649. staticClass: "icon",
  44650. attrs: {
  44651. "src": "svg/lock.svg"
  44652. }
  44653. })])], 1), _vm._v(" "), _c('div', {
  44654. staticClass: "col-3"
  44655. }, [_vm._v("\n " + _vm._s(_vm.server.fullType) + "\n ")]), _vm._v(" "), _c('div', {
  44656. staticClass: "col-3"
  44657. }, [_vm._v("\n " + _vm._s(_vm.server.address) + "\n ")]), _vm._v(" "), _c('div', {
  44658. staticClass: "col-2"
  44659. }, [_vm._v("\n " + _vm._s(_vm.server.players) + "/" + _vm._s(_vm.server.maxPlayers) + "\n ")])])
  44660. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44661. return _c('a', [_c('img', {
  44662. attrs: {
  44663. "src": "svg/pencil.svg"
  44664. }
  44665. })])
  44666. }]}
  44667. module.exports.render._withStripped = true
  44668. if (false) {
  44669. module.hot.accept()
  44670. if (module.hot.data) {
  44671. require("vue-hot-reload-api").rerender("data-v-49b001dc", module.exports)
  44672. }
  44673. }
  44674. /***/ }),
  44675. /* 183 */
  44676. /***/ (function(module, exports, __webpack_require__) {
  44677. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44678. return _c('div', {
  44679. staticClass: "container no-gutters",
  44680. attrs: {
  44681. "id": "serverList"
  44682. }
  44683. }, [_vm._m(0), _vm._v(" "), _vm._l((_vm.servers), function(server) {
  44684. return _c('server', {
  44685. attrs: {
  44686. "server": server,
  44687. "update": _vm.update
  44688. }
  44689. })
  44690. }), _vm._v(" "), _c('serveredit', {
  44691. attrs: {
  44692. "update": _vm.update,
  44693. "onSubmit": _vm.update
  44694. }
  44695. })], 2)
  44696. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44697. return _c('div', {
  44698. staticClass: "row",
  44699. attrs: {
  44700. "id": "titles"
  44701. }
  44702. }, [_c('div', {
  44703. staticClass: "col-4"
  44704. }, [_vm._v("\n Server name\n ")]), _vm._v(" "), _c('div', {
  44705. staticClass: "col-3"
  44706. }, [_vm._v("\n Server Type\n ")]), _vm._v(" "), _c('div', {
  44707. staticClass: "col-3"
  44708. }, [_vm._v("\n Address\n ")]), _vm._v(" "), _c('div', {
  44709. staticClass: "col-2"
  44710. }, [_vm._v("\n Players\n ")])])
  44711. }]}
  44712. module.exports.render._withStripped = true
  44713. if (false) {
  44714. module.hot.accept()
  44715. if (module.hot.data) {
  44716. require("vue-hot-reload-api").rerender("data-v-7440c7d0", module.exports)
  44717. }
  44718. }
  44719. /***/ }),
  44720. /* 184 */
  44721. /***/ (function(module, exports, __webpack_require__) {
  44722. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44723. return _c('form', [_c('div', {
  44724. staticClass: "container",
  44725. attrs: {
  44726. "id": "config"
  44727. }
  44728. }, [_c('div', {
  44729. staticClass: "form-group row"
  44730. }, [_c('label', {
  44731. staticClass: "col-2 col-form-label"
  44732. }, [_vm._v("Update Interval")]), _vm._v(" "), _c('div', {
  44733. staticClass: "col-10"
  44734. }, [_c('input', {
  44735. directives: [{
  44736. name: "model",
  44737. rawName: "v-model",
  44738. value: (_vm.options.updateInterval),
  44739. expression: "options.updateInterval"
  44740. }],
  44741. staticClass: "form-control",
  44742. attrs: {
  44743. "type": "Number"
  44744. },
  44745. domProps: {
  44746. "value": _vm._s(_vm.options.updateInterval)
  44747. },
  44748. on: {
  44749. "input": function($event) {
  44750. if ($event.target.composing) { return; }
  44751. _vm.options.updateInterval = $event.target.value
  44752. }
  44753. }
  44754. })])]), _vm._v(" "), _c('div', {
  44755. staticClass: "form-group row"
  44756. }, [_c('label', {
  44757. staticClass: "col-2 col-form-label"
  44758. }, [_vm._v("Port")]), _vm._v(" "), _c('div', {
  44759. staticClass: "col-10"
  44760. }, [_c('input', {
  44761. directives: [{
  44762. name: "model",
  44763. rawName: "v-model",
  44764. value: (_vm.options.port),
  44765. expression: "options.port"
  44766. }],
  44767. staticClass: "form-control",
  44768. attrs: {
  44769. "type": "number"
  44770. },
  44771. domProps: {
  44772. "value": _vm._s(_vm.options.port)
  44773. },
  44774. on: {
  44775. "input": function($event) {
  44776. if ($event.target.composing) { return; }
  44777. _vm.options.port = _vm._n($event.target.value)
  44778. },
  44779. "blur": function($event) {
  44780. _vm.$forceUpdate()
  44781. }
  44782. }
  44783. })])]), _vm._v(" "), _c('div', {
  44784. staticClass: "form-group row"
  44785. }, [_c('label', {
  44786. staticClass: "col-2 col-form-label"
  44787. }, [_vm._v("Start data collector on start?")]), _vm._v(" "), _c('div', {
  44788. staticClass: "col-10"
  44789. }, [_c('select', {
  44790. directives: [{
  44791. name: "model",
  44792. rawName: "v-model",
  44793. value: (_vm.options.updateState),
  44794. expression: "options.updateState"
  44795. }],
  44796. staticClass: "form-control",
  44797. on: {
  44798. "change": function($event) {
  44799. _vm.options.updateState = Array.prototype.filter.call($event.target.options, function(o) {
  44800. return o.selected
  44801. }).map(function(o) {
  44802. var val = "_value" in o ? o._value : o.value;
  44803. return val
  44804. })[0]
  44805. }
  44806. }
  44807. }, [_c('option', {
  44808. attrs: {
  44809. "value": "true"
  44810. }
  44811. }, [_vm._v("Yes")]), _vm._v(" "), _c('option', {
  44812. attrs: {
  44813. "value": "false"
  44814. }
  44815. }, [_vm._v("No")])])])]), _vm._v(" "), _c('div', {
  44816. staticClass: "row"
  44817. }, [_c('button', {
  44818. staticClass: "btn btn-primary",
  44819. on: {
  44820. "click": _vm.send
  44821. }
  44822. }, [_vm._v("Save")])])])])
  44823. },staticRenderFns: []}
  44824. module.exports.render._withStripped = true
  44825. if (false) {
  44826. module.hot.accept()
  44827. if (module.hot.data) {
  44828. require("vue-hot-reload-api").rerender("data-v-798d3b91", module.exports)
  44829. }
  44830. }
  44831. /***/ }),
  44832. /* 185 */
  44833. /***/ (function(module, exports, __webpack_require__) {
  44834. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44835. return _c('form', {
  44836. attrs: {
  44837. "action": "/api/servers/add",
  44838. "method": "post"
  44839. }
  44840. }, [_c('div', {
  44841. staticClass: "row editor form-group"
  44842. }, [_vm._m(0), _vm._v(" "), _c('div', {
  44843. staticClass: "col-3"
  44844. }, [_c('select', {
  44845. staticClass: "form-control",
  44846. attrs: {
  44847. "name": "type"
  44848. }
  44849. }, [_c('option', {
  44850. attrs: {
  44851. "value": ""
  44852. }
  44853. }, [_vm._v("Server type")]), _vm._v(" "), _vm._l((_vm.$root.types), function(option, key) {
  44854. return _c('option', {
  44855. domProps: {
  44856. "value": option
  44857. }
  44858. }, [_vm._v("\n " + _vm._s(key) + "\n ")])
  44859. })], 2)]), _vm._v(" "), _vm._m(1), _vm._v(" "), _c('div', {
  44860. staticClass: "col-2"
  44861. }, [_c('button', {
  44862. staticClass: "btn btn-primary",
  44863. attrs: {
  44864. "type": "submit"
  44865. }
  44866. }, [_vm._v(_vm._s(_vm.buttonText))])])])])
  44867. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44868. return _c('div', {
  44869. staticClass: "col-4"
  44870. }, [_c('input', {
  44871. staticClass: "form-control",
  44872. attrs: {
  44873. "placeholder": "Name",
  44874. "name": "name"
  44875. }
  44876. })])
  44877. },function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44878. return _c('div', {
  44879. staticClass: "col-3"
  44880. }, [_c('input', {
  44881. staticClass: "form-control",
  44882. attrs: {
  44883. "placeholder": "Address",
  44884. "name": "address"
  44885. }
  44886. })])
  44887. }]}
  44888. module.exports.render._withStripped = true
  44889. if (false) {
  44890. module.hot.accept()
  44891. if (module.hot.data) {
  44892. require("vue-hot-reload-api").rerender("data-v-7fae8b1c", module.exports)
  44893. }
  44894. }
  44895. /***/ }),
  44896. /* 186 */
  44897. /***/ (function(module, exports, __webpack_require__) {
  44898. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  44899. return _c('canvas', {
  44900. attrs: {
  44901. "id": "graph"
  44902. }
  44903. })
  44904. },staticRenderFns: []}
  44905. module.exports.render._withStripped = true
  44906. if (false) {
  44907. module.hot.accept()
  44908. if (module.hot.data) {
  44909. require("vue-hot-reload-api").rerender("data-v-bbf0e6a8", module.exports)
  44910. }
  44911. }
  44912. /***/ }),
  44913. /* 187 */
  44914. /***/ (function(module, exports, __webpack_require__) {
  44915. // style-loader: Adds some css to the DOM by adding a <style> tag
  44916. // load the styles
  44917. var content = __webpack_require__(172);
  44918. if(typeof content === 'string') content = [[module.i, content, '']];
  44919. if(content.locals) module.exports = content.locals;
  44920. // add the styles to the DOM
  44921. var update = __webpack_require__(114)("2b78970d", content, false);
  44922. // Hot Module Replacement
  44923. if(false) {
  44924. // When the styles change, update the <style> tags
  44925. if(!content.locals) {
  44926. 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() {
  44927. 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");
  44928. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  44929. update(newContent);
  44930. });
  44931. }
  44932. // When the module is disposed, remove the <style> tags
  44933. module.hot.dispose(function() { update(); });
  44934. }
  44935. /***/ }),
  44936. /* 188 */
  44937. /***/ (function(module, exports, __webpack_require__) {
  44938. // style-loader: Adds some css to the DOM by adding a <style> tag
  44939. // load the styles
  44940. var content = __webpack_require__(173);
  44941. if(typeof content === 'string') content = [[module.i, content, '']];
  44942. if(content.locals) module.exports = content.locals;
  44943. // add the styles to the DOM
  44944. var update = __webpack_require__(114)("717e19e0", content, false);
  44945. // Hot Module Replacement
  44946. if(false) {
  44947. // When the styles change, update the <style> tags
  44948. if(!content.locals) {
  44949. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-798d3b91\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue", function() {
  44950. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?{\"id\":\"data-v-798d3b91\",\"scoped\":false,\"hasInlineConfig\":false}!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./config.vue");
  44951. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  44952. update(newContent);
  44953. });
  44954. }
  44955. // When the module is disposed, remove the <style> tags
  44956. module.hot.dispose(function() { update(); });
  44957. }
  44958. /***/ }),
  44959. /* 189 */
  44960. /***/ (function(module, exports) {
  44961. /**
  44962. * Translates the list format produced by css-loader into something
  44963. * easier to manipulate.
  44964. */
  44965. module.exports = function listToStyles (parentId, list) {
  44966. var styles = []
  44967. var newStyles = {}
  44968. for (var i = 0; i < list.length; i++) {
  44969. var item = list[i]
  44970. var id = item[0]
  44971. var css = item[1]
  44972. var media = item[2]
  44973. var sourceMap = item[3]
  44974. var part = {
  44975. id: parentId + ':' + i,
  44976. css: css,
  44977. media: media,
  44978. sourceMap: sourceMap
  44979. }
  44980. if (!newStyles[id]) {
  44981. styles.push(newStyles[id] = { id: id, parts: [part] })
  44982. } else {
  44983. newStyles[id].parts.push(part)
  44984. }
  44985. }
  44986. return styles
  44987. }
  44988. /***/ }),
  44989. /* 190 */
  44990. /***/ (function(module, exports) {
  44991. var g;
  44992. // This works in non-strict mode
  44993. g = (function() {
  44994. return this;
  44995. })();
  44996. try {
  44997. // This works if eval is allowed (see CSP)
  44998. g = g || Function("return this")() || (1,eval)("this");
  44999. } catch(e) {
  45000. // This works if the window reference is available
  45001. if(typeof window === "object")
  45002. g = window;
  45003. }
  45004. // g can still be undefined, but nothing to do about it...
  45005. // We return undefined, instead of nothing here, so it's
  45006. // easier to handle this case. if(!global) { ...}
  45007. module.exports = g;
  45008. /***/ }),
  45009. /* 191 */
  45010. /***/ (function(module, exports) {
  45011. module.exports = function(module) {
  45012. if(!module.webpackPolyfill) {
  45013. module.deprecate = function() {};
  45014. module.paths = [];
  45015. // module.parent = undefined by default
  45016. if(!module.children) module.children = [];
  45017. Object.defineProperty(module, "loaded", {
  45018. enumerable: true,
  45019. get: function() {
  45020. return module.l;
  45021. }
  45022. });
  45023. Object.defineProperty(module, "id", {
  45024. enumerable: true,
  45025. get: function() {
  45026. return module.i;
  45027. }
  45028. });
  45029. module.webpackPolyfill = 1;
  45030. }
  45031. return module;
  45032. };
  45033. /***/ }),
  45034. /* 192 */
  45035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45036. "use strict";
  45037. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  45038. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_bootstrap_dist_css_bootstrap_css__ = __webpack_require__(115);
  45039. /* 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__);
  45040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__ = __webpack_require__(116);
  45041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert2_dist_sweetalert2_css__);
  45042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(124);
  45043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);
  45044. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(123);
  45045. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_router__);
  45046. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_jquery__ = __webpack_require__(2);
  45047. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_jquery__);
  45048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config_vue__ = __webpack_require__(117);
  45049. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__config_vue__);
  45050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverList_vue__ = __webpack_require__(120);
  45051. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__serverList_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__serverList_vue__);
  45052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__serverDetails_vue__ = __webpack_require__(119);
  45053. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__serverDetails_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__serverDetails_vue__);
  45054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__server_vue__ = __webpack_require__(118);
  45055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__server_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__server_vue__);
  45056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__serveredit_vue__ = __webpack_require__(121);
  45057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__serveredit_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__serveredit_vue__);
  45058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__servergraph_vue__ = __webpack_require__(122);
  45059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__servergraph_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__servergraph_vue__);
  45060. // import $ from "jquery";
  45061. // import "bootstrap/dist/js/bootstrap.js";
  45062. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router___default.a);
  45063. // Debug mode
  45064. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.debug = true;
  45065. // Devtools enabled
  45066. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.devtools = true;
  45067. // Silence logs and warnings
  45068. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.config.silent = false;
  45069. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('server', __WEBPACK_IMPORTED_MODULE_8__server_vue___default.a);
  45070. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('serveredit', __WEBPACK_IMPORTED_MODULE_9__serveredit_vue___default.a);
  45071. __WEBPACK_IMPORTED_MODULE_2_vue___default.a.component('servergraph', __WEBPACK_IMPORTED_MODULE_10__servergraph_vue___default.a);
  45072. var routes = [
  45073. { path: "/", component: __WEBPACK_IMPORTED_MODULE_6__serverList_vue___default.a },
  45074. { path: "/server/:id", component: __WEBPACK_IMPORTED_MODULE_7__serverDetails_vue___default.a },
  45075. { path: "/config", component: __WEBPACK_IMPORTED_MODULE_5__config_vue___default.a }
  45076. ];
  45077. const router = new __WEBPACK_IMPORTED_MODULE_3_vue_router___default.a({
  45078. routes: routes,
  45079. mode: 'history'
  45080. });
  45081. __WEBPACK_IMPORTED_MODULE_4_jquery___default()(function () {
  45082. var app = new __WEBPACK_IMPORTED_MODULE_2_vue___default.a({
  45083. router: router,
  45084. el: "#statsApp",
  45085. data: {
  45086. servers: [],
  45087. serversId: {},
  45088. types: []
  45089. },
  45090. created: function(){
  45091. var self = this;
  45092. __WEBPACK_IMPORTED_MODULE_4_jquery___default.a.getJSON('/api/types')
  45093. .done(function (types) {
  45094. self.types = types;
  45095. });
  45096. __WEBPACK_IMPORTED_MODULE_4_jquery___default.a.getJSON('/api/details/cached')
  45097. .done(function (res) {
  45098. self.$root.servers = res;
  45099. self.$root.serversId = {};
  45100. for (var a in self.servers) {
  45101. if (!self.servers.hasOwnProperty(a)) {
  45102. continue;
  45103. }
  45104. var obj = self.servers[a];
  45105. self.$root.serversId[obj.id] = a;
  45106. }
  45107. });
  45108. if(this.$route.path !== "/"){
  45109. __WEBPACK_IMPORTED_MODULE_4_jquery___default.a.getJSON('/api/details')
  45110. .done(function (details) {
  45111. self.$root.servers = details;
  45112. self.$root.serversId = {};
  45113. for (var a in self.servers) {
  45114. if (!self.servers.hasOwnProperty(a)) {
  45115. continue;
  45116. }
  45117. var obj = self.servers[a];
  45118. self.$root.serversId[obj.id] = a;
  45119. }
  45120. });
  45121. }
  45122. }
  45123. });//.$mount("#statsApp");
  45124. });
  45125. /***/ })
  45126. /******/ ]);